rj_schema 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (323) hide show
  1. checksums.yaml +5 -5
  2. data/Rakefile +4 -0
  3. data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +16 -0
  4. data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +141 -0
  5. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
  6. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +202 -0
  7. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
  8. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
  9. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
  10. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +333 -0
  11. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
  12. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +562 -0
  13. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3675 -0
  14. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
  15. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DevGuide.md +132 -0
  16. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +12 -0
  17. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +439 -0
  18. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +628 -0
  19. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
  20. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CheatSheet.md +525 -0
  21. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/CookBook.md +3250 -0
  22. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/Documentation.md +11 -0
  23. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/ForDummies.md +439 -0
  24. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_5/FrequentlyAskedQuestions.md +624 -0
  25. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CheatSheet.md +534 -0
  26. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/CookBook.md +3342 -0
  27. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/Documentation.md +12 -0
  28. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/ForDummies.md +439 -0
  29. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_6/FrequentlyAskedQuestions.md +628 -0
  30. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CheatSheet.md +556 -0
  31. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/CookBook.md +3432 -0
  32. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/Documentation.md +12 -0
  33. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/ForDummies.md +439 -0
  34. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/v1_7/FrequentlyAskedQuestions.md +628 -0
  35. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1205 -0
  36. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
  37. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2377 -0
  38. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +794 -0
  39. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1095 -0
  40. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +291 -0
  41. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2179 -0
  42. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +672 -0
  43. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +397 -0
  44. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +161 -0
  45. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +4399 -0
  46. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
  47. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +58 -0
  48. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1847 -0
  49. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +94 -0
  50. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
  51. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
  52. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +39 -0
  53. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
  54. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +279 -0
  55. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
  56. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +511 -0
  57. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +91 -0
  58. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
  59. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
  60. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
  61. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
  62. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
  63. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
  64. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +32 -0
  65. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +82 -0
  66. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
  67. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +88 -0
  68. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +101 -0
  69. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +32 -0
  70. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +84 -0
  71. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
  72. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +90 -0
  73. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +103 -0
  74. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
  75. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
  76. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +35 -0
  77. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
  78. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  79. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
  80. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
  81. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
  82. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
  83. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
  84. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
  85. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
  86. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
  87. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
  88. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
  89. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
  90. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
  91. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
  92. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +174 -0
  93. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +498 -0
  94. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +823 -0
  95. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +183 -0
  96. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
  97. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1411 -0
  98. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
  99. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1228 -0
  100. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +622 -0
  101. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +127 -0
  102. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1286 -0
  103. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +699 -0
  104. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +5648 -0
  105. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +708 -0
  106. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +424 -0
  107. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
  108. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2644 -0
  109. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
  110. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
  111. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
  112. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
  113. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
  114. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
  115. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +669 -0
  116. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +180 -0
  117. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +291 -0
  118. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +310 -0
  119. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +322 -0
  120. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +220 -0
  121. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +112 -0
  122. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
  123. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +286 -0
  124. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
  125. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
  126. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +310 -0
  127. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +280 -0
  128. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +242 -0
  129. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
  130. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
  131. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
  132. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
  133. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
  134. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
  135. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
  136. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/AdvancedGuide.md +2182 -0
  137. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/DevGuide.md +126 -0
  138. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Documentation.md +14 -0
  139. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/FAQ.md +1087 -0
  140. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Primer.md +502 -0
  141. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
  142. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Samples.md +14 -0
  143. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_AdvancedGuide.md +2096 -0
  144. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Documentation.md +12 -0
  145. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_FAQ.md +886 -0
  146. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_Primer.md +497 -0
  147. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_PumpManual.md +177 -0
  148. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_5_XcodeGuide.md +93 -0
  149. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_AdvancedGuide.md +2178 -0
  150. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Documentation.md +14 -0
  151. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_FAQ.md +1038 -0
  152. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Primer.md +501 -0
  153. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_PumpManual.md +177 -0
  154. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_Samples.md +14 -0
  155. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_6_XcodeGuide.md +93 -0
  156. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_AdvancedGuide.md +2181 -0
  157. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Documentation.md +14 -0
  158. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_FAQ.md +1082 -0
  159. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Primer.md +501 -0
  160. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_PumpManual.md +177 -0
  161. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_Samples.md +14 -0
  162. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/V1_7_XcodeGuide.md +93 -0
  163. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
  164. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +294 -0
  165. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +250 -0
  166. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1444 -0
  167. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +510 -0
  168. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +993 -0
  169. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +232 -0
  170. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
  171. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +263 -0
  172. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2236 -0
  173. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +358 -0
  174. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +58 -0
  175. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +69 -0
  176. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  177. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +41 -0
  178. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +319 -0
  179. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +206 -0
  180. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1238 -0
  181. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
  182. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5146 -0
  183. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +286 -0
  184. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +731 -0
  185. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +93 -0
  186. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2554 -0
  187. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
  188. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
  189. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
  190. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3331 -0
  191. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +297 -0
  192. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
  193. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
  194. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
  195. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.sln +45 -0
  196. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest-md.vcproj +126 -0
  197. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.sln +45 -0
  198. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest.vcproj +126 -0
  199. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main-md.vcproj +129 -0
  200. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_main.vcproj +129 -0
  201. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test-md.vcproj +164 -0
  202. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_prod_test.vcproj +164 -0
  203. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest-md.vcproj +147 -0
  204. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/gtest_unittest.vcproj +147 -0
  205. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +123 -0
  206. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
  207. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
  208. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +144 -0
  209. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +153 -0
  210. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
  211. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
  212. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +109 -0
  213. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
  214. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +151 -0
  215. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
  216. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
  217. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +45 -0
  218. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
  219. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +224 -0
  220. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +130 -0
  221. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +173 -0
  222. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +160 -0
  223. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
  224. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
  225. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
  226. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
  227. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
  228. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
  229. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
  230. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
  231. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
  232. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
  233. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1342 -0
  234. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +387 -0
  235. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1183 -0
  236. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1259 -0
  237. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +373 -0
  238. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +110 -0
  239. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +118 -0
  240. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5388 -0
  241. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
  242. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
  243. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1427 -0
  244. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +662 -0
  245. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
  246. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
  247. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
  248. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +215 -0
  249. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +65 -0
  250. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1055 -0
  251. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +57 -0
  252. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1304 -0
  253. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1635 -0
  254. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
  255. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
  256. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
  257. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
  258. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
  259. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
  260. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
  261. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +212 -0
  262. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +88 -0
  263. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +237 -0
  264. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
  265. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +130 -0
  266. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +71 -0
  267. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +117 -0
  268. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +126 -0
  269. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +192 -0
  270. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +636 -0
  271. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +140 -0
  272. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
  273. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
  274. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
  275. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
  276. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
  277. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
  278. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +340 -0
  279. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1062 -0
  280. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +743 -0
  281. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
  282. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
  283. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
  284. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +253 -0
  285. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
  286. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
  287. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
  288. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +256 -0
  289. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +320 -0
  290. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
  291. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
  292. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
  293. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +70 -0
  294. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
  295. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7706 -0
  296. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +49 -0
  297. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +49 -0
  298. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +132 -0
  299. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +308 -0
  300. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +181 -0
  301. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +194 -0
  302. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
  303. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
  304. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
  305. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
  306. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
  307. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
  308. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
  309. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
  310. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
  311. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
  312. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
  313. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
  314. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
  315. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
  316. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
  317. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
  318. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
  319. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1135 -0
  320. data/ext/rj_schema/rapidjson/thirdparty/gtest/travis.sh +15 -0
  321. data/ext/rj_schema/rj_schema.cpp +64 -41
  322. data/lib/rj_schema.rb +1 -1
  323. metadata +378 -5
