rj_schema 0.2.2 → 1.0.0
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/CMakeLists.txt +9 -4
- data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +10 -0
- data/ext/rj_schema/rapidjson/appveyor.yml +22 -9
- data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/address.json +139 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/allOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/anyOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/bin/unittestschema/oneOf_address.json +7 -0
- data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +2 -2
- data/ext/rj_schema/rapidjson/doc/dom.md +1 -0
- data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +1 -0
- data/ext/rj_schema/rapidjson/doc/faq.md +3 -3
- data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +8 -8
- data/ext/rj_schema/rapidjson/doc/internals.md +1 -1
- data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +2 -2
- data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +1 -1
- data/ext/rj_schema/rapidjson/doc/sax.md +1 -1
- data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +2 -2
- data/ext/rj_schema/rapidjson/doc/stream.md +1 -1
- data/ext/rj_schema/rapidjson/doc/tutorial.md +1 -1
- data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +7 -6
- data/ext/rj_schema/rapidjson/example/CMakeLists.txt +1 -0
- data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +118 -0
- data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
- data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +6 -6
- data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/document.h +124 -35
- data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +49 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +56 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +3 -17
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +20 -13
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +4 -3
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +50 -35
- data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +63 -5
- data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +2 -2
- data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +63 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +67 -53
- data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +318 -164
- data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +1 -1
- data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +10 -10
- data/ext/rj_schema/rapidjson/readme.md +51 -1
- data/ext/rj_schema/rapidjson/readme.zh-cn.md +2 -2
- data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/perftest/perftest.h +1 -1
- data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +2 -2
- data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +75 -1
- data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +1 -0
- data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/clzlltest.cpp +34 -0
- data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +19 -19
- data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +45 -2
- data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +10 -10
- data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +8 -8
- data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +157 -16
- data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +113 -75
- data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +2 -1
- data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +593 -78
- data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +5 -5
- data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +1 -1
- data/ext/rj_schema/rapidjson/test/unittest/unittest.h +4 -1
- data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +12 -12
- data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +18 -1
- 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 +16 -35
- 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 +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +72 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +53 -42
- 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 +4 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +6 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +117 -132
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +7 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +20 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +83 -26
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +262 -68
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +45 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +650 -366
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +76 -20
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +308 -229
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +18 -15
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +87 -26
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +33 -16
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +1209 -353
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +33 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +159 -88
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +3 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +16 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +71 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +7 -11
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +69 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +69 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +83 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +14 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +63 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +63 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +76 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +4 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +3 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +36 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +210 -135
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +108 -48
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +23 -1
- 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 +166 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +64 -62
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +43 -18
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +11 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +91 -36
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +33 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +1286 -167
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +85 -83
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +102 -15
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +136 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +24 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +8 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +20 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +8 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +3 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +44 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +5 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +40 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +60 -31
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +232 -171
- 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 +54 -16
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +6 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{AdvancedGuide.md → advanced.md} +260 -26
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{FAQ.md → faq.md} +62 -57
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{Primer.md → primer.md} +43 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/{Samples.md → samples.md} +0 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +53 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +30 -36
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +8 -17
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +140 -51
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +2 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +4 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +126 -30
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +6 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +8 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +6 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +4 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +13 -57
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +98 -59
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +34 -41
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +3 -10
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +9 -17
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +8 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +232 -99
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +3 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +17 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +17 -1
- 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 +6 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +0 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +7 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +5 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +3 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +10 -22
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +2 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +0 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +10 -10
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +226 -32
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +5 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +21 -29
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +85 -67
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +93 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +1 -9
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +1 -0
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +622 -164
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +1 -1
- 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_test.cc +12 -15
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +2 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +6 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +1 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +84 -29
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +1 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +11 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +165 -63
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +13 -13
- 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 +1 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +1 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +0 -8
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +6 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +0 -3
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +20 -18
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +1 -1
- 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 +4 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +11 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +17 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +104 -66
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +2 -19
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +0 -6
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +12 -14
- 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_test.py +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +4 -5
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +2 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +240 -149
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +0 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +0 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +15 -7
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +100 -30
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +0 -2
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +25 -23
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +1 -1
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +4 -4
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +47 -0
- data/ext/rj_schema/rapidjson/travis-doxygen.sh +13 -6
- data/ext/rj_schema/rj_schema.cpp +161 -17
- data/lib/rj_schema.rb +1 -1
- metadata +63 -58
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DevGuide.md +0 -132
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CheatSheet.md +0 -525
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CookBook.md +0 -3250
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/Documentation.md +0 -11
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/ForDummies.md +0 -439
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/FrequentlyAskedQuestions.md +0 -624
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CheatSheet.md +0 -534
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CookBook.md +0 -3342
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/Documentation.md +0 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/ForDummies.md +0 -439
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/FrequentlyAskedQuestions.md +0 -628
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CheatSheet.md +0 -556
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CookBook.md +0 -3432
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/Documentation.md +0 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/ForDummies.md +0 -439
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/FrequentlyAskedQuestions.md +0 -628
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/DevGuide.md +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Documentation.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_AdvancedGuide.md +0 -2096
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Documentation.md +0 -12
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_FAQ.md +0 -886
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Primer.md +0 -497
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_PumpManual.md +0 -177
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_XcodeGuide.md +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_AdvancedGuide.md +0 -2178
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Documentation.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_FAQ.md +0 -1038
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Primer.md +0 -501
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_PumpManual.md +0 -177
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Samples.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_XcodeGuide.md +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_AdvancedGuide.md +0 -2181
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Documentation.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_FAQ.md +0 -1082
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Primer.md +0 -501
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_PumpManual.md +0 -177
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Samples.md +0 -14
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_XcodeGuide.md +0 -93
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.sln +0 -45
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.vcproj +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.sln +0 -45
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.vcproj +0 -126
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main-md.vcproj +0 -129
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main.vcproj +0 -129
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test-md.vcproj +0 -164
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test.vcproj +0 -164
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest-md.vcproj +0 -147
- data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest.vcproj +0 -147
- data/ext/rj_schema/rapidjson/thirdparty/gtest/travis.sh +0 -15
@@ -1,5 +1,3 @@
|
|
1
|
-
#!/usr/bin/env python
|
2
|
-
#
|
3
1
|
# Copyright 2006, Google Inc.
|
4
2
|
# All rights reserved.
|
5
3
|
#
|
@@ -36,19 +34,19 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
|
|
36
34
|
import os
|
37
35
|
import sys
|
38
36
|
|
39
|
-
|
40
37
|
# Determines path to gtest_test_utils and imports it.
|
41
38
|
SCRIPT_DIR = os.path.dirname(__file__) or '.'
|
42
39
|
|
43
40
|
# isdir resolves symbolic links.
|
44
|
-
gtest_tests_util_dir = os.path.join(SCRIPT_DIR, '
|
41
|
+
gtest_tests_util_dir = os.path.join(SCRIPT_DIR, '../../googletest/test')
|
45
42
|
if os.path.isdir(gtest_tests_util_dir):
|
46
43
|
GTEST_TESTS_UTIL_DIR = gtest_tests_util_dir
|
47
44
|
else:
|
48
|
-
GTEST_TESTS_UTIL_DIR = os.path.join(SCRIPT_DIR, '../../
|
49
|
-
|
45
|
+
GTEST_TESTS_UTIL_DIR = os.path.join(SCRIPT_DIR, '../../googletest/test')
|
50
46
|
sys.path.append(GTEST_TESTS_UTIL_DIR)
|
51
|
-
|
47
|
+
|
48
|
+
# pylint: disable=C6204
|
49
|
+
import gtest_test_utils
|
52
50
|
|
53
51
|
|
54
52
|
def GetSourceDir():
|
@@ -44,8 +44,17 @@ endif()
|
|
44
44
|
# as ${gtest_SOURCE_DIR} and to the root binary directory as
|
45
45
|
# ${gtest_BINARY_DIR}.
|
46
46
|
# Language "C" is required for find_package(Threads).
|
47
|
-
|
48
|
-
|
47
|
+
if (CMAKE_VERSION VERSION_LESS 3.0)
|
48
|
+
project(gtest CXX C)
|
49
|
+
else()
|
50
|
+
cmake_policy(SET CMP0048 NEW)
|
51
|
+
project(gtest VERSION 1.9.0 LANGUAGES CXX C)
|
52
|
+
endif()
|
53
|
+
cmake_minimum_required(VERSION 2.6.4)
|
54
|
+
|
55
|
+
if (POLICY CMP0063) # Visibility
|
56
|
+
cmake_policy(SET CMP0063 NEW)
|
57
|
+
endif (POLICY CMP0063)
|
49
58
|
|
50
59
|
if (COMMAND set_up_hermetic_build)
|
51
60
|
set_up_hermetic_build()
|
@@ -63,11 +72,8 @@ config_compiler_and_linker() # Defined in internal_utils.cmake.
|
|
63
72
|
|
64
73
|
# Where Google Test's .h files can be found.
|
65
74
|
include_directories(
|
66
|
-
${gtest_SOURCE_DIR}/include
|
67
|
-
${gtest_SOURCE_DIR})
|
68
|
-
|
69
|
-
# Where Google Test's libraries can be found.
|
70
|
-
link_directories(${gtest_BINARY_DIR}/src)
|
75
|
+
"${gtest_SOURCE_DIR}/include"
|
76
|
+
"${gtest_SOURCE_DIR}")
|
71
77
|
|
72
78
|
# Summary of tuple support for Microsoft Visual Studio:
|
73
79
|
# Compiler version(MS) version(cmake) Support
|
@@ -75,10 +81,12 @@ link_directories(${gtest_BINARY_DIR}/src)
|
|
75
81
|
# <= VS 2010 <= 10 <= 1600 Use Google Tests's own tuple.
|
76
82
|
# VS 2012 11 1700 std::tr1::tuple + _VARIADIC_MAX=10
|
77
83
|
# VS 2013 12 1800 std::tr1::tuple
|
84
|
+
# VS 2015 14 1900 std::tuple
|
85
|
+
# VS 2017 15 >= 1910 std::tuple
|
78
86
|
if (MSVC AND MSVC_VERSION EQUAL 1700)
|
79
87
|
add_definitions(/D _VARIADIC_MAX=10)
|
80
88
|
endif()
|
81
|
-
|
89
|
+
|
82
90
|
########################################################################
|
83
91
|
#
|
84
92
|
# Defines the gtest & gtest_main libraries. User tests should link
|
@@ -95,17 +103,33 @@ target_link_libraries(gtest_main gtest)
|
|
95
103
|
# to the targets for when we are part of a parent build (ie being pulled
|
96
104
|
# in via add_subdirectory() rather than being a standalone build).
|
97
105
|
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
|
98
|
-
target_include_directories(gtest INTERFACE "${gtest_SOURCE_DIR}/include")
|
99
|
-
target_include_directories(gtest_main INTERFACE "${gtest_SOURCE_DIR}/include")
|
106
|
+
target_include_directories(gtest SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include")
|
107
|
+
target_include_directories(gtest_main SYSTEM INTERFACE "${gtest_SOURCE_DIR}/include")
|
100
108
|
endif()
|
101
109
|
|
102
110
|
########################################################################
|
103
111
|
#
|
104
112
|
# Install rules
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
113
|
+
if(INSTALL_GTEST)
|
114
|
+
install(TARGETS gtest gtest_main
|
115
|
+
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
116
|
+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
117
|
+
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
118
|
+
install(DIRECTORY "${gtest_SOURCE_DIR}/include/gtest"
|
119
|
+
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
120
|
+
|
121
|
+
# configure and install pkgconfig files
|
122
|
+
configure_file(
|
123
|
+
cmake/gtest.pc.in
|
124
|
+
"${CMAKE_BINARY_DIR}/gtest.pc"
|
125
|
+
@ONLY)
|
126
|
+
configure_file(
|
127
|
+
cmake/gtest_main.pc.in
|
128
|
+
"${CMAKE_BINARY_DIR}/gtest_main.pc"
|
129
|
+
@ONLY)
|
130
|
+
install(FILES "${CMAKE_BINARY_DIR}/gtest.pc" "${CMAKE_BINARY_DIR}/gtest_main.pc"
|
131
|
+
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
132
|
+
endif()
|
109
133
|
|
110
134
|
########################################################################
|
111
135
|
#
|
@@ -280,7 +304,9 @@ if (gtest_build_tests)
|
|
280
304
|
cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
|
281
305
|
cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
|
282
306
|
py_test(gtest_xml_outfiles_test)
|
307
|
+
py_test(gtest_json_outfiles_test)
|
283
308
|
|
284
309
|
cxx_executable(gtest_xml_output_unittest_ test gtest)
|
285
310
|
py_test(gtest_xml_output_unittest)
|
311
|
+
py_test(gtest_json_output_unittest)
|
286
312
|
endif()
|
@@ -34,6 +34,7 @@ EXTRA_DIST += $(GTEST_SRC)
|
|
34
34
|
# Sample files that we don't compile.
|
35
35
|
EXTRA_DIST += \
|
36
36
|
samples/prime_tables.h \
|
37
|
+
samples/sample1_unittest.cc \
|
37
38
|
samples/sample2_unittest.cc \
|
38
39
|
samples/sample3_unittest.cc \
|
39
40
|
samples/sample4_unittest.cc \
|
@@ -120,16 +121,16 @@ EXTRA_DIST += \
|
|
120
121
|
|
121
122
|
# MSVC project files
|
122
123
|
EXTRA_DIST += \
|
123
|
-
msvc/gtest-md.sln \
|
124
|
-
msvc/gtest-md.
|
125
|
-
msvc/gtest.sln \
|
126
|
-
msvc/gtest.
|
127
|
-
msvc/gtest_main-md.
|
128
|
-
msvc/gtest_main.
|
129
|
-
msvc/gtest_prod_test-md.
|
130
|
-
msvc/gtest_prod_test.
|
131
|
-
msvc/gtest_unittest-md.
|
132
|
-
msvc/gtest_unittest.
|
124
|
+
msvc/2010/gtest-md.sln \
|
125
|
+
msvc/2010/gtest-md.vcxproj \
|
126
|
+
msvc/2010/gtest.sln \
|
127
|
+
msvc/2010/gtest.vcxproj \
|
128
|
+
msvc/2010/gtest_main-md.vcxproj \
|
129
|
+
msvc/2010/gtest_main.vcxproj \
|
130
|
+
msvc/2010/gtest_prod_test-md.vcxproj \
|
131
|
+
msvc/2010/gtest_prod_test.vcxproj \
|
132
|
+
msvc/2010/gtest_unittest-md.vcxproj \
|
133
|
+
msvc/2010/gtest_unittest.vcxproj
|
133
134
|
|
134
135
|
# xcode project files
|
135
136
|
EXTRA_DIST += \
|
@@ -216,40 +217,68 @@ pkginclude_internal_HEADERS = \
|
|
216
217
|
lib_libgtest_main_la_SOURCES = src/gtest_main.cc
|
217
218
|
lib_libgtest_main_la_LIBADD = lib/libgtest.la
|
218
219
|
|
219
|
-
#
|
220
|
+
# Build rules for samples and tests. Automake's naming for some of
|
220
221
|
# these variables isn't terribly obvious, so this is a brief
|
221
222
|
# reference:
|
222
223
|
#
|
223
224
|
# TESTS -- Programs run automatically by "make check"
|
224
225
|
# check_PROGRAMS -- Programs built by "make check" but not necessarily run
|
225
226
|
|
226
|
-
noinst_LTLIBRARIES = samples/libsamples.la
|
227
|
-
|
228
|
-
samples_libsamples_la_SOURCES = \
|
229
|
-
samples/sample1.cc \
|
230
|
-
samples/sample1.h \
|
231
|
-
samples/sample2.cc \
|
232
|
-
samples/sample2.h \
|
233
|
-
samples/sample3-inl.h \
|
234
|
-
samples/sample4.cc \
|
235
|
-
samples/sample4.h
|
236
|
-
|
237
227
|
TESTS=
|
238
228
|
TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \
|
239
229
|
GTEST_BUILD_DIR="$(top_builddir)/test"
|
240
230
|
check_PROGRAMS=
|
241
231
|
|
242
232
|
# A simple sample on using gtest.
|
243
|
-
TESTS += samples/sample1_unittest
|
244
|
-
|
245
|
-
|
233
|
+
TESTS += samples/sample1_unittest \
|
234
|
+
samples/sample2_unittest \
|
235
|
+
samples/sample3_unittest \
|
236
|
+
samples/sample4_unittest \
|
237
|
+
samples/sample5_unittest \
|
238
|
+
samples/sample6_unittest \
|
239
|
+
samples/sample7_unittest \
|
240
|
+
samples/sample8_unittest \
|
241
|
+
samples/sample9_unittest \
|
242
|
+
samples/sample10_unittest
|
243
|
+
check_PROGRAMS += samples/sample1_unittest \
|
244
|
+
samples/sample2_unittest \
|
245
|
+
samples/sample3_unittest \
|
246
|
+
samples/sample4_unittest \
|
247
|
+
samples/sample5_unittest \
|
248
|
+
samples/sample6_unittest \
|
249
|
+
samples/sample7_unittest \
|
250
|
+
samples/sample8_unittest \
|
251
|
+
samples/sample9_unittest \
|
252
|
+
samples/sample10_unittest
|
253
|
+
|
254
|
+
samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc samples/sample1.cc
|
246
255
|
samples_sample1_unittest_LDADD = lib/libgtest_main.la \
|
247
|
-
lib/libgtest.la
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
256
|
+
lib/libgtest.la
|
257
|
+
samples_sample2_unittest_SOURCES = samples/sample2_unittest.cc samples/sample2.cc
|
258
|
+
samples_sample2_unittest_LDADD = lib/libgtest_main.la \
|
259
|
+
lib/libgtest.la
|
260
|
+
samples_sample3_unittest_SOURCES = samples/sample3_unittest.cc
|
261
|
+
samples_sample3_unittest_LDADD = lib/libgtest_main.la \
|
262
|
+
lib/libgtest.la
|
263
|
+
samples_sample4_unittest_SOURCES = samples/sample4_unittest.cc samples/sample4.cc
|
264
|
+
samples_sample4_unittest_LDADD = lib/libgtest_main.la \
|
265
|
+
lib/libgtest.la
|
266
|
+
samples_sample5_unittest_SOURCES = samples/sample5_unittest.cc samples/sample1.cc
|
267
|
+
samples_sample5_unittest_LDADD = lib/libgtest_main.la \
|
268
|
+
lib/libgtest.la
|
269
|
+
samples_sample6_unittest_SOURCES = samples/sample6_unittest.cc
|
270
|
+
samples_sample6_unittest_LDADD = lib/libgtest_main.la \
|
271
|
+
lib/libgtest.la
|
272
|
+
samples_sample7_unittest_SOURCES = samples/sample7_unittest.cc
|
273
|
+
samples_sample7_unittest_LDADD = lib/libgtest_main.la \
|
274
|
+
lib/libgtest.la
|
275
|
+
samples_sample8_unittest_SOURCES = samples/sample8_unittest.cc
|
276
|
+
samples_sample8_unittest_LDADD = lib/libgtest_main.la \
|
277
|
+
lib/libgtest.la
|
278
|
+
|
279
|
+
# Also verify that libgtest works by itself.
|
280
|
+
samples_sample9_unittest_SOURCES = samples/sample9_unittest.cc
|
281
|
+
samples_sample9_unittest_LDADD = lib/libgtest.la
|
253
282
|
samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc
|
254
283
|
samples_sample10_unittest_LDADD = lib/libgtest.la
|
255
284
|
|
@@ -1,23 +1,21 @@
|
|
1
|
+
### Generic Build Instructions
|
1
2
|
|
2
|
-
|
3
|
+
#### Setup
|
3
4
|
|
4
|
-
|
5
|
+
To build Google Test and your tests that use it, you need to tell your build
|
6
|
+
system where to find its headers and source files. The exact way to do it
|
7
|
+
depends on which build system you use, and is usually straightforward.
|
5
8
|
|
6
|
-
|
7
|
-
build system where to find its headers and source files. The exact
|
8
|
-
way to do it depends on which build system you use, and is usually
|
9
|
-
straightforward.
|
9
|
+
#### Build
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
create a library build target (or a project as called by Visual Studio
|
15
|
-
and Xcode) to compile
|
11
|
+
Suppose you put Google Test in directory `${GTEST_DIR}`. To build it, create a
|
12
|
+
library build target (or a project as called by Visual Studio and Xcode) to
|
13
|
+
compile
|
16
14
|
|
17
15
|
${GTEST_DIR}/src/gtest-all.cc
|
18
16
|
|
19
17
|
with `${GTEST_DIR}/include` in the system header search path and `${GTEST_DIR}`
|
20
|
-
in the normal header search path.
|
18
|
+
in the normal header search path. Assuming a Linux-like system and gcc,
|
21
19
|
something like the following will do:
|
22
20
|
|
23
21
|
g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
|
@@ -26,136 +24,239 @@ something like the following will do:
|
|
26
24
|
|
27
25
|
(We need `-pthread` as Google Test uses threads.)
|
28
26
|
|
29
|
-
Next, you should compile your test source file with
|
30
|
-
|
31
|
-
|
27
|
+
Next, you should compile your test source file with `${GTEST_DIR}/include` in
|
28
|
+
the system header search path, and link it with gtest and any other necessary
|
29
|
+
libraries:
|
32
30
|
|
33
31
|
g++ -isystem ${GTEST_DIR}/include -pthread path/to/your_test.cc libgtest.a \
|
34
32
|
-o your_test
|
35
33
|
|
36
|
-
As an example, the make/ directory contains a Makefile that you can
|
37
|
-
|
38
|
-
|
39
|
-
Test
|
40
|
-
|
41
|
-
script.
|
34
|
+
As an example, the make/ directory contains a Makefile that you can use to build
|
35
|
+
Google Test on systems where GNU make is available (e.g. Linux, Mac OS X, and
|
36
|
+
Cygwin). It doesn't try to build Google Test's own tests. Instead, it just
|
37
|
+
builds the Google Test library and a sample test. You can use it as a starting
|
38
|
+
point for your own build script.
|
42
39
|
|
43
|
-
If the default settings are correct for your environment, the
|
44
|
-
|
40
|
+
If the default settings are correct for your environment, the following commands
|
41
|
+
should succeed:
|
45
42
|
|
46
43
|
cd ${GTEST_DIR}/make
|
47
44
|
make
|
48
45
|
./sample1_unittest
|
49
46
|
|
50
|
-
If you see errors, try to tweak the contents of `make/Makefile` to make
|
51
|
-
|
52
|
-
it.
|
47
|
+
If you see errors, try to tweak the contents of `make/Makefile` to make them go
|
48
|
+
away. There are instructions in `make/Makefile` on how to do it.
|
53
49
|
|
54
|
-
### Using CMake
|
50
|
+
### Using CMake
|
55
51
|
|
56
52
|
Google Test comes with a CMake build script (
|
57
|
-
[CMakeLists.txt](CMakeLists.txt))
|
58
|
-
|
59
|
-
download it for free from
|
53
|
+
[CMakeLists.txt](https://github.com/google/googletest/blob/master/CMakeLists.txt))
|
54
|
+
that can be used on a wide range of platforms ("C" stands for cross-platform.).
|
55
|
+
If you don't have CMake installed already, you can download it for free from
|
56
|
+
<http://www.cmake.org/>.
|
57
|
+
|
58
|
+
CMake works by generating native makefiles or build projects that can be used in
|
59
|
+
the compiler environment of your choice. You can either build Google Test as a
|
60
|
+
standalone project or it can be incorporated into an existing CMake build for
|
61
|
+
another project.
|
60
62
|
|
61
|
-
|
62
|
-
|
63
|
-
workflow starts
|
63
|
+
#### Standalone CMake Project
|
64
|
+
|
65
|
+
When building Google Test as a standalone project, the typical workflow starts
|
66
|
+
with:
|
64
67
|
|
65
68
|
mkdir mybuild # Create a directory to hold the build output.
|
66
69
|
cd mybuild
|
67
70
|
cmake ${GTEST_DIR} # Generate native build scripts.
|
68
71
|
|
69
|
-
If you want to build Google Test's samples, you should replace the
|
70
|
-
|
72
|
+
If you want to build Google Test's samples, you should replace the last command
|
73
|
+
with
|
71
74
|
|
72
75
|
cmake -Dgtest_build_samples=ON ${GTEST_DIR}
|
73
76
|
|
74
|
-
If you are on a \*nix system, you should now see a Makefile in the
|
75
|
-
|
77
|
+
If you are on a \*nix system, you should now see a Makefile in the current
|
78
|
+
directory. Just type 'make' to build gtest.
|
76
79
|
|
77
|
-
If you use Windows and have Visual Studio installed, a `gtest.sln` file
|
78
|
-
|
79
|
-
|
80
|
+
If you use Windows and have Visual Studio installed, a `gtest.sln` file and
|
81
|
+
several `.vcproj` files will be created. You can then build them using Visual
|
82
|
+
Studio.
|
80
83
|
|
81
84
|
On Mac OS X with Xcode installed, a `.xcodeproj` file will be generated.
|
82
85
|
|
83
|
-
|
86
|
+
#### Incorporating Into An Existing CMake Project
|
87
|
+
|
88
|
+
If you want to use gtest in a project which already uses CMake, then a more
|
89
|
+
robust and flexible approach is to build gtest as part of that project directly.
|
90
|
+
This is done by making the GoogleTest source code available to the main build
|
91
|
+
and adding it using CMake's `add_subdirectory()` command. This has the
|
92
|
+
significant advantage that the same compiler and linker settings are used
|
93
|
+
between gtest and the rest of your project, so issues associated with using
|
94
|
+
incompatible libraries (eg debug/release), etc. are avoided. This is
|
95
|
+
particularly useful on Windows. Making GoogleTest's source code available to the
|
96
|
+
main build can be done a few different ways:
|
97
|
+
|
98
|
+
* Download the GoogleTest source code manually and place it at a known
|
99
|
+
location. This is the least flexible approach and can make it more difficult
|
100
|
+
to use with continuous integration systems, etc.
|
101
|
+
* Embed the GoogleTest source code as a direct copy in the main project's
|
102
|
+
source tree. This is often the simplest approach, but is also the hardest to
|
103
|
+
keep up to date. Some organizations may not permit this method.
|
104
|
+
* Add GoogleTest as a git submodule or equivalent. This may not always be
|
105
|
+
possible or appropriate. Git submodules, for example, have their own set of
|
106
|
+
advantages and drawbacks.
|
107
|
+
* Use CMake to download GoogleTest as part of the build's configure step. This
|
108
|
+
is just a little more complex, but doesn't have the limitations of the other
|
109
|
+
methods.
|
110
|
+
|
111
|
+
The last of the above methods is implemented with a small piece of CMake code in
|
112
|
+
a separate file (e.g. `CMakeLists.txt.in`) which is copied to the build area and
|
113
|
+
then invoked as a sub-build _during the CMake stage_. That directory is then
|
114
|
+
pulled into the main build with `add_subdirectory()`. For example:
|
115
|
+
|
116
|
+
New file `CMakeLists.txt.in`:
|
117
|
+
|
118
|
+
cmake_minimum_required(VERSION 2.8.2)
|
119
|
+
|
120
|
+
project(googletest-download NONE)
|
121
|
+
|
122
|
+
include(ExternalProject)
|
123
|
+
ExternalProject_Add(googletest
|
124
|
+
GIT_REPOSITORY https://github.com/google/googletest.git
|
125
|
+
GIT_TAG master
|
126
|
+
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
|
127
|
+
BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
|
128
|
+
CONFIGURE_COMMAND ""
|
129
|
+
BUILD_COMMAND ""
|
130
|
+
INSTALL_COMMAND ""
|
131
|
+
TEST_COMMAND ""
|
132
|
+
)
|
133
|
+
|
134
|
+
Existing build's `CMakeLists.txt`:
|
135
|
+
|
136
|
+
# Download and unpack googletest at configure time
|
137
|
+
configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
|
138
|
+
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
|
139
|
+
RESULT_VARIABLE result
|
140
|
+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
|
141
|
+
if(result)
|
142
|
+
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
|
143
|
+
endif()
|
144
|
+
execute_process(COMMAND ${CMAKE_COMMAND} --build .
|
145
|
+
RESULT_VARIABLE result
|
146
|
+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
|
147
|
+
if(result)
|
148
|
+
message(FATAL_ERROR "Build step for googletest failed: ${result}")
|
149
|
+
endif()
|
150
|
+
|
151
|
+
# Prevent overriding the parent project's compiler/linker
|
152
|
+
# settings on Windows
|
153
|
+
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
154
|
+
|
155
|
+
# Add googletest directly to our build. This defines
|
156
|
+
# the gtest and gtest_main targets.
|
157
|
+
add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
|
158
|
+
${CMAKE_BINARY_DIR}/googletest-build
|
159
|
+
EXCLUDE_FROM_ALL)
|
160
|
+
|
161
|
+
# The gtest/gtest_main targets carry header search path
|
162
|
+
# dependencies automatically when using CMake 2.8.11 or
|
163
|
+
# later. Otherwise we have to add them here ourselves.
|
164
|
+
if (CMAKE_VERSION VERSION_LESS 2.8.11)
|
165
|
+
include_directories("${gtest_SOURCE_DIR}/include")
|
166
|
+
endif()
|
167
|
+
|
168
|
+
# Now simply link against gtest or gtest_main as needed. Eg
|
169
|
+
add_executable(example example.cpp)
|
170
|
+
target_link_libraries(example gtest_main)
|
171
|
+
add_test(NAME example_test COMMAND example)
|
172
|
+
|
173
|
+
Note that this approach requires CMake 2.8.2 or later due to its use of the
|
174
|
+
`ExternalProject_Add()` command. The above technique is discussed in more detail
|
175
|
+
in [this separate article](http://crascit.com/2015/07/25/cmake-gtest/) which
|
176
|
+
also contains a link to a fully generalized implementation of the technique.
|
177
|
+
|
178
|
+
##### Visual Studio Dynamic vs Static Runtimes
|
179
|
+
|
180
|
+
By default, new Visual Studio projects link the C runtimes dynamically but
|
181
|
+
Google Test links them statically. This will generate an error that looks
|
182
|
+
something like the following: gtest.lib(gtest-all.obj) : error LNK2038: mismatch
|
183
|
+
detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value
|
184
|
+
'MDd_DynamicDebug' in main.obj
|
185
|
+
|
186
|
+
Google Test already has a CMake option for this: `gtest_force_shared_crt`
|
187
|
+
|
188
|
+
Enabling this option will make gtest link the runtimes dynamically too, and
|
189
|
+
match the project in which it is included.
|
190
|
+
|
191
|
+
### Legacy Build Scripts
|
84
192
|
|
85
193
|
Before settling on CMake, we have been providing hand-maintained build
|
86
|
-
projects/scripts for Visual Studio, Xcode, and Autotools.
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
with your existing build system.
|
194
|
+
projects/scripts for Visual Studio, Xcode, and Autotools. While we continue to
|
195
|
+
provide them for convenience, they are not actively maintained any more. We
|
196
|
+
highly recommend that you follow the instructions in the above sections to
|
197
|
+
integrate Google Test with your existing build system.
|
91
198
|
|
92
199
|
If you still need to use the legacy build scripts, here's how:
|
93
200
|
|
94
|
-
The msvc\ folder contains two solutions with Visual C++ projects.
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
"Preferences..." -> "Building" pane and defaults to xcode/build).
|
109
|
-
Alternatively, at the command line, enter:
|
201
|
+
The msvc\ folder contains two solutions with Visual C++ projects. Open the
|
202
|
+
`gtest.sln` or `gtest-md.sln` file using Visual Studio, and you are ready to
|
203
|
+
build Google Test the same way you build any Visual Studio project. Files that
|
204
|
+
have names ending with -md use DLL versions of Microsoft runtime libraries (the
|
205
|
+
/MD or the /MDd compiler option). Files without that suffix use static versions
|
206
|
+
of the runtime libraries (the /MT or the /MTd option). Please note that one must
|
207
|
+
use the same option to compile both gtest and the test code. If you use Visual
|
208
|
+
Studio 2005 or above, we recommend the -md version as /MD is the default for new
|
209
|
+
projects in these versions of Visual Studio.
|
210
|
+
|
211
|
+
On Mac OS X, open the `gtest.xcodeproj` in the `xcode/` folder using Xcode.
|
212
|
+
Build the "gtest" target. The universal binary framework will end up in your
|
213
|
+
selected build directory (selected in the Xcode "Preferences..." -> "Building"
|
214
|
+
pane and defaults to xcode/build). Alternatively, at the command line, enter:
|
110
215
|
|
111
216
|
xcodebuild
|
112
217
|
|
113
|
-
This will build the "Release" configuration of gtest.framework in your
|
114
|
-
|
115
|
-
|
116
|
-
different locations.
|
218
|
+
This will build the "Release" configuration of gtest.framework in your default
|
219
|
+
build location. See the "xcodebuild" man page for more information about
|
220
|
+
building different configurations and building in different locations.
|
117
221
|
|
118
|
-
If you wish to use the Google Test Xcode project with Xcode 4.x and
|
119
|
-
|
222
|
+
If you wish to use the Google Test Xcode project with Xcode 4.x and above, you
|
223
|
+
need to either:
|
120
224
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
225
|
+
* update the SDK configuration options in xcode/Config/General.xconfig.
|
226
|
+
Comment options `SDKROOT`, `MACOS_DEPLOYMENT_TARGET`, and `GCC_VERSION`. If
|
227
|
+
you choose this route you lose the ability to target earlier versions of
|
228
|
+
MacOS X.
|
229
|
+
* Install an SDK for an earlier version. This doesn't appear to be supported
|
230
|
+
by Apple, but has been reported to work
|
231
|
+
(http://stackoverflow.com/questions/5378518).
|
128
232
|
|
129
|
-
### Tweaking Google Test
|
233
|
+
### Tweaking Google Test
|
130
234
|
|
131
|
-
Google Test can be used in diverse environments.
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
or 0 to enable or disable a certain feature.
|
235
|
+
Google Test can be used in diverse environments. The default configuration may
|
236
|
+
not work (or may not work well) out of the box in some environments. However,
|
237
|
+
you can easily tweak Google Test by defining control macros on the compiler
|
238
|
+
command line. Generally, these macros are named like `GTEST_XYZ` and you define
|
239
|
+
them to either 1 or 0 to enable or disable a certain feature.
|
137
240
|
|
138
|
-
We list the most frequently used macros below.
|
139
|
-
|
241
|
+
We list the most frequently used macros below. For a complete list, see file
|
242
|
+
[include/gtest/internal/gtest-port.h](https://github.com/google/googletest/blob/master/include/gtest/internal/gtest-port.h).
|
140
243
|
|
141
|
-
### Choosing a TR1 Tuple Library
|
244
|
+
### Choosing a TR1 Tuple Library
|
142
245
|
|
143
|
-
Some Google Test features require the C++ Technical Report 1 (TR1)
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
compiler doesn't provide TR1 tuple.
|
246
|
+
Some Google Test features require the C++ Technical Report 1 (TR1) tuple
|
247
|
+
library, which is not yet available with all compilers. The good news is that
|
248
|
+
Google Test implements a subset of TR1 tuple that's enough for its own need, and
|
249
|
+
will automatically use this when the compiler doesn't provide TR1 tuple.
|
148
250
|
|
149
|
-
Usually you don't need to care about which tuple library Google Test
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
that, add
|
251
|
+
Usually you don't need to care about which tuple library Google Test uses.
|
252
|
+
However, if your project already uses TR1 tuple, you need to tell Google Test to
|
253
|
+
use the same TR1 tuple library the rest of your project uses, or the two tuple
|
254
|
+
implementations will clash. To do that, add
|
154
255
|
|
155
256
|
-DGTEST_USE_OWN_TR1_TUPLE=0
|
156
257
|
|
157
|
-
to the compiler flags while compiling Google Test and your tests.
|
158
|
-
|
258
|
+
to the compiler flags while compiling Google Test and your tests. If you want to
|
259
|
+
force Google Test to use its own tuple library, just add
|
159
260
|
|
160
261
|
-DGTEST_USE_OWN_TR1_TUPLE=1
|
161
262
|
|
@@ -167,15 +268,15 @@ If you don't want Google Test to use tuple at all, add
|
|
167
268
|
|
168
269
|
and all features using tuple will be disabled.
|
169
270
|
|
170
|
-
### Multi-threaded Tests
|
271
|
+
### Multi-threaded Tests
|
171
272
|
|
172
|
-
Google Test is thread-safe where the pthread library is available.
|
173
|
-
|
174
|
-
|
175
|
-
|
273
|
+
Google Test is thread-safe where the pthread library is available. After
|
274
|
+
`#include "gtest/gtest.h"`, you can check the `GTEST_IS_THREADSAFE` macro to see
|
275
|
+
whether this is the case (yes if the macro is `#defined` to 1, no if it's
|
276
|
+
undefined.).
|
176
277
|
|
177
|
-
If Google Test doesn't correctly detect whether pthread is available
|
178
|
-
|
278
|
+
If Google Test doesn't correctly detect whether pthread is available in your
|
279
|
+
environment, you can force it with
|
179
280
|
|
180
281
|
-DGTEST_HAS_PTHREAD=1
|
181
282
|
|
@@ -183,26 +284,24 @@ or
|
|
183
284
|
|
184
285
|
-DGTEST_HAS_PTHREAD=0
|
185
286
|
|
186
|
-
When Google Test uses pthread, you may need to add flags to your
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
figure out what flags to add.
|
287
|
+
When Google Test uses pthread, you may need to add flags to your compiler and/or
|
288
|
+
linker to select the pthread library, or you'll get link errors. If you use the
|
289
|
+
CMake script or the deprecated Autotools script, this is taken care of for you.
|
290
|
+
If you use your own build script, you'll need to read your compiler and linker's
|
291
|
+
manual to figure out what flags to add.
|
192
292
|
|
193
|
-
### As a Shared Library (DLL)
|
293
|
+
### As a Shared Library (DLL)
|
194
294
|
|
195
|
-
Google Test is compact, so most users can build and link it as a
|
196
|
-
|
197
|
-
as a
|
295
|
+
Google Test is compact, so most users can build and link it as a static library
|
296
|
+
for the simplicity. You can choose to use Google Test as a shared library (known
|
297
|
+
as a DLL on Windows) if you prefer.
|
198
298
|
|
199
299
|
To compile *gtest* as a shared library, add
|
200
300
|
|
201
301
|
-DGTEST_CREATE_SHARED_LIBRARY=1
|
202
302
|
|
203
|
-
to the compiler flags.
|
204
|
-
|
205
|
-
it.
|
303
|
+
to the compiler flags. You'll also need to tell the linker to produce a shared
|
304
|
+
library instead - consult your linker's manual for how to do it.
|
206
305
|
|
207
306
|
To compile your *tests* that use the gtest shared library, add
|
208
307
|
|
@@ -210,31 +309,28 @@ To compile your *tests* that use the gtest shared library, add
|
|
210
309
|
|
211
310
|
to the compiler flags.
|
212
311
|
|
213
|
-
Note: while the above steps aren't technically necessary today when
|
214
|
-
|
215
|
-
|
216
|
-
<http://gcc.gnu.org/wiki/Visibility> for details).
|
217
|
-
|
218
|
-
|
219
|
-
your build script.
|
312
|
+
Note: while the above steps aren't technically necessary today when using some
|
313
|
+
compilers (e.g. GCC), they may become necessary in the future, if we decide to
|
314
|
+
improve the speed of loading the library (see
|
315
|
+
<http://gcc.gnu.org/wiki/Visibility> for details). Therefore you are recommended
|
316
|
+
to always add the above flags when using Google Test as a shared library.
|
317
|
+
Otherwise a future release of Google Test may break your build script.
|
220
318
|
|
221
|
-
### Avoiding Macro Name Clashes
|
319
|
+
### Avoiding Macro Name Clashes
|
222
320
|
|
223
|
-
In C++, macros don't obey namespaces.
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
conflict.
|
321
|
+
In C++, macros don't obey namespaces. Therefore two libraries that both define a
|
322
|
+
macro of the same name will clash if you `#include` both definitions. In case a
|
323
|
+
Google Test macro clashes with another library, you can force Google Test to
|
324
|
+
rename its macro to avoid the conflict.
|
228
325
|
|
229
|
-
Specifically, if both Google Test and some other code define macro
|
230
|
-
|
326
|
+
Specifically, if both Google Test and some other code define macro FOO, you can
|
327
|
+
add
|
231
328
|
|
232
329
|
-DGTEST_DONT_DEFINE_FOO=1
|
233
330
|
|
234
|
-
to the compiler flags to tell Google Test to change the macro's name
|
235
|
-
|
236
|
-
|
237
|
-
need to write
|
331
|
+
to the compiler flags to tell Google Test to change the macro's name from `FOO`
|
332
|
+
to `GTEST_FOO`. Currently `FOO` can be `FAIL`, `SUCCEED`, or `TEST`. For
|
333
|
+
example, with `-DGTEST_DONT_DEFINE_TEST=1`, you'll need to write
|
238
334
|
|
239
335
|
GTEST_TEST(SomeTest, DoesThis) { ... }
|
240
336
|
|
@@ -243,38 +339,3 @@ instead of
|
|
243
339
|
TEST(SomeTest, DoesThis) { ... }
|
244
340
|
|
245
341
|
in order to define a test.
|
246
|
-
|
247
|
-
## Developing Google Test ##
|
248
|
-
|
249
|
-
This section discusses how to make your own changes to Google Test.
|
250
|
-
|
251
|
-
### Testing Google Test Itself ###
|
252
|
-
|
253
|
-
To make sure your changes work as intended and don't break existing
|
254
|
-
functionality, you'll want to compile and run Google Test's own tests.
|
255
|
-
For that you can use CMake:
|
256
|
-
|
257
|
-
mkdir mybuild
|
258
|
-
cd mybuild
|
259
|
-
cmake -Dgtest_build_tests=ON ${GTEST_DIR}
|
260
|
-
|
261
|
-
Make sure you have Python installed, as some of Google Test's tests
|
262
|
-
are written in Python. If the cmake command complains about not being
|
263
|
-
able to find Python (`Could NOT find PythonInterp (missing:
|
264
|
-
PYTHON_EXECUTABLE)`), try telling it explicitly where your Python
|
265
|
-
executable can be found:
|
266
|
-
|
267
|
-
cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR}
|
268
|
-
|
269
|
-
Next, you can build Google Test and all of its own tests. On \*nix,
|
270
|
-
this is usually done by 'make'. To run the tests, do
|
271
|
-
|
272
|
-
make test
|
273
|
-
|
274
|
-
All tests should pass.
|
275
|
-
|
276
|
-
Normally you don't need to worry about regenerating the source files,
|
277
|
-
unless you need to modify them. In that case, you should modify the
|
278
|
-
corresponding .pump files instead and run the pump.py Python script to
|
279
|
-
regenerate them. You can find pump.py in the [scripts/](scripts/) directory.
|
280
|
-
Read the [Pump manual](docs/PumpManual.md) for how to use it.
|