rj_schema 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
- data/ext/rj_schema/rapidjson/CMakeLists.txt +226 -0
- data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
- data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +25 -0
- data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
- data/ext/rj_schema/rapidjson/appveyor.yml +54 -0
- data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
- data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
- data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
- data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
- data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
- data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
- data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
- data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
- data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
- data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
- data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
- data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
- data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
- data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
- data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
- data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
- data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
- data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
- data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
- data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
- data/ext/rj_schema/rapidjson/doc/dom.md +281 -0
- data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +285 -0
- data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
- data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
- data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
- data/ext/rj_schema/rapidjson/doc/features.md +104 -0
- data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
- data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
- data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
- data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
- data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
- data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
- data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
- data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
- data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
- data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
- data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
- data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
- data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
- data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
- data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
- data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
- data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
- data/ext/rj_schema/rapidjson/doc/stream.md +429 -0
- data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +429 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
- data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +535 -0
- data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
- data/ext/rj_schema/rapidjson/example/CMakeLists.txt +46 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
- data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
- data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
- data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
- data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
- data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
- data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
- data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
- data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
- data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
- data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
- data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
- data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +78 -0
- data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
- data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
- data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
- data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
- data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
- data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
- data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +284 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +2732 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +74 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +161 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +257 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +308 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +186 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +739 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +232 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +69 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +290 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +128 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1415 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +676 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2236 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2496 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +710 -0
- data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
- data/ext/rj_schema/rapidjson/library.json +15 -0
- data/ext/rj_schema/rapidjson/license.txt +57 -0
- data/ext/rj_schema/rapidjson/package.json +24 -0
- data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
- data/ext/rj_schema/rapidjson/readme.md +210 -0
- data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
- data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
- data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
- data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +185 -0
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +546 -0
- data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +92 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +100 -0
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +672 -0
- data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
- data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
- data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +155 -0
- data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
- data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
- data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
- data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
- data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1638 -0
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2225 -0
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2072 -0
- data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
- data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
- data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
- data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
- data/ext/rj_schema/rapidjson/test/unittest/unittest.h +143 -0
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1851 -0
- data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
- data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +33 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +122 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +242 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +564 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3660 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +447 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +627 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2571 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +833 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1379 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2258 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +675 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +178 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +5255 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +91 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1918 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +95 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +286 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +574 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +145 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +151 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +176 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +34 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +204 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +573 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +883 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1575 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1230 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +647 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +718 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +6767 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +710 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +511 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2771 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +691 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +183 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +310 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +317 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +323 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +262 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +312 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +339 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +280 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +2416 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/faq.md +1092 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/primer.md +536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/samples.md +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +342 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +249 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1438 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +501 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +1082 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +231 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +264 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2332 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +357 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +70 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +275 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +205 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5139 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +279 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +723 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2687 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3347 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +313 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +152 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +49 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +225 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +118 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +174 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1536 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +385 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1277 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +458 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +102 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5846 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1424 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +652 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +213 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +61 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1110 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +53 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1303 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1737 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +210 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +87 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +235 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +129 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +119 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +124 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +189 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +638 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +138 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +344 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1067 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +781 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +236 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +250 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +318 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +69 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7797 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +48 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +140 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +378 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +179 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +196 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1182 -0
- data/ext/rj_schema/rapidjson/travis-doxygen.sh +128 -0
- metadata +613 -1
@@ -0,0 +1,56 @@
|
|
1
|
+
// Copyright 2006, Google Inc.
|
2
|
+
// All rights reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions are
|
6
|
+
// met:
|
7
|
+
//
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
11
|
+
// copyright notice, this list of conditions and the following disclaimer
|
12
|
+
// in the documentation and/or other materials provided with the
|
13
|
+
// distribution.
|
14
|
+
// * Neither the name of Google Inc. nor the names of its
|
15
|
+
// contributors may be used to endorse or promote products derived from
|
16
|
+
// this software without specific prior written permission.
|
17
|
+
//
|
18
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
|
30
|
+
// Tests that a Google Test program that has no test defined can run
|
31
|
+
// successfully.
|
32
|
+
//
|
33
|
+
// Author: wan@google.com (Zhanyong Wan)
|
34
|
+
|
35
|
+
#include "gtest/gtest.h"
|
36
|
+
|
37
|
+
int main(int argc, char **argv) {
|
38
|
+
testing::InitGoogleTest(&argc, argv);
|
39
|
+
|
40
|
+
// An ad-hoc assertion outside of all tests.
|
41
|
+
//
|
42
|
+
// This serves three purposes:
|
43
|
+
//
|
44
|
+
// 1. It verifies that an ad-hoc assertion can be executed even if
|
45
|
+
// no test is defined.
|
46
|
+
// 2. It verifies that a failed ad-hoc assertion causes the test
|
47
|
+
// program to fail.
|
48
|
+
// 3. We had a bug where the XML output won't be generated if an
|
49
|
+
// assertion is executed before RUN_ALL_TESTS() is called, even
|
50
|
+
// though --gtest_output=xml is specified. This makes sure the
|
51
|
+
// bug is fixed and doesn't regress.
|
52
|
+
EXPECT_EQ(1, 2);
|
53
|
+
|
54
|
+
// The above EXPECT_EQ() should cause RUN_ALL_TESTS() to return non-zero.
|
55
|
+
return RUN_ALL_TESTS() ? 0 : 1;
|
56
|
+
}
|
@@ -0,0 +1,344 @@
|
|
1
|
+
#!/usr/bin/env python
|
2
|
+
#
|
3
|
+
# Copyright 2008, Google Inc.
|
4
|
+
# All rights reserved.
|
5
|
+
#
|
6
|
+
# Redistribution and use in source and binary forms, with or without
|
7
|
+
# modification, are permitted provided that the following conditions are
|
8
|
+
# met:
|
9
|
+
#
|
10
|
+
# * Redistributions of source code must retain the above copyright
|
11
|
+
# notice, this list of conditions and the following disclaimer.
|
12
|
+
# * Redistributions in binary form must reproduce the above
|
13
|
+
# copyright notice, this list of conditions and the following disclaimer
|
14
|
+
# in the documentation and/or other materials provided with the
|
15
|
+
# distribution.
|
16
|
+
# * Neither the name of Google Inc. nor the names of its
|
17
|
+
# contributors may be used to endorse or promote products derived from
|
18
|
+
# this software without specific prior written permission.
|
19
|
+
#
|
20
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
21
|
+
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
22
|
+
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
23
|
+
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
24
|
+
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
25
|
+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
26
|
+
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
27
|
+
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
28
|
+
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
29
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
30
|
+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
|
32
|
+
"""Tests the text output of Google C++ Testing and Mocking Framework.
|
33
|
+
|
34
|
+
|
35
|
+
SYNOPSIS
|
36
|
+
gtest_output_test.py --build_dir=BUILD/DIR --gengolden
|
37
|
+
# where BUILD/DIR contains the built gtest_output_test_ file.
|
38
|
+
gtest_output_test.py --gengolden
|
39
|
+
gtest_output_test.py
|
40
|
+
"""
|
41
|
+
|
42
|
+
__author__ = 'wan@google.com (Zhanyong Wan)'
|
43
|
+
|
44
|
+
import difflib
|
45
|
+
import os
|
46
|
+
import re
|
47
|
+
import sys
|
48
|
+
import gtest_test_utils
|
49
|
+
|
50
|
+
|
51
|
+
# The flag for generating the golden file
|
52
|
+
GENGOLDEN_FLAG = '--gengolden'
|
53
|
+
CATCH_EXCEPTIONS_ENV_VAR_NAME = 'GTEST_CATCH_EXCEPTIONS'
|
54
|
+
|
55
|
+
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
|
56
|
+
IS_WINDOWS = os.name == 'nt'
|
57
|
+
|
58
|
+
# TODO(vladl@google.com): remove the _lin suffix.
|
59
|
+
GOLDEN_NAME = 'gtest_output_test_golden_lin.txt'
|
60
|
+
|
61
|
+
PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_output_test_')
|
62
|
+
|
63
|
+
# At least one command we exercise must not have the
|
64
|
+
# 'internal_skip_environment_and_ad_hoc_tests' argument.
|
65
|
+
COMMAND_LIST_TESTS = ({}, [PROGRAM_PATH, '--gtest_list_tests'])
|
66
|
+
COMMAND_WITH_COLOR = ({}, [PROGRAM_PATH, '--gtest_color=yes'])
|
67
|
+
COMMAND_WITH_TIME = ({}, [PROGRAM_PATH,
|
68
|
+
'--gtest_print_time',
|
69
|
+
'internal_skip_environment_and_ad_hoc_tests',
|
70
|
+
'--gtest_filter=FatalFailureTest.*:LoggingTest.*'])
|
71
|
+
COMMAND_WITH_DISABLED = (
|
72
|
+
{}, [PROGRAM_PATH,
|
73
|
+
'--gtest_also_run_disabled_tests',
|
74
|
+
'internal_skip_environment_and_ad_hoc_tests',
|
75
|
+
'--gtest_filter=*DISABLED_*'])
|
76
|
+
COMMAND_WITH_SHARDING = (
|
77
|
+
{'GTEST_SHARD_INDEX': '1', 'GTEST_TOTAL_SHARDS': '2'},
|
78
|
+
[PROGRAM_PATH,
|
79
|
+
'internal_skip_environment_and_ad_hoc_tests',
|
80
|
+
'--gtest_filter=PassingTest.*'])
|
81
|
+
|
82
|
+
GOLDEN_PATH = os.path.join(gtest_test_utils.GetSourceDir(), GOLDEN_NAME)
|
83
|
+
|
84
|
+
|
85
|
+
def ToUnixLineEnding(s):
|
86
|
+
"""Changes all Windows/Mac line endings in s to UNIX line endings."""
|
87
|
+
|
88
|
+
return s.replace('\r\n', '\n').replace('\r', '\n')
|
89
|
+
|
90
|
+
|
91
|
+
def RemoveLocations(test_output):
|
92
|
+
"""Removes all file location info from a Google Test program's output.
|
93
|
+
|
94
|
+
Args:
|
95
|
+
test_output: the output of a Google Test program.
|
96
|
+
|
97
|
+
Returns:
|
98
|
+
output with all file location info (in the form of
|
99
|
+
'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
|
100
|
+
'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
|
101
|
+
'FILE_NAME:#: '.
|
102
|
+
"""
|
103
|
+
|
104
|
+
return re.sub(r'.*[/\\]((gtest_output_test_|gtest).cc)(\:\d+|\(\d+\))\: ',
|
105
|
+
r'\1:#: ', test_output)
|
106
|
+
|
107
|
+
|
108
|
+
def RemoveStackTraceDetails(output):
|
109
|
+
"""Removes all stack traces from a Google Test program's output."""
|
110
|
+
|
111
|
+
# *? means "find the shortest string that matches".
|
112
|
+
return re.sub(r'Stack trace:(.|\n)*?\n\n',
|
113
|
+
'Stack trace: (omitted)\n\n', output)
|
114
|
+
|
115
|
+
|
116
|
+
def RemoveStackTraces(output):
|
117
|
+
"""Removes all traces of stack traces from a Google Test program's output."""
|
118
|
+
|
119
|
+
# *? means "find the shortest string that matches".
|
120
|
+
return re.sub(r'Stack trace:(.|\n)*?\n\n', '', output)
|
121
|
+
|
122
|
+
|
123
|
+
def RemoveTime(output):
|
124
|
+
"""Removes all time information from a Google Test program's output."""
|
125
|
+
|
126
|
+
return re.sub(r'\(\d+ ms', '(? ms', output)
|
127
|
+
|
128
|
+
|
129
|
+
def RemoveTypeInfoDetails(test_output):
|
130
|
+
"""Removes compiler-specific type info from Google Test program's output.
|
131
|
+
|
132
|
+
Args:
|
133
|
+
test_output: the output of a Google Test program.
|
134
|
+
|
135
|
+
Returns:
|
136
|
+
output with type information normalized to canonical form.
|
137
|
+
"""
|
138
|
+
|
139
|
+
# some compilers output the name of type 'unsigned int' as 'unsigned'
|
140
|
+
return re.sub(r'unsigned int', 'unsigned', test_output)
|
141
|
+
|
142
|
+
|
143
|
+
def NormalizeToCurrentPlatform(test_output):
|
144
|
+
"""Normalizes platform specific output details for easier comparison."""
|
145
|
+
|
146
|
+
if IS_WINDOWS:
|
147
|
+
# Removes the color information that is not present on Windows.
|
148
|
+
test_output = re.sub('\x1b\\[(0;3\d)?m', '', test_output)
|
149
|
+
# Changes failure message headers into the Windows format.
|
150
|
+
test_output = re.sub(r': Failure\n', r': error: ', test_output)
|
151
|
+
# Changes file(line_number) to file:line_number.
|
152
|
+
test_output = re.sub(r'((\w|\.)+)\((\d+)\):', r'\1:\3:', test_output)
|
153
|
+
|
154
|
+
return test_output
|
155
|
+
|
156
|
+
|
157
|
+
def RemoveTestCounts(output):
|
158
|
+
"""Removes test counts from a Google Test program's output."""
|
159
|
+
|
160
|
+
output = re.sub(r'\d+ tests?, listed below',
|
161
|
+
'? tests, listed below', output)
|
162
|
+
output = re.sub(r'\d+ FAILED TESTS',
|
163
|
+
'? FAILED TESTS', output)
|
164
|
+
output = re.sub(r'\d+ tests? from \d+ test cases?',
|
165
|
+
'? tests from ? test cases', output)
|
166
|
+
output = re.sub(r'\d+ tests? from ([a-zA-Z_])',
|
167
|
+
r'? tests from \1', output)
|
168
|
+
return re.sub(r'\d+ tests?\.', '? tests.', output)
|
169
|
+
|
170
|
+
|
171
|
+
def RemoveMatchingTests(test_output, pattern):
|
172
|
+
"""Removes output of specified tests from a Google Test program's output.
|
173
|
+
|
174
|
+
This function strips not only the beginning and the end of a test but also
|
175
|
+
all output in between.
|
176
|
+
|
177
|
+
Args:
|
178
|
+
test_output: A string containing the test output.
|
179
|
+
pattern: A regex string that matches names of test cases or
|
180
|
+
tests to remove.
|
181
|
+
|
182
|
+
Returns:
|
183
|
+
Contents of test_output with tests whose names match pattern removed.
|
184
|
+
"""
|
185
|
+
|
186
|
+
test_output = re.sub(
|
187
|
+
r'.*\[ RUN \] .*%s(.|\n)*?\[( FAILED | OK )\] .*%s.*\n' % (
|
188
|
+
pattern, pattern),
|
189
|
+
'',
|
190
|
+
test_output)
|
191
|
+
return re.sub(r'.*%s.*\n' % pattern, '', test_output)
|
192
|
+
|
193
|
+
|
194
|
+
def NormalizeOutput(output):
|
195
|
+
"""Normalizes output (the output of gtest_output_test_.exe)."""
|
196
|
+
|
197
|
+
output = ToUnixLineEnding(output)
|
198
|
+
output = RemoveLocations(output)
|
199
|
+
output = RemoveStackTraceDetails(output)
|
200
|
+
output = RemoveTime(output)
|
201
|
+
return output
|
202
|
+
|
203
|
+
|
204
|
+
def GetShellCommandOutput(env_cmd):
|
205
|
+
"""Runs a command in a sub-process, and returns its output in a string.
|
206
|
+
|
207
|
+
Args:
|
208
|
+
env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
|
209
|
+
environment variables to set, and element 1 is a string with
|
210
|
+
the command and any flags.
|
211
|
+
|
212
|
+
Returns:
|
213
|
+
A string with the command's combined standard and diagnostic output.
|
214
|
+
"""
|
215
|
+
|
216
|
+
# Spawns cmd in a sub-process, and gets its standard I/O file objects.
|
217
|
+
# Set and save the environment properly.
|
218
|
+
environ = os.environ.copy()
|
219
|
+
environ.update(env_cmd[0])
|
220
|
+
p = gtest_test_utils.Subprocess(env_cmd[1], env=environ)
|
221
|
+
|
222
|
+
return p.output
|
223
|
+
|
224
|
+
|
225
|
+
def GetCommandOutput(env_cmd):
|
226
|
+
"""Runs a command and returns its output with all file location
|
227
|
+
info stripped off.
|
228
|
+
|
229
|
+
Args:
|
230
|
+
env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
|
231
|
+
environment variables to set, and element 1 is a string with
|
232
|
+
the command and any flags.
|
233
|
+
"""
|
234
|
+
|
235
|
+
# Disables exception pop-ups on Windows.
|
236
|
+
environ, cmdline = env_cmd
|
237
|
+
environ = dict(environ) # Ensures we are modifying a copy.
|
238
|
+
environ[CATCH_EXCEPTIONS_ENV_VAR_NAME] = '1'
|
239
|
+
return NormalizeOutput(GetShellCommandOutput((environ, cmdline)))
|
240
|
+
|
241
|
+
|
242
|
+
def GetOutputOfAllCommands():
|
243
|
+
"""Returns concatenated output from several representative commands."""
|
244
|
+
|
245
|
+
return (GetCommandOutput(COMMAND_WITH_COLOR) +
|
246
|
+
GetCommandOutput(COMMAND_WITH_TIME) +
|
247
|
+
GetCommandOutput(COMMAND_WITH_DISABLED) +
|
248
|
+
GetCommandOutput(COMMAND_WITH_SHARDING))
|
249
|
+
|
250
|
+
|
251
|
+
test_list = GetShellCommandOutput(COMMAND_LIST_TESTS)
|
252
|
+
SUPPORTS_DEATH_TESTS = 'DeathTest' in test_list
|
253
|
+
SUPPORTS_TYPED_TESTS = 'TypedTest' in test_list
|
254
|
+
SUPPORTS_THREADS = 'ExpectFailureWithThreadsTest' in test_list
|
255
|
+
SUPPORTS_STACK_TRACES = IS_LINUX
|
256
|
+
|
257
|
+
CAN_GENERATE_GOLDEN_FILE = (SUPPORTS_DEATH_TESTS and
|
258
|
+
SUPPORTS_TYPED_TESTS and
|
259
|
+
SUPPORTS_THREADS and
|
260
|
+
SUPPORTS_STACK_TRACES and
|
261
|
+
not IS_WINDOWS)
|
262
|
+
|
263
|
+
class GTestOutputTest(gtest_test_utils.TestCase):
|
264
|
+
def RemoveUnsupportedTests(self, test_output):
|
265
|
+
if not SUPPORTS_DEATH_TESTS:
|
266
|
+
test_output = RemoveMatchingTests(test_output, 'DeathTest')
|
267
|
+
if not SUPPORTS_TYPED_TESTS:
|
268
|
+
test_output = RemoveMatchingTests(test_output, 'TypedTest')
|
269
|
+
test_output = RemoveMatchingTests(test_output, 'TypedDeathTest')
|
270
|
+
test_output = RemoveMatchingTests(test_output, 'TypeParamDeathTest')
|
271
|
+
if not SUPPORTS_THREADS:
|
272
|
+
test_output = RemoveMatchingTests(test_output,
|
273
|
+
'ExpectFailureWithThreadsTest')
|
274
|
+
test_output = RemoveMatchingTests(test_output,
|
275
|
+
'ScopedFakeTestPartResultReporterTest')
|
276
|
+
test_output = RemoveMatchingTests(test_output,
|
277
|
+
'WorksConcurrently')
|
278
|
+
if not SUPPORTS_STACK_TRACES:
|
279
|
+
test_output = RemoveStackTraces(test_output)
|
280
|
+
|
281
|
+
return test_output
|
282
|
+
|
283
|
+
def testOutput(self):
|
284
|
+
output = GetOutputOfAllCommands()
|
285
|
+
|
286
|
+
golden_file = open(GOLDEN_PATH, 'rb')
|
287
|
+
# A mis-configured source control system can cause \r appear in EOL
|
288
|
+
# sequences when we read the golden file irrespective of an operating
|
289
|
+
# system used. Therefore, we need to strip those \r's from newlines
|
290
|
+
# unconditionally.
|
291
|
+
golden = ToUnixLineEnding(golden_file.read())
|
292
|
+
golden_file.close()
|
293
|
+
|
294
|
+
# We want the test to pass regardless of certain features being
|
295
|
+
# supported or not.
|
296
|
+
|
297
|
+
# We still have to remove type name specifics in all cases.
|
298
|
+
normalized_actual = RemoveTypeInfoDetails(output)
|
299
|
+
normalized_golden = RemoveTypeInfoDetails(golden)
|
300
|
+
|
301
|
+
if CAN_GENERATE_GOLDEN_FILE:
|
302
|
+
self.assertEqual(normalized_golden, normalized_actual,
|
303
|
+
'\n'.join(difflib.unified_diff(
|
304
|
+
normalized_golden.split('\n'),
|
305
|
+
normalized_actual.split('\n'),
|
306
|
+
'golden', 'actual')))
|
307
|
+
else:
|
308
|
+
normalized_actual = NormalizeToCurrentPlatform(
|
309
|
+
RemoveTestCounts(normalized_actual))
|
310
|
+
normalized_golden = NormalizeToCurrentPlatform(
|
311
|
+
RemoveTestCounts(self.RemoveUnsupportedTests(normalized_golden)))
|
312
|
+
|
313
|
+
# This code is very handy when debugging golden file differences:
|
314
|
+
if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
|
315
|
+
open(os.path.join(
|
316
|
+
gtest_test_utils.GetSourceDir(),
|
317
|
+
'_gtest_output_test_normalized_actual.txt'), 'wb').write(
|
318
|
+
normalized_actual)
|
319
|
+
open(os.path.join(
|
320
|
+
gtest_test_utils.GetSourceDir(),
|
321
|
+
'_gtest_output_test_normalized_golden.txt'), 'wb').write(
|
322
|
+
normalized_golden)
|
323
|
+
|
324
|
+
self.assertEqual(normalized_golden, normalized_actual)
|
325
|
+
|
326
|
+
|
327
|
+
if __name__ == '__main__':
|
328
|
+
if sys.argv[1:] == [GENGOLDEN_FLAG]:
|
329
|
+
if CAN_GENERATE_GOLDEN_FILE:
|
330
|
+
output = GetOutputOfAllCommands()
|
331
|
+
golden_file = open(GOLDEN_PATH, 'wb')
|
332
|
+
golden_file.write(output)
|
333
|
+
golden_file.close()
|
334
|
+
else:
|
335
|
+
message = (
|
336
|
+
"""Unable to write a golden file when compiled in an environment
|
337
|
+
that does not support all the required features (death tests,
|
338
|
+
typed tests, stack traces, and multiple threads).
|
339
|
+
Please build this test and generate the golden file using Blaze on Linux.""")
|
340
|
+
|
341
|
+
sys.stderr.write(message)
|
342
|
+
sys.exit(1)
|
343
|
+
else:
|
344
|
+
gtest_test_utils.Main()
|
@@ -0,0 +1,1067 @@
|
|
1
|
+
// Copyright 2005, Google Inc.
|
2
|
+
// All rights reserved.
|
3
|
+
//
|
4
|
+
// Redistribution and use in source and binary forms, with or without
|
5
|
+
// modification, are permitted provided that the following conditions are
|
6
|
+
// met:
|
7
|
+
//
|
8
|
+
// * Redistributions of source code must retain the above copyright
|
9
|
+
// notice, this list of conditions and the following disclaimer.
|
10
|
+
// * Redistributions in binary form must reproduce the above
|
11
|
+
// copyright notice, this list of conditions and the following disclaimer
|
12
|
+
// in the documentation and/or other materials provided with the
|
13
|
+
// distribution.
|
14
|
+
// * Neither the name of Google Inc. nor the names of its
|
15
|
+
// contributors may be used to endorse or promote products derived from
|
16
|
+
// this software without specific prior written permission.
|
17
|
+
//
|
18
|
+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
+
//
|
30
|
+
// The purpose of this file is to generate Google Test output under
|
31
|
+
// various conditions. The output will then be verified by
|
32
|
+
// gtest_output_test.py to ensure that Google Test generates the
|
33
|
+
// desired messages. Therefore, most tests in this file are MEANT TO
|
34
|
+
// FAIL.
|
35
|
+
//
|
36
|
+
// Author: wan@google.com (Zhanyong Wan)
|
37
|
+
|
38
|
+
#include "gtest/gtest-spi.h"
|
39
|
+
#include "gtest/gtest.h"
|
40
|
+
#include "src/gtest-internal-inl.h"
|
41
|
+
|
42
|
+
#include <stdlib.h>
|
43
|
+
|
44
|
+
#if GTEST_IS_THREADSAFE
|
45
|
+
using testing::ScopedFakeTestPartResultReporter;
|
46
|
+
using testing::TestPartResultArray;
|
47
|
+
|
48
|
+
using testing::internal::Notification;
|
49
|
+
using testing::internal::ThreadWithParam;
|
50
|
+
#endif
|
51
|
+
|
52
|
+
namespace posix = ::testing::internal::posix;
|
53
|
+
|
54
|
+
// Tests catching fatal failures.
|
55
|
+
|
56
|
+
// A subroutine used by the following test.
|
57
|
+
void TestEq1(int x) {
|
58
|
+
ASSERT_EQ(1, x);
|
59
|
+
}
|
60
|
+
|
61
|
+
// This function calls a test subroutine, catches the fatal failure it
|
62
|
+
// generates, and then returns early.
|
63
|
+
void TryTestSubroutine() {
|
64
|
+
// Calls a subrountine that yields a fatal failure.
|
65
|
+
TestEq1(2);
|
66
|
+
|
67
|
+
// Catches the fatal failure and aborts the test.
|
68
|
+
//
|
69
|
+
// The testing::Test:: prefix is necessary when calling
|
70
|
+
// HasFatalFailure() outside of a TEST, TEST_F, or test fixture.
|
71
|
+
if (testing::Test::HasFatalFailure()) return;
|
72
|
+
|
73
|
+
// If we get here, something is wrong.
|
74
|
+
FAIL() << "This should never be reached.";
|
75
|
+
}
|
76
|
+
|
77
|
+
TEST(PassingTest, PassingTest1) {
|
78
|
+
}
|
79
|
+
|
80
|
+
TEST(PassingTest, PassingTest2) {
|
81
|
+
}
|
82
|
+
|
83
|
+
// Tests that parameters of failing parameterized tests are printed in the
|
84
|
+
// failing test summary.
|
85
|
+
class FailingParamTest : public testing::TestWithParam<int> {};
|
86
|
+
|
87
|
+
TEST_P(FailingParamTest, Fails) {
|
88
|
+
EXPECT_EQ(1, GetParam());
|
89
|
+
}
|
90
|
+
|
91
|
+
// This generates a test which will fail. Google Test is expected to print
|
92
|
+
// its parameter when it outputs the list of all failed tests.
|
93
|
+
INSTANTIATE_TEST_CASE_P(PrintingFailingParams,
|
94
|
+
FailingParamTest,
|
95
|
+
testing::Values(2));
|
96
|
+
|
97
|
+
static const char kGoldenString[] = "\"Line\0 1\"\nLine 2";
|
98
|
+
|
99
|
+
TEST(NonfatalFailureTest, EscapesStringOperands) {
|
100
|
+
std::string actual = "actual \"string\"";
|
101
|
+
EXPECT_EQ(kGoldenString, actual);
|
102
|
+
|
103
|
+
const char* golden = kGoldenString;
|
104
|
+
EXPECT_EQ(golden, actual);
|
105
|
+
}
|
106
|
+
|
107
|
+
TEST(NonfatalFailureTest, DiffForLongStrings) {
|
108
|
+
std::string golden_str(kGoldenString, sizeof(kGoldenString) - 1);
|
109
|
+
EXPECT_EQ(golden_str, "Line 2");
|
110
|
+
}
|
111
|
+
|
112
|
+
// Tests catching a fatal failure in a subroutine.
|
113
|
+
TEST(FatalFailureTest, FatalFailureInSubroutine) {
|
114
|
+
printf("(expecting a failure that x should be 1)\n");
|
115
|
+
|
116
|
+
TryTestSubroutine();
|
117
|
+
}
|
118
|
+
|
119
|
+
// Tests catching a fatal failure in a nested subroutine.
|
120
|
+
TEST(FatalFailureTest, FatalFailureInNestedSubroutine) {
|
121
|
+
printf("(expecting a failure that x should be 1)\n");
|
122
|
+
|
123
|
+
// Calls a subrountine that yields a fatal failure.
|
124
|
+
TryTestSubroutine();
|
125
|
+
|
126
|
+
// Catches the fatal failure and aborts the test.
|
127
|
+
//
|
128
|
+
// When calling HasFatalFailure() inside a TEST, TEST_F, or test
|
129
|
+
// fixture, the testing::Test:: prefix is not needed.
|
130
|
+
if (HasFatalFailure()) return;
|
131
|
+
|
132
|
+
// If we get here, something is wrong.
|
133
|
+
FAIL() << "This should never be reached.";
|
134
|
+
}
|
135
|
+
|
136
|
+
// Tests HasFatalFailure() after a failed EXPECT check.
|
137
|
+
TEST(FatalFailureTest, NonfatalFailureInSubroutine) {
|
138
|
+
printf("(expecting a failure on false)\n");
|
139
|
+
EXPECT_TRUE(false); // Generates a nonfatal failure
|
140
|
+
ASSERT_FALSE(HasFatalFailure()); // This should succeed.
|
141
|
+
}
|
142
|
+
|
143
|
+
// Tests interleaving user logging and Google Test assertions.
|
144
|
+
TEST(LoggingTest, InterleavingLoggingAndAssertions) {
|
145
|
+
static const int a[4] = {
|
146
|
+
3, 9, 2, 6
|
147
|
+
};
|
148
|
+
|
149
|
+
printf("(expecting 2 failures on (3) >= (a[i]))\n");
|
150
|
+
for (int i = 0; i < static_cast<int>(sizeof(a)/sizeof(*a)); i++) {
|
151
|
+
printf("i == %d\n", i);
|
152
|
+
EXPECT_GE(3, a[i]);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
// Tests the SCOPED_TRACE macro.
|
157
|
+
|
158
|
+
// A helper function for testing SCOPED_TRACE.
|
159
|
+
void SubWithoutTrace(int n) {
|
160
|
+
EXPECT_EQ(1, n);
|
161
|
+
ASSERT_EQ(2, n);
|
162
|
+
}
|
163
|
+
|
164
|
+
// Another helper function for testing SCOPED_TRACE.
|
165
|
+
void SubWithTrace(int n) {
|
166
|
+
SCOPED_TRACE(testing::Message() << "n = " << n);
|
167
|
+
|
168
|
+
SubWithoutTrace(n);
|
169
|
+
}
|
170
|
+
|
171
|
+
TEST(SCOPED_TRACETest, AcceptedValues) {
|
172
|
+
SCOPED_TRACE("literal string");
|
173
|
+
SCOPED_TRACE(std::string("std::string"));
|
174
|
+
SCOPED_TRACE(1337); // streamable type
|
175
|
+
const char* null_value = NULL;
|
176
|
+
SCOPED_TRACE(null_value);
|
177
|
+
|
178
|
+
ADD_FAILURE() << "Just checking that all these values work fine.";
|
179
|
+
}
|
180
|
+
|
181
|
+
// Tests that SCOPED_TRACE() obeys lexical scopes.
|
182
|
+
TEST(SCOPED_TRACETest, ObeysScopes) {
|
183
|
+
printf("(expected to fail)\n");
|
184
|
+
|
185
|
+
// There should be no trace before SCOPED_TRACE() is invoked.
|
186
|
+
ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
|
187
|
+
|
188
|
+
{
|
189
|
+
SCOPED_TRACE("Expected trace");
|
190
|
+
// After SCOPED_TRACE(), a failure in the current scope should contain
|
191
|
+
// the trace.
|
192
|
+
ADD_FAILURE() << "This failure is expected, and should have a trace.";
|
193
|
+
}
|
194
|
+
|
195
|
+
// Once the control leaves the scope of the SCOPED_TRACE(), there
|
196
|
+
// should be no trace again.
|
197
|
+
ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
|
198
|
+
}
|
199
|
+
|
200
|
+
// Tests that SCOPED_TRACE works inside a loop.
|
201
|
+
TEST(SCOPED_TRACETest, WorksInLoop) {
|
202
|
+
printf("(expected to fail)\n");
|
203
|
+
|
204
|
+
for (int i = 1; i <= 2; i++) {
|
205
|
+
SCOPED_TRACE(testing::Message() << "i = " << i);
|
206
|
+
|
207
|
+
SubWithoutTrace(i);
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
// Tests that SCOPED_TRACE works in a subroutine.
|
212
|
+
TEST(SCOPED_TRACETest, WorksInSubroutine) {
|
213
|
+
printf("(expected to fail)\n");
|
214
|
+
|
215
|
+
SubWithTrace(1);
|
216
|
+
SubWithTrace(2);
|
217
|
+
}
|
218
|
+
|
219
|
+
// Tests that SCOPED_TRACE can be nested.
|
220
|
+
TEST(SCOPED_TRACETest, CanBeNested) {
|
221
|
+
printf("(expected to fail)\n");
|
222
|
+
|
223
|
+
SCOPED_TRACE(""); // A trace without a message.
|
224
|
+
|
225
|
+
SubWithTrace(2);
|
226
|
+
}
|
227
|
+
|
228
|
+
// Tests that multiple SCOPED_TRACEs can be used in the same scope.
|
229
|
+
TEST(SCOPED_TRACETest, CanBeRepeated) {
|
230
|
+
printf("(expected to fail)\n");
|
231
|
+
|
232
|
+
SCOPED_TRACE("A");
|
233
|
+
ADD_FAILURE()
|
234
|
+
<< "This failure is expected, and should contain trace point A.";
|
235
|
+
|
236
|
+
SCOPED_TRACE("B");
|
237
|
+
ADD_FAILURE()
|
238
|
+
<< "This failure is expected, and should contain trace point A and B.";
|
239
|
+
|
240
|
+
{
|
241
|
+
SCOPED_TRACE("C");
|
242
|
+
ADD_FAILURE() << "This failure is expected, and should "
|
243
|
+
<< "contain trace point A, B, and C.";
|
244
|
+
}
|
245
|
+
|
246
|
+
SCOPED_TRACE("D");
|
247
|
+
ADD_FAILURE() << "This failure is expected, and should "
|
248
|
+
<< "contain trace point A, B, and D.";
|
249
|
+
}
|
250
|
+
|
251
|
+
#if GTEST_IS_THREADSAFE
|
252
|
+
// Tests that SCOPED_TRACE()s can be used concurrently from multiple
|
253
|
+
// threads. Namely, an assertion should be affected by
|
254
|
+
// SCOPED_TRACE()s in its own thread only.
|
255
|
+
|
256
|
+
// Here's the sequence of actions that happen in the test:
|
257
|
+
//
|
258
|
+
// Thread A (main) | Thread B (spawned)
|
259
|
+
// ===============================|================================
|
260
|
+
// spawns thread B |
|
261
|
+
// -------------------------------+--------------------------------
|
262
|
+
// waits for n1 | SCOPED_TRACE("Trace B");
|
263
|
+
// | generates failure #1
|
264
|
+
// | notifies n1
|
265
|
+
// -------------------------------+--------------------------------
|
266
|
+
// SCOPED_TRACE("Trace A"); | waits for n2
|
267
|
+
// generates failure #2 |
|
268
|
+
// notifies n2 |
|
269
|
+
// -------------------------------|--------------------------------
|
270
|
+
// waits for n3 | generates failure #3
|
271
|
+
// | trace B dies
|
272
|
+
// | generates failure #4
|
273
|
+
// | notifies n3
|
274
|
+
// -------------------------------|--------------------------------
|
275
|
+
// generates failure #5 | finishes
|
276
|
+
// trace A dies |
|
277
|
+
// generates failure #6 |
|
278
|
+
// -------------------------------|--------------------------------
|
279
|
+
// waits for thread B to finish |
|
280
|
+
|
281
|
+
struct CheckPoints {
|
282
|
+
Notification n1;
|
283
|
+
Notification n2;
|
284
|
+
Notification n3;
|
285
|
+
};
|
286
|
+
|
287
|
+
static void ThreadWithScopedTrace(CheckPoints* check_points) {
|
288
|
+
{
|
289
|
+
SCOPED_TRACE("Trace B");
|
290
|
+
ADD_FAILURE()
|
291
|
+
<< "Expected failure #1 (in thread B, only trace B alive).";
|
292
|
+
check_points->n1.Notify();
|
293
|
+
check_points->n2.WaitForNotification();
|
294
|
+
|
295
|
+
ADD_FAILURE()
|
296
|
+
<< "Expected failure #3 (in thread B, trace A & B both alive).";
|
297
|
+
} // Trace B dies here.
|
298
|
+
ADD_FAILURE()
|
299
|
+
<< "Expected failure #4 (in thread B, only trace A alive).";
|
300
|
+
check_points->n3.Notify();
|
301
|
+
}
|
302
|
+
|
303
|
+
TEST(SCOPED_TRACETest, WorksConcurrently) {
|
304
|
+
printf("(expecting 6 failures)\n");
|
305
|
+
|
306
|
+
CheckPoints check_points;
|
307
|
+
ThreadWithParam<CheckPoints*> thread(&ThreadWithScopedTrace,
|
308
|
+
&check_points,
|
309
|
+
NULL);
|
310
|
+
check_points.n1.WaitForNotification();
|
311
|
+
|
312
|
+
{
|
313
|
+
SCOPED_TRACE("Trace A");
|
314
|
+
ADD_FAILURE()
|
315
|
+
<< "Expected failure #2 (in thread A, trace A & B both alive).";
|
316
|
+
check_points.n2.Notify();
|
317
|
+
check_points.n3.WaitForNotification();
|
318
|
+
|
319
|
+
ADD_FAILURE()
|
320
|
+
<< "Expected failure #5 (in thread A, only trace A alive).";
|
321
|
+
} // Trace A dies here.
|
322
|
+
ADD_FAILURE()
|
323
|
+
<< "Expected failure #6 (in thread A, no trace alive).";
|
324
|
+
thread.Join();
|
325
|
+
}
|
326
|
+
#endif // GTEST_IS_THREADSAFE
|
327
|
+
|
328
|
+
// Tests basic functionality of the ScopedTrace utility (most of its features
|
329
|
+
// are already tested in SCOPED_TRACETest).
|
330
|
+
TEST(ScopedTraceTest, WithExplicitFileAndLine) {
|
331
|
+
testing::ScopedTrace trace("explicit_file.cc", 123, "expected trace message");
|
332
|
+
ADD_FAILURE() << "Check that the trace is attached to a particular location.";
|
333
|
+
}
|
334
|
+
|
335
|
+
TEST(DisabledTestsWarningTest,
|
336
|
+
DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning) {
|
337
|
+
// This test body is intentionally empty. Its sole purpose is for
|
338
|
+
// verifying that the --gtest_also_run_disabled_tests flag
|
339
|
+
// suppresses the "YOU HAVE 12 DISABLED TESTS" warning at the end of
|
340
|
+
// the test output.
|
341
|
+
}
|
342
|
+
|
343
|
+
// Tests using assertions outside of TEST and TEST_F.
|
344
|
+
//
|
345
|
+
// This function creates two failures intentionally.
|
346
|
+
void AdHocTest() {
|
347
|
+
printf("The non-test part of the code is expected to have 2 failures.\n\n");
|
348
|
+
EXPECT_TRUE(false);
|
349
|
+
EXPECT_EQ(2, 3);
|
350
|
+
}
|
351
|
+
|
352
|
+
// Runs all TESTs, all TEST_Fs, and the ad hoc test.
|
353
|
+
int RunAllTests() {
|
354
|
+
AdHocTest();
|
355
|
+
return RUN_ALL_TESTS();
|
356
|
+
}
|
357
|
+
|
358
|
+
// Tests non-fatal failures in the fixture constructor.
|
359
|
+
class NonFatalFailureInFixtureConstructorTest : public testing::Test {
|
360
|
+
protected:
|
361
|
+
NonFatalFailureInFixtureConstructorTest() {
|
362
|
+
printf("(expecting 5 failures)\n");
|
363
|
+
ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
|
364
|
+
}
|
365
|
+
|
366
|
+
~NonFatalFailureInFixtureConstructorTest() {
|
367
|
+
ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
|
368
|
+
}
|
369
|
+
|
370
|
+
virtual void SetUp() {
|
371
|
+
ADD_FAILURE() << "Expected failure #2, in SetUp().";
|
372
|
+
}
|
373
|
+
|
374
|
+
virtual void TearDown() {
|
375
|
+
ADD_FAILURE() << "Expected failure #4, in TearDown.";
|
376
|
+
}
|
377
|
+
};
|
378
|
+
|
379
|
+
TEST_F(NonFatalFailureInFixtureConstructorTest, FailureInConstructor) {
|
380
|
+
ADD_FAILURE() << "Expected failure #3, in the test body.";
|
381
|
+
}
|
382
|
+
|
383
|
+
// Tests fatal failures in the fixture constructor.
|
384
|
+
class FatalFailureInFixtureConstructorTest : public testing::Test {
|
385
|
+
protected:
|
386
|
+
FatalFailureInFixtureConstructorTest() {
|
387
|
+
printf("(expecting 2 failures)\n");
|
388
|
+
Init();
|
389
|
+
}
|
390
|
+
|
391
|
+
~FatalFailureInFixtureConstructorTest() {
|
392
|
+
ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
|
393
|
+
}
|
394
|
+
|
395
|
+
virtual void SetUp() {
|
396
|
+
ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
|
397
|
+
<< "We should never get here, as the test fixture c'tor "
|
398
|
+
<< "had a fatal failure.";
|
399
|
+
}
|
400
|
+
|
401
|
+
virtual void TearDown() {
|
402
|
+
ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
|
403
|
+
<< "We should never get here, as the test fixture c'tor "
|
404
|
+
<< "had a fatal failure.";
|
405
|
+
}
|
406
|
+
|
407
|
+
private:
|
408
|
+
void Init() {
|
409
|
+
FAIL() << "Expected failure #1, in the test fixture c'tor.";
|
410
|
+
}
|
411
|
+
};
|
412
|
+
|
413
|
+
TEST_F(FatalFailureInFixtureConstructorTest, FailureInConstructor) {
|
414
|
+
ADD_FAILURE() << "UNEXPECTED failure in the test body. "
|
415
|
+
<< "We should never get here, as the test fixture c'tor "
|
416
|
+
<< "had a fatal failure.";
|
417
|
+
}
|
418
|
+
|
419
|
+
// Tests non-fatal failures in SetUp().
|
420
|
+
class NonFatalFailureInSetUpTest : public testing::Test {
|
421
|
+
protected:
|
422
|
+
virtual ~NonFatalFailureInSetUpTest() {
|
423
|
+
Deinit();
|
424
|
+
}
|
425
|
+
|
426
|
+
virtual void SetUp() {
|
427
|
+
printf("(expecting 4 failures)\n");
|
428
|
+
ADD_FAILURE() << "Expected failure #1, in SetUp().";
|
429
|
+
}
|
430
|
+
|
431
|
+
virtual void TearDown() {
|
432
|
+
FAIL() << "Expected failure #3, in TearDown().";
|
433
|
+
}
|
434
|
+
private:
|
435
|
+
void Deinit() {
|
436
|
+
FAIL() << "Expected failure #4, in the test fixture d'tor.";
|
437
|
+
}
|
438
|
+
};
|
439
|
+
|
440
|
+
TEST_F(NonFatalFailureInSetUpTest, FailureInSetUp) {
|
441
|
+
FAIL() << "Expected failure #2, in the test function.";
|
442
|
+
}
|
443
|
+
|
444
|
+
// Tests fatal failures in SetUp().
|
445
|
+
class FatalFailureInSetUpTest : public testing::Test {
|
446
|
+
protected:
|
447
|
+
virtual ~FatalFailureInSetUpTest() {
|
448
|
+
Deinit();
|
449
|
+
}
|
450
|
+
|
451
|
+
virtual void SetUp() {
|
452
|
+
printf("(expecting 3 failures)\n");
|
453
|
+
FAIL() << "Expected failure #1, in SetUp().";
|
454
|
+
}
|
455
|
+
|
456
|
+
virtual void TearDown() {
|
457
|
+
FAIL() << "Expected failure #2, in TearDown().";
|
458
|
+
}
|
459
|
+
private:
|
460
|
+
void Deinit() {
|
461
|
+
FAIL() << "Expected failure #3, in the test fixture d'tor.";
|
462
|
+
}
|
463
|
+
};
|
464
|
+
|
465
|
+
TEST_F(FatalFailureInSetUpTest, FailureInSetUp) {
|
466
|
+
FAIL() << "UNEXPECTED failure in the test function. "
|
467
|
+
<< "We should never get here, as SetUp() failed.";
|
468
|
+
}
|
469
|
+
|
470
|
+
TEST(AddFailureAtTest, MessageContainsSpecifiedFileAndLineNumber) {
|
471
|
+
ADD_FAILURE_AT("foo.cc", 42) << "Expected failure in foo.cc";
|
472
|
+
}
|
473
|
+
|
474
|
+
#if GTEST_IS_THREADSAFE
|
475
|
+
|
476
|
+
// A unary function that may die.
|
477
|
+
void DieIf(bool should_die) {
|
478
|
+
GTEST_CHECK_(!should_die) << " - death inside DieIf().";
|
479
|
+
}
|
480
|
+
|
481
|
+
// Tests running death tests in a multi-threaded context.
|
482
|
+
|
483
|
+
// Used for coordination between the main and the spawn thread.
|
484
|
+
struct SpawnThreadNotifications {
|
485
|
+
SpawnThreadNotifications() {}
|
486
|
+
|
487
|
+
Notification spawn_thread_started;
|
488
|
+
Notification spawn_thread_ok_to_terminate;
|
489
|
+
|
490
|
+
private:
|
491
|
+
GTEST_DISALLOW_COPY_AND_ASSIGN_(SpawnThreadNotifications);
|
492
|
+
};
|
493
|
+
|
494
|
+
// The function to be executed in the thread spawn by the
|
495
|
+
// MultipleThreads test (below).
|
496
|
+
static void ThreadRoutine(SpawnThreadNotifications* notifications) {
|
497
|
+
// Signals the main thread that this thread has started.
|
498
|
+
notifications->spawn_thread_started.Notify();
|
499
|
+
|
500
|
+
// Waits for permission to finish from the main thread.
|
501
|
+
notifications->spawn_thread_ok_to_terminate.WaitForNotification();
|
502
|
+
}
|
503
|
+
|
504
|
+
// This is a death-test test, but it's not named with a DeathTest
|
505
|
+
// suffix. It starts threads which might interfere with later
|
506
|
+
// death tests, so it must run after all other death tests.
|
507
|
+
class DeathTestAndMultiThreadsTest : public testing::Test {
|
508
|
+
protected:
|
509
|
+
// Starts a thread and waits for it to begin.
|
510
|
+
virtual void SetUp() {
|
511
|
+
thread_.reset(new ThreadWithParam<SpawnThreadNotifications*>(
|
512
|
+
&ThreadRoutine, ¬ifications_, NULL));
|
513
|
+
notifications_.spawn_thread_started.WaitForNotification();
|
514
|
+
}
|
515
|
+
// Tells the thread to finish, and reaps it.
|
516
|
+
// Depending on the version of the thread library in use,
|
517
|
+
// a manager thread might still be left running that will interfere
|
518
|
+
// with later death tests. This is unfortunate, but this class
|
519
|
+
// cleans up after itself as best it can.
|
520
|
+
virtual void TearDown() {
|
521
|
+
notifications_.spawn_thread_ok_to_terminate.Notify();
|
522
|
+
}
|
523
|
+
|
524
|
+
private:
|
525
|
+
SpawnThreadNotifications notifications_;
|
526
|
+
testing::internal::scoped_ptr<ThreadWithParam<SpawnThreadNotifications*> >
|
527
|
+
thread_;
|
528
|
+
};
|
529
|
+
|
530
|
+
#endif // GTEST_IS_THREADSAFE
|
531
|
+
|
532
|
+
// The MixedUpTestCaseTest test case verifies that Google Test will fail a
|
533
|
+
// test if it uses a different fixture class than what other tests in
|
534
|
+
// the same test case use. It deliberately contains two fixture
|
535
|
+
// classes with the same name but defined in different namespaces.
|
536
|
+
|
537
|
+
// The MixedUpTestCaseWithSameTestNameTest test case verifies that
|
538
|
+
// when the user defines two tests with the same test case name AND
|
539
|
+
// same test name (but in different namespaces), the second test will
|
540
|
+
// fail.
|
541
|
+
|
542
|
+
namespace foo {
|
543
|
+
|
544
|
+
class MixedUpTestCaseTest : public testing::Test {
|
545
|
+
};
|
546
|
+
|
547
|
+
TEST_F(MixedUpTestCaseTest, FirstTestFromNamespaceFoo) {}
|
548
|
+
TEST_F(MixedUpTestCaseTest, SecondTestFromNamespaceFoo) {}
|
549
|
+
|
550
|
+
class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
|
551
|
+
};
|
552
|
+
|
553
|
+
TEST_F(MixedUpTestCaseWithSameTestNameTest,
|
554
|
+
TheSecondTestWithThisNameShouldFail) {}
|
555
|
+
|
556
|
+
} // namespace foo
|
557
|
+
|
558
|
+
namespace bar {
|
559
|
+
|
560
|
+
class MixedUpTestCaseTest : public testing::Test {
|
561
|
+
};
|
562
|
+
|
563
|
+
// The following two tests are expected to fail. We rely on the
|
564
|
+
// golden file to check that Google Test generates the right error message.
|
565
|
+
TEST_F(MixedUpTestCaseTest, ThisShouldFail) {}
|
566
|
+
TEST_F(MixedUpTestCaseTest, ThisShouldFailToo) {}
|
567
|
+
|
568
|
+
class MixedUpTestCaseWithSameTestNameTest : public testing::Test {
|
569
|
+
};
|
570
|
+
|
571
|
+
// Expected to fail. We rely on the golden file to check that Google Test
|
572
|
+
// generates the right error message.
|
573
|
+
TEST_F(MixedUpTestCaseWithSameTestNameTest,
|
574
|
+
TheSecondTestWithThisNameShouldFail) {}
|
575
|
+
|
576
|
+
} // namespace bar
|
577
|
+
|
578
|
+
// The following two test cases verify that Google Test catches the user
|
579
|
+
// error of mixing TEST and TEST_F in the same test case. The first
|
580
|
+
// test case checks the scenario where TEST_F appears before TEST, and
|
581
|
+
// the second one checks where TEST appears before TEST_F.
|
582
|
+
|
583
|
+
class TEST_F_before_TEST_in_same_test_case : public testing::Test {
|
584
|
+
};
|
585
|
+
|
586
|
+
TEST_F(TEST_F_before_TEST_in_same_test_case, DefinedUsingTEST_F) {}
|
587
|
+
|
588
|
+
// Expected to fail. We rely on the golden file to check that Google Test
|
589
|
+
// generates the right error message.
|
590
|
+
TEST(TEST_F_before_TEST_in_same_test_case, DefinedUsingTESTAndShouldFail) {}
|
591
|
+
|
592
|
+
class TEST_before_TEST_F_in_same_test_case : public testing::Test {
|
593
|
+
};
|
594
|
+
|
595
|
+
TEST(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST) {}
|
596
|
+
|
597
|
+
// Expected to fail. We rely on the golden file to check that Google Test
|
598
|
+
// generates the right error message.
|
599
|
+
TEST_F(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST_FAndShouldFail) {
|
600
|
+
}
|
601
|
+
|
602
|
+
// Used for testing EXPECT_NONFATAL_FAILURE() and EXPECT_FATAL_FAILURE().
|
603
|
+
int global_integer = 0;
|
604
|
+
|
605
|
+
// Tests that EXPECT_NONFATAL_FAILURE() can reference global variables.
|
606
|
+
TEST(ExpectNonfatalFailureTest, CanReferenceGlobalVariables) {
|
607
|
+
global_integer = 0;
|
608
|
+
EXPECT_NONFATAL_FAILURE({
|
609
|
+
EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
|
610
|
+
}, "Expected non-fatal failure.");
|
611
|
+
}
|
612
|
+
|
613
|
+
// Tests that EXPECT_NONFATAL_FAILURE() can reference local variables
|
614
|
+
// (static or not).
|
615
|
+
TEST(ExpectNonfatalFailureTest, CanReferenceLocalVariables) {
|
616
|
+
int m = 0;
|
617
|
+
static int n;
|
618
|
+
n = 1;
|
619
|
+
EXPECT_NONFATAL_FAILURE({
|
620
|
+
EXPECT_EQ(m, n) << "Expected non-fatal failure.";
|
621
|
+
}, "Expected non-fatal failure.");
|
622
|
+
}
|
623
|
+
|
624
|
+
// Tests that EXPECT_NONFATAL_FAILURE() succeeds when there is exactly
|
625
|
+
// one non-fatal failure and no fatal failure.
|
626
|
+
TEST(ExpectNonfatalFailureTest, SucceedsWhenThereIsOneNonfatalFailure) {
|
627
|
+
EXPECT_NONFATAL_FAILURE({
|
628
|
+
ADD_FAILURE() << "Expected non-fatal failure.";
|
629
|
+
}, "Expected non-fatal failure.");
|
630
|
+
}
|
631
|
+
|
632
|
+
// Tests that EXPECT_NONFATAL_FAILURE() fails when there is no
|
633
|
+
// non-fatal failure.
|
634
|
+
TEST(ExpectNonfatalFailureTest, FailsWhenThereIsNoNonfatalFailure) {
|
635
|
+
printf("(expecting a failure)\n");
|
636
|
+
EXPECT_NONFATAL_FAILURE({
|
637
|
+
}, "");
|
638
|
+
}
|
639
|
+
|
640
|
+
// Tests that EXPECT_NONFATAL_FAILURE() fails when there are two
|
641
|
+
// non-fatal failures.
|
642
|
+
TEST(ExpectNonfatalFailureTest, FailsWhenThereAreTwoNonfatalFailures) {
|
643
|
+
printf("(expecting a failure)\n");
|
644
|
+
EXPECT_NONFATAL_FAILURE({
|
645
|
+
ADD_FAILURE() << "Expected non-fatal failure 1.";
|
646
|
+
ADD_FAILURE() << "Expected non-fatal failure 2.";
|
647
|
+
}, "");
|
648
|
+
}
|
649
|
+
|
650
|
+
// Tests that EXPECT_NONFATAL_FAILURE() fails when there is one fatal
|
651
|
+
// failure.
|
652
|
+
TEST(ExpectNonfatalFailureTest, FailsWhenThereIsOneFatalFailure) {
|
653
|
+
printf("(expecting a failure)\n");
|
654
|
+
EXPECT_NONFATAL_FAILURE({
|
655
|
+
FAIL() << "Expected fatal failure.";
|
656
|
+
}, "");
|
657
|
+
}
|
658
|
+
|
659
|
+
// Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
|
660
|
+
// tested returns.
|
661
|
+
TEST(ExpectNonfatalFailureTest, FailsWhenStatementReturns) {
|
662
|
+
printf("(expecting a failure)\n");
|
663
|
+
EXPECT_NONFATAL_FAILURE({
|
664
|
+
return;
|
665
|
+
}, "");
|
666
|
+
}
|
667
|
+
|
668
|
+
#if GTEST_HAS_EXCEPTIONS
|
669
|
+
|
670
|
+
// Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
|
671
|
+
// tested throws.
|
672
|
+
TEST(ExpectNonfatalFailureTest, FailsWhenStatementThrows) {
|
673
|
+
printf("(expecting a failure)\n");
|
674
|
+
try {
|
675
|
+
EXPECT_NONFATAL_FAILURE({
|
676
|
+
throw 0;
|
677
|
+
}, "");
|
678
|
+
} catch(int) { // NOLINT
|
679
|
+
}
|
680
|
+
}
|
681
|
+
|
682
|
+
#endif // GTEST_HAS_EXCEPTIONS
|
683
|
+
|
684
|
+
// Tests that EXPECT_FATAL_FAILURE() can reference global variables.
|
685
|
+
TEST(ExpectFatalFailureTest, CanReferenceGlobalVariables) {
|
686
|
+
global_integer = 0;
|
687
|
+
EXPECT_FATAL_FAILURE({
|
688
|
+
ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
|
689
|
+
}, "Expected fatal failure.");
|
690
|
+
}
|
691
|
+
|
692
|
+
// Tests that EXPECT_FATAL_FAILURE() can reference local static
|
693
|
+
// variables.
|
694
|
+
TEST(ExpectFatalFailureTest, CanReferenceLocalStaticVariables) {
|
695
|
+
static int n;
|
696
|
+
n = 1;
|
697
|
+
EXPECT_FATAL_FAILURE({
|
698
|
+
ASSERT_EQ(0, n) << "Expected fatal failure.";
|
699
|
+
}, "Expected fatal failure.");
|
700
|
+
}
|
701
|
+
|
702
|
+
// Tests that EXPECT_FATAL_FAILURE() succeeds when there is exactly
|
703
|
+
// one fatal failure and no non-fatal failure.
|
704
|
+
TEST(ExpectFatalFailureTest, SucceedsWhenThereIsOneFatalFailure) {
|
705
|
+
EXPECT_FATAL_FAILURE({
|
706
|
+
FAIL() << "Expected fatal failure.";
|
707
|
+
}, "Expected fatal failure.");
|
708
|
+
}
|
709
|
+
|
710
|
+
// Tests that EXPECT_FATAL_FAILURE() fails when there is no fatal
|
711
|
+
// failure.
|
712
|
+
TEST(ExpectFatalFailureTest, FailsWhenThereIsNoFatalFailure) {
|
713
|
+
printf("(expecting a failure)\n");
|
714
|
+
EXPECT_FATAL_FAILURE({
|
715
|
+
}, "");
|
716
|
+
}
|
717
|
+
|
718
|
+
// A helper for generating a fatal failure.
|
719
|
+
void FatalFailure() {
|
720
|
+
FAIL() << "Expected fatal failure.";
|
721
|
+
}
|
722
|
+
|
723
|
+
// Tests that EXPECT_FATAL_FAILURE() fails when there are two
|
724
|
+
// fatal failures.
|
725
|
+
TEST(ExpectFatalFailureTest, FailsWhenThereAreTwoFatalFailures) {
|
726
|
+
printf("(expecting a failure)\n");
|
727
|
+
EXPECT_FATAL_FAILURE({
|
728
|
+
FatalFailure();
|
729
|
+
FatalFailure();
|
730
|
+
}, "");
|
731
|
+
}
|
732
|
+
|
733
|
+
// Tests that EXPECT_FATAL_FAILURE() fails when there is one non-fatal
|
734
|
+
// failure.
|
735
|
+
TEST(ExpectFatalFailureTest, FailsWhenThereIsOneNonfatalFailure) {
|
736
|
+
printf("(expecting a failure)\n");
|
737
|
+
EXPECT_FATAL_FAILURE({
|
738
|
+
ADD_FAILURE() << "Expected non-fatal failure.";
|
739
|
+
}, "");
|
740
|
+
}
|
741
|
+
|
742
|
+
// Tests that EXPECT_FATAL_FAILURE() fails when the statement being
|
743
|
+
// tested returns.
|
744
|
+
TEST(ExpectFatalFailureTest, FailsWhenStatementReturns) {
|
745
|
+
printf("(expecting a failure)\n");
|
746
|
+
EXPECT_FATAL_FAILURE({
|
747
|
+
return;
|
748
|
+
}, "");
|
749
|
+
}
|
750
|
+
|
751
|
+
#if GTEST_HAS_EXCEPTIONS
|
752
|
+
|
753
|
+
// Tests that EXPECT_FATAL_FAILURE() fails when the statement being
|
754
|
+
// tested throws.
|
755
|
+
TEST(ExpectFatalFailureTest, FailsWhenStatementThrows) {
|
756
|
+
printf("(expecting a failure)\n");
|
757
|
+
try {
|
758
|
+
EXPECT_FATAL_FAILURE({
|
759
|
+
throw 0;
|
760
|
+
}, "");
|
761
|
+
} catch(int) { // NOLINT
|
762
|
+
}
|
763
|
+
}
|
764
|
+
|
765
|
+
#endif // GTEST_HAS_EXCEPTIONS
|
766
|
+
|
767
|
+
// This #ifdef block tests the output of value-parameterized tests.
|
768
|
+
|
769
|
+
std::string ParamNameFunc(const testing::TestParamInfo<std::string>& info) {
|
770
|
+
return info.param;
|
771
|
+
}
|
772
|
+
|
773
|
+
class ParamTest : public testing::TestWithParam<std::string> {
|
774
|
+
};
|
775
|
+
|
776
|
+
TEST_P(ParamTest, Success) {
|
777
|
+
EXPECT_EQ("a", GetParam());
|
778
|
+
}
|
779
|
+
|
780
|
+
TEST_P(ParamTest, Failure) {
|
781
|
+
EXPECT_EQ("b", GetParam()) << "Expected failure";
|
782
|
+
}
|
783
|
+
|
784
|
+
INSTANTIATE_TEST_CASE_P(PrintingStrings,
|
785
|
+
ParamTest,
|
786
|
+
testing::Values(std::string("a")),
|
787
|
+
ParamNameFunc);
|
788
|
+
|
789
|
+
// This #ifdef block tests the output of typed tests.
|
790
|
+
#if GTEST_HAS_TYPED_TEST
|
791
|
+
|
792
|
+
template <typename T>
|
793
|
+
class TypedTest : public testing::Test {
|
794
|
+
};
|
795
|
+
|
796
|
+
TYPED_TEST_CASE(TypedTest, testing::Types<int>);
|
797
|
+
|
798
|
+
TYPED_TEST(TypedTest, Success) {
|
799
|
+
EXPECT_EQ(0, TypeParam());
|
800
|
+
}
|
801
|
+
|
802
|
+
TYPED_TEST(TypedTest, Failure) {
|
803
|
+
EXPECT_EQ(1, TypeParam()) << "Expected failure";
|
804
|
+
}
|
805
|
+
|
806
|
+
#endif // GTEST_HAS_TYPED_TEST
|
807
|
+
|
808
|
+
// This #ifdef block tests the output of type-parameterized tests.
|
809
|
+
#if GTEST_HAS_TYPED_TEST_P
|
810
|
+
|
811
|
+
template <typename T>
|
812
|
+
class TypedTestP : public testing::Test {
|
813
|
+
};
|
814
|
+
|
815
|
+
TYPED_TEST_CASE_P(TypedTestP);
|
816
|
+
|
817
|
+
TYPED_TEST_P(TypedTestP, Success) {
|
818
|
+
EXPECT_EQ(0U, TypeParam());
|
819
|
+
}
|
820
|
+
|
821
|
+
TYPED_TEST_P(TypedTestP, Failure) {
|
822
|
+
EXPECT_EQ(1U, TypeParam()) << "Expected failure";
|
823
|
+
}
|
824
|
+
|
825
|
+
REGISTER_TYPED_TEST_CASE_P(TypedTestP, Success, Failure);
|
826
|
+
|
827
|
+
typedef testing::Types<unsigned char, unsigned int> UnsignedTypes;
|
828
|
+
INSTANTIATE_TYPED_TEST_CASE_P(Unsigned, TypedTestP, UnsignedTypes);
|
829
|
+
|
830
|
+
#endif // GTEST_HAS_TYPED_TEST_P
|
831
|
+
|
832
|
+
#if GTEST_HAS_DEATH_TEST
|
833
|
+
|
834
|
+
// We rely on the golden file to verify that tests whose test case
|
835
|
+
// name ends with DeathTest are run first.
|
836
|
+
|
837
|
+
TEST(ADeathTest, ShouldRunFirst) {
|
838
|
+
}
|
839
|
+
|
840
|
+
# if GTEST_HAS_TYPED_TEST
|
841
|
+
|
842
|
+
// We rely on the golden file to verify that typed tests whose test
|
843
|
+
// case name ends with DeathTest are run first.
|
844
|
+
|
845
|
+
template <typename T>
|
846
|
+
class ATypedDeathTest : public testing::Test {
|
847
|
+
};
|
848
|
+
|
849
|
+
typedef testing::Types<int, double> NumericTypes;
|
850
|
+
TYPED_TEST_CASE(ATypedDeathTest, NumericTypes);
|
851
|
+
|
852
|
+
TYPED_TEST(ATypedDeathTest, ShouldRunFirst) {
|
853
|
+
}
|
854
|
+
|
855
|
+
# endif // GTEST_HAS_TYPED_TEST
|
856
|
+
|
857
|
+
# if GTEST_HAS_TYPED_TEST_P
|
858
|
+
|
859
|
+
|
860
|
+
// We rely on the golden file to verify that type-parameterized tests
|
861
|
+
// whose test case name ends with DeathTest are run first.
|
862
|
+
|
863
|
+
template <typename T>
|
864
|
+
class ATypeParamDeathTest : public testing::Test {
|
865
|
+
};
|
866
|
+
|
867
|
+
TYPED_TEST_CASE_P(ATypeParamDeathTest);
|
868
|
+
|
869
|
+
TYPED_TEST_P(ATypeParamDeathTest, ShouldRunFirst) {
|
870
|
+
}
|
871
|
+
|
872
|
+
REGISTER_TYPED_TEST_CASE_P(ATypeParamDeathTest, ShouldRunFirst);
|
873
|
+
|
874
|
+
INSTANTIATE_TYPED_TEST_CASE_P(My, ATypeParamDeathTest, NumericTypes);
|
875
|
+
|
876
|
+
# endif // GTEST_HAS_TYPED_TEST_P
|
877
|
+
|
878
|
+
#endif // GTEST_HAS_DEATH_TEST
|
879
|
+
|
880
|
+
// Tests various failure conditions of
|
881
|
+
// EXPECT_{,NON}FATAL_FAILURE{,_ON_ALL_THREADS}.
|
882
|
+
class ExpectFailureTest : public testing::Test {
|
883
|
+
public: // Must be public and not protected due to a bug in g++ 3.4.2.
|
884
|
+
enum FailureMode {
|
885
|
+
FATAL_FAILURE,
|
886
|
+
NONFATAL_FAILURE
|
887
|
+
};
|
888
|
+
static void AddFailure(FailureMode failure) {
|
889
|
+
if (failure == FATAL_FAILURE) {
|
890
|
+
FAIL() << "Expected fatal failure.";
|
891
|
+
} else {
|
892
|
+
ADD_FAILURE() << "Expected non-fatal failure.";
|
893
|
+
}
|
894
|
+
}
|
895
|
+
};
|
896
|
+
|
897
|
+
TEST_F(ExpectFailureTest, ExpectFatalFailure) {
|
898
|
+
// Expected fatal failure, but succeeds.
|
899
|
+
printf("(expecting 1 failure)\n");
|
900
|
+
EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
|
901
|
+
// Expected fatal failure, but got a non-fatal failure.
|
902
|
+
printf("(expecting 1 failure)\n");
|
903
|
+
EXPECT_FATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Expected non-fatal "
|
904
|
+
"failure.");
|
905
|
+
// Wrong message.
|
906
|
+
printf("(expecting 1 failure)\n");
|
907
|
+
EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
|
908
|
+
"expected.");
|
909
|
+
}
|
910
|
+
|
911
|
+
TEST_F(ExpectFailureTest, ExpectNonFatalFailure) {
|
912
|
+
// Expected non-fatal failure, but succeeds.
|
913
|
+
printf("(expecting 1 failure)\n");
|
914
|
+
EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
|
915
|
+
// Expected non-fatal failure, but got a fatal failure.
|
916
|
+
printf("(expecting 1 failure)\n");
|
917
|
+
EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
|
918
|
+
// Wrong message.
|
919
|
+
printf("(expecting 1 failure)\n");
|
920
|
+
EXPECT_NONFATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Some other non-fatal "
|
921
|
+
"failure.");
|
922
|
+
}
|
923
|
+
|
924
|
+
#if GTEST_IS_THREADSAFE
|
925
|
+
|
926
|
+
class ExpectFailureWithThreadsTest : public ExpectFailureTest {
|
927
|
+
protected:
|
928
|
+
static void AddFailureInOtherThread(FailureMode failure) {
|
929
|
+
ThreadWithParam<FailureMode> thread(&AddFailure, failure, NULL);
|
930
|
+
thread.Join();
|
931
|
+
}
|
932
|
+
};
|
933
|
+
|
934
|
+
TEST_F(ExpectFailureWithThreadsTest, ExpectFatalFailure) {
|
935
|
+
// We only intercept the current thread.
|
936
|
+
printf("(expecting 2 failures)\n");
|
937
|
+
EXPECT_FATAL_FAILURE(AddFailureInOtherThread(FATAL_FAILURE),
|
938
|
+
"Expected fatal failure.");
|
939
|
+
}
|
940
|
+
|
941
|
+
TEST_F(ExpectFailureWithThreadsTest, ExpectNonFatalFailure) {
|
942
|
+
// We only intercept the current thread.
|
943
|
+
printf("(expecting 2 failures)\n");
|
944
|
+
EXPECT_NONFATAL_FAILURE(AddFailureInOtherThread(NONFATAL_FAILURE),
|
945
|
+
"Expected non-fatal failure.");
|
946
|
+
}
|
947
|
+
|
948
|
+
typedef ExpectFailureWithThreadsTest ScopedFakeTestPartResultReporterTest;
|
949
|
+
|
950
|
+
// Tests that the ScopedFakeTestPartResultReporter only catches failures from
|
951
|
+
// the current thread if it is instantiated with INTERCEPT_ONLY_CURRENT_THREAD.
|
952
|
+
TEST_F(ScopedFakeTestPartResultReporterTest, InterceptOnlyCurrentThread) {
|
953
|
+
printf("(expecting 2 failures)\n");
|
954
|
+
TestPartResultArray results;
|
955
|
+
{
|
956
|
+
ScopedFakeTestPartResultReporter reporter(
|
957
|
+
ScopedFakeTestPartResultReporter::INTERCEPT_ONLY_CURRENT_THREAD,
|
958
|
+
&results);
|
959
|
+
AddFailureInOtherThread(FATAL_FAILURE);
|
960
|
+
AddFailureInOtherThread(NONFATAL_FAILURE);
|
961
|
+
}
|
962
|
+
// The two failures should not have been intercepted.
|
963
|
+
EXPECT_EQ(0, results.size()) << "This shouldn't fail.";
|
964
|
+
}
|
965
|
+
|
966
|
+
#endif // GTEST_IS_THREADSAFE
|
967
|
+
|
968
|
+
TEST_F(ExpectFailureTest, ExpectFatalFailureOnAllThreads) {
|
969
|
+
// Expected fatal failure, but succeeds.
|
970
|
+
printf("(expecting 1 failure)\n");
|
971
|
+
EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
|
972
|
+
// Expected fatal failure, but got a non-fatal failure.
|
973
|
+
printf("(expecting 1 failure)\n");
|
974
|
+
EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
|
975
|
+
"Expected non-fatal failure.");
|
976
|
+
// Wrong message.
|
977
|
+
printf("(expecting 1 failure)\n");
|
978
|
+
EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
|
979
|
+
"Some other fatal failure expected.");
|
980
|
+
}
|
981
|
+
|
982
|
+
TEST_F(ExpectFailureTest, ExpectNonFatalFailureOnAllThreads) {
|
983
|
+
// Expected non-fatal failure, but succeeds.
|
984
|
+
printf("(expecting 1 failure)\n");
|
985
|
+
EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected non-fatal "
|
986
|
+
"failure.");
|
987
|
+
// Expected non-fatal failure, but got a fatal failure.
|
988
|
+
printf("(expecting 1 failure)\n");
|
989
|
+
EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
|
990
|
+
"Expected fatal failure.");
|
991
|
+
// Wrong message.
|
992
|
+
printf("(expecting 1 failure)\n");
|
993
|
+
EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
|
994
|
+
"Some other non-fatal failure.");
|
995
|
+
}
|
996
|
+
|
997
|
+
|
998
|
+
// Two test environments for testing testing::AddGlobalTestEnvironment().
|
999
|
+
|
1000
|
+
class FooEnvironment : public testing::Environment {
|
1001
|
+
public:
|
1002
|
+
virtual void SetUp() {
|
1003
|
+
printf("%s", "FooEnvironment::SetUp() called.\n");
|
1004
|
+
}
|
1005
|
+
|
1006
|
+
virtual void TearDown() {
|
1007
|
+
printf("%s", "FooEnvironment::TearDown() called.\n");
|
1008
|
+
FAIL() << "Expected fatal failure.";
|
1009
|
+
}
|
1010
|
+
};
|
1011
|
+
|
1012
|
+
class BarEnvironment : public testing::Environment {
|
1013
|
+
public:
|
1014
|
+
virtual void SetUp() {
|
1015
|
+
printf("%s", "BarEnvironment::SetUp() called.\n");
|
1016
|
+
}
|
1017
|
+
|
1018
|
+
virtual void TearDown() {
|
1019
|
+
printf("%s", "BarEnvironment::TearDown() called.\n");
|
1020
|
+
ADD_FAILURE() << "Expected non-fatal failure.";
|
1021
|
+
}
|
1022
|
+
};
|
1023
|
+
|
1024
|
+
// The main function.
|
1025
|
+
//
|
1026
|
+
// The idea is to use Google Test to run all the tests we have defined (some
|
1027
|
+
// of them are intended to fail), and then compare the test results
|
1028
|
+
// with the "golden" file.
|
1029
|
+
int main(int argc, char **argv) {
|
1030
|
+
testing::GTEST_FLAG(print_time) = false;
|
1031
|
+
|
1032
|
+
// We just run the tests, knowing some of them are intended to fail.
|
1033
|
+
// We will use a separate Python script to compare the output of
|
1034
|
+
// this program with the golden file.
|
1035
|
+
|
1036
|
+
// It's hard to test InitGoogleTest() directly, as it has many
|
1037
|
+
// global side effects. The following line serves as a sanity test
|
1038
|
+
// for it.
|
1039
|
+
testing::InitGoogleTest(&argc, argv);
|
1040
|
+
bool internal_skip_environment_and_ad_hoc_tests =
|
1041
|
+
std::count(argv, argv + argc,
|
1042
|
+
std::string("internal_skip_environment_and_ad_hoc_tests")) > 0;
|
1043
|
+
|
1044
|
+
#if GTEST_HAS_DEATH_TEST
|
1045
|
+
if (testing::internal::GTEST_FLAG(internal_run_death_test) != "") {
|
1046
|
+
// Skip the usual output capturing if we're running as the child
|
1047
|
+
// process of an threadsafe-style death test.
|
1048
|
+
# if GTEST_OS_WINDOWS
|
1049
|
+
posix::FReopen("nul:", "w", stdout);
|
1050
|
+
# else
|
1051
|
+
posix::FReopen("/dev/null", "w", stdout);
|
1052
|
+
# endif // GTEST_OS_WINDOWS
|
1053
|
+
return RUN_ALL_TESTS();
|
1054
|
+
}
|
1055
|
+
#endif // GTEST_HAS_DEATH_TEST
|
1056
|
+
|
1057
|
+
if (internal_skip_environment_and_ad_hoc_tests)
|
1058
|
+
return RUN_ALL_TESTS();
|
1059
|
+
|
1060
|
+
// Registers two global test environments.
|
1061
|
+
// The golden file verifies that they are set up in the order they
|
1062
|
+
// are registered, and torn down in the reverse order.
|
1063
|
+
testing::AddGlobalTestEnvironment(new FooEnvironment);
|
1064
|
+
testing::AddGlobalTestEnvironment(new BarEnvironment);
|
1065
|
+
|
1066
|
+
return RunAllTests();
|
1067
|
+
}
|