@@ -0,0 +1,127 @@
1
+ // Copyright 2013, 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
+ // Author: wan@google.com (Zhanyong Wan)
31
+ //
32
+ // Tests that Google Test manipulates the premature-exit-detection
33
+ // file correctly.
34
+
35
+ #include <stdio.h>
36
+
37
+ #include "gtest/gtest.h"
38
+
39
+ using ::testing::InitGoogleTest;
40
+ using ::testing::Test;
41
+ using ::testing::internal::posix::GetEnv;
42
+ using ::testing::internal::posix::Stat;
43
+ using ::testing::internal::posix::StatStruct;
44
+
45
+ namespace {
46
+
47
+ class PrematureExitTest : public Test {
48
+ public:
49
+ // Returns true iff the given file exists.
50
+ static bool FileExists(const char* filepath) {
51
+ StatStruct stat;
52
+ return Stat(filepath, &stat) == 0;
53
+ }
54
+
55
+ protected:
56
+ PrematureExitTest() {
57
+ premature_exit_file_path_ = GetEnv("TEST_PREMATURE_EXIT_FILE");
58
+
59
+ // Normalize NULL to "" for ease of handling.
60
+ if (premature_exit_file_path_ == NULL) {
61
+ premature_exit_file_path_ = "";
62
+ }
63
+ }
64
+
65
+ // Returns true iff the premature-exit file exists.
66
+ bool PrematureExitFileExists() const {
67
+ return FileExists(premature_exit_file_path_);
68
+ }
69
+
70
+ const char* premature_exit_file_path_;
71
+ };
72
+
73
+ typedef PrematureExitTest PrematureExitDeathTest;
74
+
75
+ // Tests that:
76
+ // - the premature-exit file exists during the execution of a
77
+ // death test (EXPECT_DEATH*), and
78
+ // - a death test doesn't interfere with the main test process's
79
+ // handling of the premature-exit file.
80
+ TEST_F(PrematureExitDeathTest, FileExistsDuringExecutionOfDeathTest) {
81
+ if (*premature_exit_file_path_ == '\0') {
82
+ return;
83
+ }
84
+
85
+ EXPECT_DEATH_IF_SUPPORTED({
86
+ // If the file exists, crash the process such that the main test
87
+ // process will catch the (expected) crash and report a success;
88
+ // otherwise don't crash, which will cause the main test process
89
+ // to report that the death test has failed.
90
+ if (PrematureExitFileExists()) {
91
+ exit(1);
92
+ }
93
+ }, "");
94
+ }
95
+
96
+ // Tests that the premature-exit file exists during the execution of a
97
+ // normal (non-death) test.
98
+ TEST_F(PrematureExitTest, PrematureExitFileExistsDuringTestExecution) {
99
+ if (*premature_exit_file_path_ == '\0') {
100
+ return;
101
+ }
102
+
103
+ EXPECT_TRUE(PrematureExitFileExists())
104
+ << " file " << premature_exit_file_path_
105
+ << " should exist during test execution, but doesn't.";
106
+ }
107
+
108
+ } // namespace
109
+
110
+ int main(int argc, char **argv) {
111
+ InitGoogleTest(&argc, argv);
112
+ const int exit_code = RUN_ALL_TESTS();
113
+
114
+ // Test that the premature-exit file is deleted upon return from
115
+ // RUN_ALL_TESTS().
116
+ const char* const filepath = GetEnv("TEST_PREMATURE_EXIT_FILE");
117
+ if (filepath != NULL && *filepath != '\0') {
118
+ if (PrematureExitTest::FileExists(filepath)) {
119
+ printf(
120
+ "File %s shouldn't exist after the test program finishes, but does.",
121
+ filepath);
122
+ return 1;
123
+ }
124
+ }
125
+
126
+ return exit_code;
127
+ }
@@ -0,0 +1,57 @@
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
+ // Author: wan@google.com (Zhanyong Wan)
31
+ //
32
+ // Unit test for include/gtest/gtest_prod.h.
33
+
34
+ #include "gtest/gtest.h"
35
+ #include "test/production.h"
36
+
37
+ // Tests that private members can be accessed from a TEST declared as
38
+ // a friend of the class.
39
+ TEST(PrivateCodeTest, CanAccessPrivateMembers) {
40
+ PrivateCode a;
41
+ EXPECT_EQ(0, a.x_);
42
+
43
+ a.set_x(1);
44
+ EXPECT_EQ(1, a.x_);
45
+ }
46
+
47
+ typedef testing::Test PrivateCodeFixtureTest;
48
+
49
+ // Tests that private members can be accessed from a TEST_F declared
50
+ // as a friend of the class.
51
+ TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) {
52
+ PrivateCode a;
53
+ EXPECT_EQ(0, a.x_);
54
+
55
+ a.set_x(2);
56
+ EXPECT_EQ(2, a.x_);
57
+ }
@@ -0,0 +1,253 @@
1
+ // Copyright 2008, 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
+ // Author: wan@google.com (Zhanyong Wan)
31
+
32
+ // Tests the --gtest_repeat=number flag.
33
+
34
+ #include <stdlib.h>
35
+ #include <iostream>
36
+ #include "gtest/gtest.h"
37
+
38
+ // Indicates that this translation unit is part of Google Test's
39
+ // implementation. It must come before gtest-internal-inl.h is
40
+ // included, or there will be a compiler error. This trick is to
41
+ // prevent a user from accidentally including gtest-internal-inl.h in
42
+ // his code.
43
+ #define GTEST_IMPLEMENTATION_ 1
44
+ #include "src/gtest-internal-inl.h"
45
+ #undef GTEST_IMPLEMENTATION_
46
+
47
+ namespace testing {
48
+
49
+ GTEST_DECLARE_string_(death_test_style);
50
+ GTEST_DECLARE_string_(filter);
51
+ GTEST_DECLARE_int32_(repeat);
52
+
53
+ } // namespace testing
54
+
55
+ using testing::GTEST_FLAG(death_test_style);
56
+ using testing::GTEST_FLAG(filter);
57
+ using testing::GTEST_FLAG(repeat);
58
+
59
+ namespace {
60
+
61
+ // We need this when we are testing Google Test itself and therefore
62
+ // cannot use Google Test assertions.
63
+ #define GTEST_CHECK_INT_EQ_(expected, actual) \
64
+ do {\
65
+ const int expected_val = (expected);\
66
+ const int actual_val = (actual);\
67
+ if (::testing::internal::IsTrue(expected_val != actual_val)) {\
68
+ ::std::cout << "Value of: " #actual "\n"\
69
+ << " Actual: " << actual_val << "\n"\
70
+ << "Expected: " #expected "\n"\
71
+ << "Which is: " << expected_val << "\n";\
72
+ ::testing::internal::posix::Abort();\
73
+ }\
74
+ } while (::testing::internal::AlwaysFalse())
75
+
76
+
77
+ // Used for verifying that global environment set-up and tear-down are
78
+ // inside the gtest_repeat loop.
79
+
80
+ int g_environment_set_up_count = 0;
81
+ int g_environment_tear_down_count = 0;
82
+
83
+ class MyEnvironment : public testing::Environment {
84
+ public:
85
+ MyEnvironment() {}
86
+ virtual void SetUp() { g_environment_set_up_count++; }
87
+ virtual void TearDown() { g_environment_tear_down_count++; }
88
+ };
89
+
90
+ // A test that should fail.
91
+
92
+ int g_should_fail_count = 0;
93
+
94
+ TEST(FooTest, ShouldFail) {
95
+ g_should_fail_count++;
96
+ EXPECT_EQ(0, 1) << "Expected failure.";
97
+ }
98
+
99
+ // A test that should pass.
100
+
101
+ int g_should_pass_count = 0;
102
+
103
+ TEST(FooTest, ShouldPass) {
104
+ g_should_pass_count++;
105
+ }
106
+
107
+ // A test that contains a thread-safe death test and a fast death
108
+ // test. It should pass.
109
+
110
+ int g_death_test_count = 0;
111
+
112
+ TEST(BarDeathTest, ThreadSafeAndFast) {
113
+ g_death_test_count++;
114
+
115
+ GTEST_FLAG(death_test_style) = "threadsafe";
116
+ EXPECT_DEATH_IF_SUPPORTED(::testing::internal::posix::Abort(), "");
117
+
118
+ GTEST_FLAG(death_test_style) = "fast";
119
+ EXPECT_DEATH_IF_SUPPORTED(::testing::internal::posix::Abort(), "");
120
+ }
121
+
122
+ #if GTEST_HAS_PARAM_TEST
123
+ int g_param_test_count = 0;
124
+
125
+ const int kNumberOfParamTests = 10;
126
+
127
+ class MyParamTest : public testing::TestWithParam<int> {};
128
+
129
+ TEST_P(MyParamTest, ShouldPass) {
130
+ // TODO(vladl@google.com): Make parameter value checking robust
131
+ // WRT order of tests.
132
+ GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
133
+ g_param_test_count++;
134
+ }
135
+ INSTANTIATE_TEST_CASE_P(MyParamSequence,
136
+ MyParamTest,
137
+ testing::Range(0, kNumberOfParamTests));
138
+ #endif // GTEST_HAS_PARAM_TEST
139
+
140
+ // Resets the count for each test.
141
+ void ResetCounts() {
142
+ g_environment_set_up_count = 0;
143
+ g_environment_tear_down_count = 0;
144
+ g_should_fail_count = 0;
145
+ g_should_pass_count = 0;
146
+ g_death_test_count = 0;
147
+ #if GTEST_HAS_PARAM_TEST
148
+ g_param_test_count = 0;
149
+ #endif // GTEST_HAS_PARAM_TEST
150
+ }
151
+
152
+ // Checks that the count for each test is expected.
153
+ void CheckCounts(int expected) {
154
+ GTEST_CHECK_INT_EQ_(expected, g_environment_set_up_count);
155
+ GTEST_CHECK_INT_EQ_(expected, g_environment_tear_down_count);
156
+ GTEST_CHECK_INT_EQ_(expected, g_should_fail_count);
157
+ GTEST_CHECK_INT_EQ_(expected, g_should_pass_count);
158
+ GTEST_CHECK_INT_EQ_(expected, g_death_test_count);
159
+ #if GTEST_HAS_PARAM_TEST
160
+ GTEST_CHECK_INT_EQ_(expected * kNumberOfParamTests, g_param_test_count);
161
+ #endif // GTEST_HAS_PARAM_TEST
162
+ }
163
+
164
+ // Tests the behavior of Google Test when --gtest_repeat is not specified.
165
+ void TestRepeatUnspecified() {
166
+ ResetCounts();
167
+ GTEST_CHECK_INT_EQ_(1, RUN_ALL_TESTS());
168
+ CheckCounts(1);
169
+ }
170
+
171
+ // Tests the behavior of Google Test when --gtest_repeat has the given value.
172
+ void TestRepeat(int repeat) {
173
+ GTEST_FLAG(repeat) = repeat;
174
+
175
+ ResetCounts();
176
+ GTEST_CHECK_INT_EQ_(repeat > 0 ? 1 : 0, RUN_ALL_TESTS());
177
+ CheckCounts(repeat);
178
+ }
179
+
180
+ // Tests using --gtest_repeat when --gtest_filter specifies an empty
181
+ // set of tests.
182
+ void TestRepeatWithEmptyFilter(int repeat) {
183
+ GTEST_FLAG(repeat) = repeat;
184
+ GTEST_FLAG(filter) = "None";
185
+
186
+ ResetCounts();
187
+ GTEST_CHECK_INT_EQ_(0, RUN_ALL_TESTS());
188
+ CheckCounts(0);
189
+ }
190
+
191
+ // Tests using --gtest_repeat when --gtest_filter specifies a set of
192
+ // successful tests.
193
+ void TestRepeatWithFilterForSuccessfulTests(int repeat) {
194
+ GTEST_FLAG(repeat) = repeat;
195
+ GTEST_FLAG(filter) = "*-*ShouldFail";
196
+
197
+ ResetCounts();
198
+ GTEST_CHECK_INT_EQ_(0, RUN_ALL_TESTS());
199
+ GTEST_CHECK_INT_EQ_(repeat, g_environment_set_up_count);
200
+ GTEST_CHECK_INT_EQ_(repeat, g_environment_tear_down_count);
201
+ GTEST_CHECK_INT_EQ_(0, g_should_fail_count);
202
+ GTEST_CHECK_INT_EQ_(repeat, g_should_pass_count);
203
+ GTEST_CHECK_INT_EQ_(repeat, g_death_test_count);
204
+ #if GTEST_HAS_PARAM_TEST
205
+ GTEST_CHECK_INT_EQ_(repeat * kNumberOfParamTests, g_param_test_count);
206
+ #endif // GTEST_HAS_PARAM_TEST
207
+ }
208
+
209
+ // Tests using --gtest_repeat when --gtest_filter specifies a set of
210
+ // failed tests.
211
+ void TestRepeatWithFilterForFailedTests(int repeat) {
212
+ GTEST_FLAG(repeat) = repeat;
213
+ GTEST_FLAG(filter) = "*ShouldFail";
214
+
215
+ ResetCounts();
216
+ GTEST_CHECK_INT_EQ_(1, RUN_ALL_TESTS());
217
+ GTEST_CHECK_INT_EQ_(repeat, g_environment_set_up_count);
218
+ GTEST_CHECK_INT_EQ_(repeat, g_environment_tear_down_count);
219
+ GTEST_CHECK_INT_EQ_(repeat, g_should_fail_count);
220
+ GTEST_CHECK_INT_EQ_(0, g_should_pass_count);
221
+ GTEST_CHECK_INT_EQ_(0, g_death_test_count);
222
+ #if GTEST_HAS_PARAM_TEST
223
+ GTEST_CHECK_INT_EQ_(0, g_param_test_count);
224
+ #endif // GTEST_HAS_PARAM_TEST
225
+ }
226
+
227
+ } // namespace
228
+
229
+ int main(int argc, char **argv) {
230
+ testing::InitGoogleTest(&argc, argv);
231
+ testing::AddGlobalTestEnvironment(new MyEnvironment);
232
+
233
+ TestRepeatUnspecified();
234
+ TestRepeat(0);
235
+ TestRepeat(1);
236
+ TestRepeat(5);
237
+
238
+ TestRepeatWithEmptyFilter(2);
239
+ TestRepeatWithEmptyFilter(3);
240
+
241
+ TestRepeatWithFilterForSuccessfulTests(3);
242
+
243
+ TestRepeatWithFilterForFailedTests(4);
244
+
245
+ // It would be nice to verify that the tests indeed loop forever
246
+ // when GTEST_FLAG(repeat) is negative, but this test will be quite
247
+ // complicated to write. Since this flag is for interactive
248
+ // debugging only and doesn't affect the normal test result, such a
249
+ // test would be an overkill.
250
+
251
+ printf("PASS\n");
252
+ return 0;
253
+ }
@@ -0,0 +1,325 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # Copyright 2009 Google Inc. All Rights Reserved.
4
+ #
5
+ # Redistribution and use in source and binary forms, with or without
6
+ # modification, are permitted provided that the following conditions are
7
+ # met:
8
+ #
9
+ # * Redistributions of source code must retain the above copyright
10
+ # notice, this list of conditions and the following disclaimer.
11
+ # * Redistributions in binary form must reproduce the above
12
+ # copyright notice, this list of conditions and the following disclaimer
13
+ # in the documentation and/or other materials provided with the
14
+ # distribution.
15
+ # * Neither the name of Google Inc. nor the names of its
16
+ # contributors may be used to endorse or promote products derived from
17
+ # this software without specific prior written permission.
18
+ #
19
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
+
31
+ """Verifies that test shuffling works."""
32
+
33
+ __author__ = 'wan@google.com (Zhanyong Wan)'
34
+
35
+ import os
36
+ import gtest_test_utils
37
+
38
+ # Command to run the gtest_shuffle_test_ program.
39
+ COMMAND = gtest_test_utils.GetTestExecutablePath('gtest_shuffle_test_')
40
+
41
+ # The environment variables for test sharding.
42
+ TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
43
+ SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX'
44
+
45
+ TEST_FILTER = 'A*.A:A*.B:C*'
46
+
47
+ ALL_TESTS = []
48
+ ACTIVE_TESTS = []
49
+ FILTERED_TESTS = []
50
+ SHARDED_TESTS = []
51
+
52
+ SHUFFLED_ALL_TESTS = []
53
+ SHUFFLED_ACTIVE_TESTS = []
54
+ SHUFFLED_FILTERED_TESTS = []
55
+ SHUFFLED_SHARDED_TESTS = []
56
+
57
+
58
+ def AlsoRunDisabledTestsFlag():
59
+ return '--gtest_also_run_disabled_tests'
60
+
61
+
62
+ def FilterFlag(test_filter):
63
+ return '--gtest_filter=%s' % (test_filter,)
64
+
65
+
66
+ def RepeatFlag(n):
67
+ return '--gtest_repeat=%s' % (n,)
68
+
69
+
70
+ def ShuffleFlag():
71
+ return '--gtest_shuffle'
72
+
73
+
74
+ def RandomSeedFlag(n):
75
+ return '--gtest_random_seed=%s' % (n,)
76
+
77
+
78
+ def RunAndReturnOutput(extra_env, args):
79
+ """Runs the test program and returns its output."""
80
+
81
+ environ_copy = os.environ.copy()
82
+ environ_copy.update(extra_env)
83
+
84
+ return gtest_test_utils.Subprocess([COMMAND] + args, env=environ_copy).output
85
+
86
+
87
+ def GetTestsForAllIterations(extra_env, args):
88
+ """Runs the test program and returns a list of test lists.
89
+
90
+ Args:
91
+ extra_env: a map from environment variables to their values
92
+ args: command line flags to pass to gtest_shuffle_test_
93
+
94
+ Returns:
95
+ A list where the i-th element is the list of tests run in the i-th
96
+ test iteration.
97
+ """
98
+
99
+ test_iterations = []
100
+ for line in RunAndReturnOutput(extra_env, args).split('\n'):
101
+ if line.startswith('----'):
102
+ tests = []
103
+ test_iterations.append(tests)
104
+ elif line.strip():
105
+ tests.append(line.strip()) # 'TestCaseName.TestName'
106
+
107
+ return test_iterations
108
+
109
+
110
+ def GetTestCases(tests):
111
+ """Returns a list of test cases in the given full test names.
112
+
113
+ Args:
114
+ tests: a list of full test names
115
+
116
+ Returns:
117
+ A list of test cases from 'tests', in their original order.
118
+ Consecutive duplicates are removed.
119
+ """
120
+
121
+ test_cases = []
122
+ for test in tests:
123
+ test_case = test.split('.')[0]
124
+ if not test_case in test_cases:
125
+ test_cases.append(test_case)
126
+
127
+ return test_cases
128
+
129
+
130
+ def CalculateTestLists():
131
+ """Calculates the list of tests run under different flags."""
132
+
133
+ if not ALL_TESTS:
134
+ ALL_TESTS.extend(
135
+ GetTestsForAllIterations({}, [AlsoRunDisabledTestsFlag()])[0])
136
+
137
+ if not ACTIVE_TESTS:
138
+ ACTIVE_TESTS.extend(GetTestsForAllIterations({}, [])[0])
139
+
140
+ if not FILTERED_TESTS:
141
+ FILTERED_TESTS.extend(
142
+ GetTestsForAllIterations({}, [FilterFlag(TEST_FILTER)])[0])
143
+
144
+ if not SHARDED_TESTS:
145
+ SHARDED_TESTS.extend(
146
+ GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
147
+ SHARD_INDEX_ENV_VAR: '1'},
148
+ [])[0])
149
+
150
+ if not SHUFFLED_ALL_TESTS:
151
+ SHUFFLED_ALL_TESTS.extend(GetTestsForAllIterations(
152
+ {}, [AlsoRunDisabledTestsFlag(), ShuffleFlag(), RandomSeedFlag(1)])[0])
153
+
154
+ if not SHUFFLED_ACTIVE_TESTS:
155
+ SHUFFLED_ACTIVE_TESTS.extend(GetTestsForAllIterations(
156
+ {}, [ShuffleFlag(), RandomSeedFlag(1)])[0])
157
+
158
+ if not SHUFFLED_FILTERED_TESTS:
159
+ SHUFFLED_FILTERED_TESTS.extend(GetTestsForAllIterations(
160
+ {}, [ShuffleFlag(), RandomSeedFlag(1), FilterFlag(TEST_FILTER)])[0])
161
+
162
+ if not SHUFFLED_SHARDED_TESTS:
163
+ SHUFFLED_SHARDED_TESTS.extend(
164
+ GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
165
+ SHARD_INDEX_ENV_VAR: '1'},
166
+ [ShuffleFlag(), RandomSeedFlag(1)])[0])
167
+
168
+
169
+ class GTestShuffleUnitTest(gtest_test_utils.TestCase):
170
+ """Tests test shuffling."""
171
+
172
+ def setUp(self):
173
+ CalculateTestLists()
174
+
175
+ def testShufflePreservesNumberOfTests(self):
176
+ self.assertEqual(len(ALL_TESTS), len(SHUFFLED_ALL_TESTS))
177
+ self.assertEqual(len(ACTIVE_TESTS), len(SHUFFLED_ACTIVE_TESTS))
178
+ self.assertEqual(len(FILTERED_TESTS), len(SHUFFLED_FILTERED_TESTS))
179
+ self.assertEqual(len(SHARDED_TESTS), len(SHUFFLED_SHARDED_TESTS))
180
+
181
+ def testShuffleChangesTestOrder(self):
182
+ self.assert_(SHUFFLED_ALL_TESTS != ALL_TESTS, SHUFFLED_ALL_TESTS)
183
+ self.assert_(SHUFFLED_ACTIVE_TESTS != ACTIVE_TESTS, SHUFFLED_ACTIVE_TESTS)
184
+ self.assert_(SHUFFLED_FILTERED_TESTS != FILTERED_TESTS,
185
+ SHUFFLED_FILTERED_TESTS)
186
+ self.assert_(SHUFFLED_SHARDED_TESTS != SHARDED_TESTS,
187
+ SHUFFLED_SHARDED_TESTS)
188
+
189
+ def testShuffleChangesTestCaseOrder(self):
190
+ self.assert_(GetTestCases(SHUFFLED_ALL_TESTS) != GetTestCases(ALL_TESTS),
191
+ GetTestCases(SHUFFLED_ALL_TESTS))
192
+ self.assert_(
193
+ GetTestCases(SHUFFLED_ACTIVE_TESTS) != GetTestCases(ACTIVE_TESTS),
194
+ GetTestCases(SHUFFLED_ACTIVE_TESTS))
195
+ self.assert_(
196
+ GetTestCases(SHUFFLED_FILTERED_TESTS) != GetTestCases(FILTERED_TESTS),
197
+ GetTestCases(SHUFFLED_FILTERED_TESTS))
198
+ self.assert_(
199
+ GetTestCases(SHUFFLED_SHARDED_TESTS) != GetTestCases(SHARDED_TESTS),
200
+ GetTestCases(SHUFFLED_SHARDED_TESTS))
201
+
202
+ def testShuffleDoesNotRepeatTest(self):
203
+ for test in SHUFFLED_ALL_TESTS:
204
+ self.assertEqual(1, SHUFFLED_ALL_TESTS.count(test),
205
+ '%s appears more than once' % (test,))
206
+ for test in SHUFFLED_ACTIVE_TESTS:
207
+ self.assertEqual(1, SHUFFLED_ACTIVE_TESTS.count(test),
208
+ '%s appears more than once' % (test,))
209
+ for test in SHUFFLED_FILTERED_TESTS:
210
+ self.assertEqual(1, SHUFFLED_FILTERED_TESTS.count(test),
211
+ '%s appears more than once' % (test,))
212
+ for test in SHUFFLED_SHARDED_TESTS:
213
+ self.assertEqual(1, SHUFFLED_SHARDED_TESTS.count(test),
214
+ '%s appears more than once' % (test,))
215
+
216
+ def testShuffleDoesNotCreateNewTest(self):
217
+ for test in SHUFFLED_ALL_TESTS:
218
+ self.assert_(test in ALL_TESTS, '%s is an invalid test' % (test,))
219
+ for test in SHUFFLED_ACTIVE_TESTS:
220
+ self.assert_(test in ACTIVE_TESTS, '%s is an invalid test' % (test,))
221
+ for test in SHUFFLED_FILTERED_TESTS:
222
+ self.assert_(test in FILTERED_TESTS, '%s is an invalid test' % (test,))
223
+ for test in SHUFFLED_SHARDED_TESTS:
224
+ self.assert_(test in SHARDED_TESTS, '%s is an invalid test' % (test,))
225
+
226
+ def testShuffleIncludesAllTests(self):
227
+ for test in ALL_TESTS:
228
+ self.assert_(test in SHUFFLED_ALL_TESTS, '%s is missing' % (test,))
229
+ for test in ACTIVE_TESTS:
230
+ self.assert_(test in SHUFFLED_ACTIVE_TESTS, '%s is missing' % (test,))
231
+ for test in FILTERED_TESTS:
232
+ self.assert_(test in SHUFFLED_FILTERED_TESTS, '%s is missing' % (test,))
233
+ for test in SHARDED_TESTS:
234
+ self.assert_(test in SHUFFLED_SHARDED_TESTS, '%s is missing' % (test,))
235
+
236
+ def testShuffleLeavesDeathTestsAtFront(self):
237
+ non_death_test_found = False
238
+ for test in SHUFFLED_ACTIVE_TESTS:
239
+ if 'DeathTest.' in test:
240
+ self.assert_(not non_death_test_found,
241
+ '%s appears after a non-death test' % (test,))
242
+ else:
243
+ non_death_test_found = True
244
+
245
+ def _VerifyTestCasesDoNotInterleave(self, tests):
246
+ test_cases = []
247
+ for test in tests:
248
+ [test_case, _] = test.split('.')
249
+ if test_cases and test_cases[-1] != test_case:
250
+ test_cases.append(test_case)
251
+ self.assertEqual(1, test_cases.count(test_case),
252
+ 'Test case %s is not grouped together in %s' %
253
+ (test_case, tests))
254
+
255
+ def testShuffleDoesNotInterleaveTestCases(self):
256
+ self._VerifyTestCasesDoNotInterleave(SHUFFLED_ALL_TESTS)
257
+ self._VerifyTestCasesDoNotInterleave(SHUFFLED_ACTIVE_TESTS)
258
+ self._VerifyTestCasesDoNotInterleave(SHUFFLED_FILTERED_TESTS)
259
+ self._VerifyTestCasesDoNotInterleave(SHUFFLED_SHARDED_TESTS)
260
+
261
+ def testShuffleRestoresOrderAfterEachIteration(self):
262
+ # Get the test lists in all 3 iterations, using random seed 1, 2,
263
+ # and 3 respectively. Google Test picks a different seed in each
264
+ # iteration, and this test depends on the current implementation
265
+ # picking successive numbers. This dependency is not ideal, but
266
+ # makes the test much easier to write.
267
+ [tests_in_iteration1, tests_in_iteration2, tests_in_iteration3] = (
268
+ GetTestsForAllIterations(
269
+ {}, [ShuffleFlag(), RandomSeedFlag(1), RepeatFlag(3)]))
270
+
271
+ # Make sure running the tests with random seed 1 gets the same
272
+ # order as in iteration 1 above.
273
+ [tests_with_seed1] = GetTestsForAllIterations(
274
+ {}, [ShuffleFlag(), RandomSeedFlag(1)])
275
+ self.assertEqual(tests_in_iteration1, tests_with_seed1)
276
+
277
+ # Make sure running the tests with random seed 2 gets the same
278
+ # order as in iteration 2 above. Success means that Google Test
279
+ # correctly restores the test order before re-shuffling at the
280
+ # beginning of iteration 2.
281
+ [tests_with_seed2] = GetTestsForAllIterations(
282
+ {}, [ShuffleFlag(), RandomSeedFlag(2)])
283
+ self.assertEqual(tests_in_iteration2, tests_with_seed2)
284
+
285
+ # Make sure running the tests with random seed 3 gets the same
286
+ # order as in iteration 3 above. Success means that Google Test
287
+ # correctly restores the test order before re-shuffling at the
288
+ # beginning of iteration 3.
289
+ [tests_with_seed3] = GetTestsForAllIterations(
290
+ {}, [ShuffleFlag(), RandomSeedFlag(3)])
291
+ self.assertEqual(tests_in_iteration3, tests_with_seed3)
292
+
293
+ def testShuffleGeneratesNewOrderInEachIteration(self):
294
+ [tests_in_iteration1, tests_in_iteration2, tests_in_iteration3] = (
295
+ GetTestsForAllIterations(
296
+ {}, [ShuffleFlag(), RandomSeedFlag(1), RepeatFlag(3)]))
297
+
298
+ self.assert_(tests_in_iteration1 != tests_in_iteration2,
299
+ tests_in_iteration1)
300
+ self.assert_(tests_in_iteration1 != tests_in_iteration3,
301
+ tests_in_iteration1)
302
+ self.assert_(tests_in_iteration2 != tests_in_iteration3,
303
+ tests_in_iteration2)
304
+
305
+ def testShuffleShardedTestsPreservesPartition(self):
306
+ # If we run M tests on N shards, the same M tests should be run in
307
+ # total, regardless of the random seeds used by the shards.
308
+ [tests1] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
309
+ SHARD_INDEX_ENV_VAR: '0'},
310
+ [ShuffleFlag(), RandomSeedFlag(1)])
311
+ [tests2] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
312
+ SHARD_INDEX_ENV_VAR: '1'},
313
+ [ShuffleFlag(), RandomSeedFlag(20)])
314
+ [tests3] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
315
+ SHARD_INDEX_ENV_VAR: '2'},
316
+ [ShuffleFlag(), RandomSeedFlag(25)])
317
+ sorted_sharded_tests = tests1 + tests2 + tests3
318
+ sorted_sharded_tests.sort()
319
+ sorted_active_tests = []
320
+ sorted_active_tests.extend(ACTIVE_TESTS)
321
+ sorted_active_tests.sort()
322
+ self.assertEqual(sorted_active_tests, sorted_sharded_tests)
323
+
324
+ if __name__ == '__main__':
325
+ gtest_test_utils.Main()