rj_schema 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
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,177 @@
1
+
2
+
3
+ <b>P</b>ump is <b>U</b>seful for <b>M</b>eta <b>P</b>rogramming.
4
+
5
+ # The Problem #
6
+
7
+ Template and macro libraries often need to define many classes,
8
+ functions, or macros that vary only (or almost only) in the number of
9
+ arguments they take. It's a lot of repetitive, mechanical, and
10
+ error-prone work.
11
+
12
+ Variadic templates and variadic macros can alleviate the problem.
13
+ However, while both are being considered by the C++ committee, neither
14
+ is in the standard yet or widely supported by compilers. Thus they
15
+ are often not a good choice, especially when your code needs to be
16
+ portable. And their capabilities are still limited.
17
+
18
+ As a result, authors of such libraries often have to write scripts to
19
+ generate their implementation. However, our experience is that it's
20
+ tedious to write such scripts, which tend to reflect the structure of
21
+ the generated code poorly and are often hard to read and edit. For
22
+ example, a small change needed in the generated code may require some
23
+ non-intuitive, non-trivial changes in the script. This is especially
24
+ painful when experimenting with the code.
25
+
26
+ # Our Solution #
27
+
28
+ Pump (for Pump is Useful for Meta Programming, Pretty Useful for Meta
29
+ Programming, or Practical Utility for Meta Programming, whichever you
30
+ prefer) is a simple meta-programming tool for C++. The idea is that a
31
+ programmer writes a `foo.pump` file which contains C++ code plus meta
32
+ code that manipulates the C++ code. The meta code can handle
33
+ iterations over a range, nested iterations, local meta variable
34
+ definitions, simple arithmetic, and conditional expressions. You can
35
+ view it as a small Domain-Specific Language. The meta language is
36
+ designed to be non-intrusive (s.t. it won't confuse Emacs' C++ mode,
37
+ for example) and concise, making Pump code intuitive and easy to
38
+ maintain.
39
+
40
+ ## Highlights ##
41
+
42
+ * The implementation is in a single Python script and thus ultra portable: no build or installation is needed and it works cross platforms.
43
+ * Pump tries to be smart with respect to [Google's style guide](http://code.google.com/p/google-styleguide/): it breaks long lines (easy to have when they are generated) at acceptable places to fit within 80 columns and indent the continuation lines correctly.
44
+ * The format is human-readable and more concise than XML.
45
+ * The format works relatively well with Emacs' C++ mode.
46
+
47
+ ## Examples ##
48
+
49
+ The following Pump code (where meta keywords start with `$`, `[[` and `]]` are meta brackets, and `$$` starts a meta comment that ends with the line):
50
+
51
+ ```
52
+ $var n = 3 $$ Defines a meta variable n.
53
+ $range i 0..n $$ Declares the range of meta iterator i (inclusive).
54
+ $for i [[
55
+ $$ Meta loop.
56
+ // Foo$i does blah for $i-ary predicates.
57
+ $range j 1..i
58
+ template <size_t N $for j [[, typename A$j]]>
59
+ class Foo$i {
60
+ $if i == 0 [[
61
+ blah a;
62
+ ]] $elif i <= 2 [[
63
+ blah b;
64
+ ]] $else [[
65
+ blah c;
66
+ ]]
67
+ };
68
+
69
+ ]]
70
+ ```
71
+
72
+ will be translated by the Pump compiler to:
73
+
74
+ ```
75
+ // Foo0 does blah for 0-ary predicates.
76
+ template <size_t N>
77
+ class Foo0 {
78
+ blah a;
79
+ };
80
+
81
+ // Foo1 does blah for 1-ary predicates.
82
+ template <size_t N, typename A1>
83
+ class Foo1 {
84
+ blah b;
85
+ };
86
+
87
+ // Foo2 does blah for 2-ary predicates.
88
+ template <size_t N, typename A1, typename A2>
89
+ class Foo2 {
90
+ blah b;
91
+ };
92
+
93
+ // Foo3 does blah for 3-ary predicates.
94
+ template <size_t N, typename A1, typename A2, typename A3>
95
+ class Foo3 {
96
+ blah c;
97
+ };
98
+ ```
99
+
100
+ In another example,
101
+
102
+ ```
103
+ $range i 1..n
104
+ Func($for i + [[a$i]]);
105
+ $$ The text between i and [[ is the separator between iterations.
106
+ ```
107
+
108
+ will generate one of the following lines (without the comments), depending on the value of `n`:
109
+
110
+ ```
111
+ Func(); // If n is 0.
112
+ Func(a1); // If n is 1.
113
+ Func(a1 + a2); // If n is 2.
114
+ Func(a1 + a2 + a3); // If n is 3.
115
+ // And so on...
116
+ ```
117
+
118
+ ## Constructs ##
119
+
120
+ We support the following meta programming constructs:
121
+
122
+ | `$var id = exp` | Defines a named constant value. `$id` is valid util the end of the current meta lexical block. |
123
+ |:----------------|:-----------------------------------------------------------------------------------------------|
124
+ | `$range id exp..exp` | Sets the range of an iteration variable, which can be reused in multiple loops later. |
125
+ | `$for id sep [[ code ]]` | Iteration. The range of `id` must have been defined earlier. `$id` is valid in `code`. |
126
+ | `$($)` | Generates a single `$` character. |
127
+ | `$id` | Value of the named constant or iteration variable. |
128
+ | `$(exp)` | Value of the expression. |
129
+ | `$if exp [[ code ]] else_branch` | Conditional. |
130
+ | `[[ code ]]` | Meta lexical block. |
131
+ | `cpp_code` | Raw C++ code. |
132
+ | `$$ comment` | Meta comment. |
133
+
134
+ **Note:** To give the user some freedom in formatting the Pump source
135
+ code, Pump ignores a new-line character if it's right after `$for foo`
136
+ or next to `[[` or `]]`. Without this rule you'll often be forced to write
137
+ very long lines to get the desired output. Therefore sometimes you may
138
+ need to insert an extra new-line in such places for a new-line to show
139
+ up in your output.
140
+
141
+ ## Grammar ##
142
+
143
+ ```
144
+ code ::= atomic_code*
145
+ atomic_code ::= $var id = exp
146
+ | $var id = [[ code ]]
147
+ | $range id exp..exp
148
+ | $for id sep [[ code ]]
149
+ | $($)
150
+ | $id
151
+ | $(exp)
152
+ | $if exp [[ code ]] else_branch
153
+ | [[ code ]]
154
+ | cpp_code
155
+ sep ::= cpp_code | empty_string
156
+ else_branch ::= $else [[ code ]]
157
+ | $elif exp [[ code ]] else_branch
158
+ | empty_string
159
+ exp ::= simple_expression_in_Python_syntax
160
+ ```
161
+
162
+ ## Code ##
163
+
164
+ You can find the source code of Pump in [scripts/pump.py](../scripts/pump.py). It is still
165
+ very unpolished and lacks automated tests, although it has been
166
+ successfully used many times. If you find a chance to use it in your
167
+ project, please let us know what you think! We also welcome help on
168
+ improving Pump.
169
+
170
+ ## Real Examples ##
171
+
172
+ You can find real-world applications of Pump in [Google Test](http://www.google.com/codesearch?q=file%3A\.pump%24+package%3Ahttp%3A%2F%2Fgoogletest\.googlecode\.com) and [Google Mock](http://www.google.com/codesearch?q=file%3A\.pump%24+package%3Ahttp%3A%2F%2Fgooglemock\.googlecode\.com). The source file `foo.h.pump` generates `foo.h`.
173
+
174
+ ## Tips ##
175
+
176
+ * If a meta variable is followed by a letter or digit, you can separate them using `[[]]`, which inserts an empty string. For example `Foo$j[[]]Helper` generate `Foo1Helper` when `j` is 1.
177
+ * To avoid extra-long Pump source lines, you can break a line anywhere you want by inserting `[[]]` followed by a new line. Since any new-line character next to `[[` or `]]` is ignored, the generated code won't contain this new line.
@@ -0,0 +1,14 @@
1
+ If you're like us, you'd like to look at some Google Test sample code. The
2
+ [samples folder](../samples) has a number of well-commented samples showing how to use a
3
+ variety of Google Test features.
4
+
5
+ * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions.
6
+ * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions.
7
+ * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture.
8
+ * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test.
9
+ * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it.
10
+ * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests.
11
+ * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests.
12
+ * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests.
13
+ * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results.
14
+ * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker.
@@ -0,0 +1,93 @@
1
+
2
+
3
+ This guide will explain how to use the Google Testing Framework in your Xcode projects on Mac OS X. This tutorial begins by quickly explaining what to do for experienced users. After the quick start, the guide goes provides additional explanation about each step.
4
+
5
+ # Quick Start #
6
+
7
+ Here is the quick guide for using Google Test in your Xcode project.
8
+
9
+ 1. Download the source from the [website](http://code.google.com/p/googletest) using this command: `svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only`
10
+ 1. Open up the `gtest.xcodeproj` in the `googletest-read-only/xcode/` directory and build the gtest.framework.
11
+ 1. Create a new "Shell Tool" target in your Xcode project called something like "UnitTests"
12
+ 1. Add the gtest.framework to your project and add it to the "Link Binary with Libraries" build phase of "UnitTests"
13
+ 1. Add your unit test source code to the "Compile Sources" build phase of "UnitTests"
14
+ 1. Edit the "UnitTests" executable and add an environment variable named "DYLD\_FRAMEWORK\_PATH" with a value equal to the path to the framework containing the gtest.framework relative to the compiled executable.
15
+ 1. Build and Go
16
+
17
+ The following sections further explain each of the steps listed above in depth, describing in more detail how to complete it including some variations.
18
+
19
+ # Get the Source #
20
+
21
+ Currently, the gtest.framework discussed here isn't available in a tagged release of Google Test, it is only available in the trunk. As explained at the Google Test [site](http://code.google.com/p/googletest/source/checkout">svn), you can get the code from anonymous SVN with this command:
22
+
23
+ ```
24
+ svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only
25
+ ```
26
+
27
+ Alternatively, if you are working with Subversion in your own code base, you can add Google Test as an external dependency to your own Subversion repository. By following this approach, everyone that checks out your svn repository will also receive a copy of Google Test (a specific version, if you wish) without having to check it out explicitly. This makes the set up of your project simpler and reduces the copied code in the repository.
28
+
29
+ To use `svn:externals`, decide where you would like to have the external source reside. You might choose to put the external source inside the trunk, because you want it to be part of the branch when you make a release. However, keeping it outside the trunk in a version-tagged directory called something like `third-party/googletest/1.0.1`, is another option. Once the location is established, use `svn propedit svn:externals _directory_` to set the svn:externals property on a directory in your repository. This directory won't contain the code, but be its versioned parent directory.
30
+
31
+ The command `svn propedit` will bring up your Subversion editor, making editing the long, (potentially multi-line) property simpler. This same method can be used to check out a tagged branch, by using the appropriate URL (e.g. `http://googletest.googlecode.com/svn/tags/release-1.0.1`). Additionally, the svn:externals property allows the specification of a particular revision of the trunk with the `-r_##_` option (e.g. `externals/src/googletest -r60 http://googletest.googlecode.com/svn/trunk`).
32
+
33
+ Here is an example of using the svn:externals properties on a trunk (read via `svn propget`) of a project. This value checks out a copy of Google Test into the `trunk/externals/src/googletest/` directory.
34
+
35
+ ```
36
+ [Computer:svn] user$ svn propget svn:externals trunk
37
+ externals/src/googletest http://googletest.googlecode.com/svn/trunk
38
+ ```
39
+
40
+ # Add the Framework to Your Project #
41
+
42
+ The next step is to build and add the gtest.framework to your own project. This guide describes two common ways below.
43
+
44
+ * **Option 1** --- The simplest way to add Google Test to your own project, is to open gtest.xcodeproj (found in the xcode/ directory of the Google Test trunk) and build the framework manually. Then, add the built framework into your project using the "Add->Existing Framework..." from the context menu or "Project->Add..." from the main menu. The gtest.framework is relocatable and contains the headers and object code that you'll need to make tests. This method requires rebuilding every time you upgrade Google Test in your project.
45
+ * **Option 2** --- If you are going to be living off the trunk of Google Test, incorporating its latest features into your unit tests (or are a Google Test developer yourself). You'll want to rebuild the framework every time the source updates. to do this, you'll need to add the gtest.xcodeproj file, not the framework itself, to your own Xcode project. Then, from the build products that are revealed by the project's disclosure triangle, you can find the gtest.framework, which can be added to your targets (discussed below).
46
+
47
+ # Make a Test Target #
48
+
49
+ To start writing tests, make a new "Shell Tool" target. This target template is available under BSD, Cocoa, or Carbon. Add your unit test source code to the "Compile Sources" build phase of the target.
50
+
51
+ Next, you'll want to add gtest.framework in two different ways, depending upon which option you chose above.
52
+
53
+ * **Option 1** --- During compilation, Xcode will need to know that you are linking against the gtest.framework. Add the gtest.framework to the "Link Binary with Libraries" build phase of your test target. This will include the Google Test headers in your header search path, and will tell the linker where to find the library.
54
+ * **Option 2** --- If your working out of the trunk, you'll also want to add gtest.framework to your "Link Binary with Libraries" build phase of your test target. In addition, you'll want to add the gtest.framework as a dependency to your unit test target. This way, Xcode will make sure that gtest.framework is up to date, every time your build your target. Finally, if you don't share build directories with Google Test, you'll have to copy the gtest.framework into your own build products directory using a "Run Script" build phase.
55
+
56
+ # Set Up the Executable Run Environment #
57
+
58
+ Since the unit test executable is a shell tool, it doesn't have a bundle with a `Contents/Frameworks` directory, in which to place gtest.framework. Instead, the dynamic linker must be told at runtime to search for the framework in another location. This can be accomplished by setting the "DYLD\_FRAMEWORK\_PATH" environment variable in the "Edit Active Executable ..." Arguments tab, under "Variables to be set in the environment:". The path for this value is the path (relative or absolute) of the directory containing the gtest.framework.
59
+
60
+ If you haven't set up the DYLD\_FRAMEWORK\_PATH, correctly, you might get a message like this:
61
+
62
+ ```
63
+ [Session started at 2008-08-15 06:23:57 -0600.]
64
+ dyld: Library not loaded: @loader_path/../Frameworks/gtest.framework/Versions/A/gtest
65
+ Referenced from: /Users/username/Documents/Sandbox/gtestSample/build/Debug/WidgetFrameworkTest
66
+ Reason: image not found
67
+ ```
68
+
69
+ To correct this problem, got to the directory containing the executable named in "Referenced from:" value in the error message above. Then, with the terminal in this location, find the relative path to the directory containing the gtest.framework. That is the value you'll need to set as the DYLD\_FRAMEWORK\_PATH.
70
+
71
+ # Build and Go #
72
+
73
+ Now, when you click "Build and Go", the test will be executed. Dumping out something like this:
74
+
75
+ ```
76
+ [Session started at 2008-08-06 06:36:13 -0600.]
77
+ [==========] Running 2 tests from 1 test case.
78
+ [----------] Global test environment set-up.
79
+ [----------] 2 tests from WidgetInitializerTest
80
+ [ RUN ] WidgetInitializerTest.TestConstructor
81
+ [ OK ] WidgetInitializerTest.TestConstructor
82
+ [ RUN ] WidgetInitializerTest.TestConversion
83
+ [ OK ] WidgetInitializerTest.TestConversion
84
+ [----------] Global test environment tear-down
85
+ [==========] 2 tests from 1 test case ran.
86
+ [ PASSED ] 2 tests.
87
+
88
+ The Debugger has exited with status 0.
89
+ ```
90
+
91
+ # Summary #
92
+
93
+ Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment.
@@ -0,0 +1,93 @@
1
+
2
+
3
+ This guide will explain how to use the Google Testing Framework in your Xcode projects on Mac OS X. This tutorial begins by quickly explaining what to do for experienced users. After the quick start, the guide goes provides additional explanation about each step.
4
+
5
+ # Quick Start #
6
+
7
+ Here is the quick guide for using Google Test in your Xcode project.
8
+
9
+ 1. Download the source from the [website](http://code.google.com/p/googletest) using this command: `svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only`
10
+ 1. Open up the `gtest.xcodeproj` in the `googletest-read-only/xcode/` directory and build the gtest.framework.
11
+ 1. Create a new "Shell Tool" target in your Xcode project called something like "UnitTests"
12
+ 1. Add the gtest.framework to your project and add it to the "Link Binary with Libraries" build phase of "UnitTests"
13
+ 1. Add your unit test source code to the "Compile Sources" build phase of "UnitTests"
14
+ 1. Edit the "UnitTests" executable and add an environment variable named "DYLD\_FRAMEWORK\_PATH" with a value equal to the path to the framework containing the gtest.framework relative to the compiled executable.
15
+ 1. Build and Go
16
+
17
+ The following sections further explain each of the steps listed above in depth, describing in more detail how to complete it including some variations.
18
+
19
+ # Get the Source #
20
+
21
+ Currently, the gtest.framework discussed here isn't available in a tagged release of Google Test, it is only available in the trunk. As explained at the Google Test [site](http://code.google.com/p/googletest/source/checkout">svn), you can get the code from anonymous SVN with this command:
22
+
23
+ ```
24
+ svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only
25
+ ```
26
+
27
+ Alternatively, if you are working with Subversion in your own code base, you can add Google Test as an external dependency to your own Subversion repository. By following this approach, everyone that checks out your svn repository will also receive a copy of Google Test (a specific version, if you wish) without having to check it out explicitly. This makes the set up of your project simpler and reduces the copied code in the repository.
28
+
29
+ To use `svn:externals`, decide where you would like to have the external source reside. You might choose to put the external source inside the trunk, because you want it to be part of the branch when you make a release. However, keeping it outside the trunk in a version-tagged directory called something like `third-party/googletest/1.0.1`, is another option. Once the location is established, use `svn propedit svn:externals _directory_` to set the svn:externals property on a directory in your repository. This directory won't contain the code, but be its versioned parent directory.
30
+
31
+ The command `svn propedit` will bring up your Subversion editor, making editing the long, (potentially multi-line) property simpler. This same method can be used to check out a tagged branch, by using the appropriate URL (e.g. `http://googletest.googlecode.com/svn/tags/release-1.0.1`). Additionally, the svn:externals property allows the specification of a particular revision of the trunk with the `-r_##_` option (e.g. `externals/src/googletest -r60 http://googletest.googlecode.com/svn/trunk`).
32
+
33
+ Here is an example of using the svn:externals properties on a trunk (read via `svn propget`) of a project. This value checks out a copy of Google Test into the `trunk/externals/src/googletest/` directory.
34
+
35
+ ```
36
+ [Computer:svn] user$ svn propget svn:externals trunk
37
+ externals/src/googletest http://googletest.googlecode.com/svn/trunk
38
+ ```
39
+
40
+ # Add the Framework to Your Project #
41
+
42
+ The next step is to build and add the gtest.framework to your own project. This guide describes two common ways below.
43
+
44
+ * **Option 1** --- The simplest way to add Google Test to your own project, is to open gtest.xcodeproj (found in the xcode/ directory of the Google Test trunk) and build the framework manually. Then, add the built framework into your project using the "Add->Existing Framework..." from the context menu or "Project->Add..." from the main menu. The gtest.framework is relocatable and contains the headers and object code that you'll need to make tests. This method requires rebuilding every time you upgrade Google Test in your project.
45
+ * **Option 2** --- If you are going to be living off the trunk of Google Test, incorporating its latest features into your unit tests (or are a Google Test developer yourself). You'll want to rebuild the framework every time the source updates. to do this, you'll need to add the gtest.xcodeproj file, not the framework itself, to your own Xcode project. Then, from the build products that are revealed by the project's disclosure triangle, you can find the gtest.framework, which can be added to your targets (discussed below).
46
+
47
+ # Make a Test Target #
48
+
49
+ To start writing tests, make a new "Shell Tool" target. This target template is available under BSD, Cocoa, or Carbon. Add your unit test source code to the "Compile Sources" build phase of the target.
50
+
51
+ Next, you'll want to add gtest.framework in two different ways, depending upon which option you chose above.
52
+
53
+ * **Option 1** --- During compilation, Xcode will need to know that you are linking against the gtest.framework. Add the gtest.framework to the "Link Binary with Libraries" build phase of your test target. This will include the Google Test headers in your header search path, and will tell the linker where to find the library.
54
+ * **Option 2** --- If your working out of the trunk, you'll also want to add gtest.framework to your "Link Binary with Libraries" build phase of your test target. In addition, you'll want to add the gtest.framework as a dependency to your unit test target. This way, Xcode will make sure that gtest.framework is up to date, every time your build your target. Finally, if you don't share build directories with Google Test, you'll have to copy the gtest.framework into your own build products directory using a "Run Script" build phase.
55
+
56
+ # Set Up the Executable Run Environment #
57
+
58
+ Since the unit test executable is a shell tool, it doesn't have a bundle with a `Contents/Frameworks` directory, in which to place gtest.framework. Instead, the dynamic linker must be told at runtime to search for the framework in another location. This can be accomplished by setting the "DYLD\_FRAMEWORK\_PATH" environment variable in the "Edit Active Executable ..." Arguments tab, under "Variables to be set in the environment:". The path for this value is the path (relative or absolute) of the directory containing the gtest.framework.
59
+
60
+ If you haven't set up the DYLD\_FRAMEWORK\_PATH, correctly, you might get a message like this:
61
+
62
+ ```
63
+ [Session started at 2008-08-15 06:23:57 -0600.]
64
+ dyld: Library not loaded: @loader_path/../Frameworks/gtest.framework/Versions/A/gtest
65
+ Referenced from: /Users/username/Documents/Sandbox/gtestSample/build/Debug/WidgetFrameworkTest
66
+ Reason: image not found
67
+ ```
68
+
69
+ To correct this problem, got to the directory containing the executable named in "Referenced from:" value in the error message above. Then, with the terminal in this location, find the relative path to the directory containing the gtest.framework. That is the value you'll need to set as the DYLD\_FRAMEWORK\_PATH.
70
+
71
+ # Build and Go #
72
+
73
+ Now, when you click "Build and Go", the test will be executed. Dumping out something like this:
74
+
75
+ ```
76
+ [Session started at 2008-08-06 06:36:13 -0600.]
77
+ [==========] Running 2 tests from 1 test case.
78
+ [----------] Global test environment set-up.
79
+ [----------] 2 tests from WidgetInitializerTest
80
+ [ RUN ] WidgetInitializerTest.TestConstructor
81
+ [ OK ] WidgetInitializerTest.TestConstructor
82
+ [ RUN ] WidgetInitializerTest.TestConversion
83
+ [ OK ] WidgetInitializerTest.TestConversion
84
+ [----------] Global test environment tear-down
85
+ [==========] 2 tests from 1 test case ran.
86
+ [ PASSED ] 2 tests.
87
+
88
+ The Debugger has exited with status 0.
89
+ ```
90
+
91
+ # Summary #
92
+
93
+ Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment.
@@ -0,0 +1,294 @@
1
+ // Copyright 2005, Google Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following disclaimer
12
+ // in the documentation and/or other materials provided with the
13
+ // distribution.
14
+ // * Neither the name of Google Inc. nor the names of its
15
+ // contributors may be used to endorse or promote products derived from
16
+ // this software without specific prior written permission.
17
+ //
18
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+ //
30
+ // Author: wan@google.com (Zhanyong Wan)
31
+ //
32
+ // The Google C++ Testing Framework (Google Test)
33
+ //
34
+ // This header file defines the public API for death tests. It is
35
+ // #included by gtest.h so a user doesn't need to include this
36
+ // directly.
37
+
38
+ #ifndef GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
39
+ #define GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
40
+
41
+ #include "gtest/internal/gtest-death-test-internal.h"
42
+
43
+ namespace testing {
44
+
45
+ // This flag controls the style of death tests. Valid values are "threadsafe",
46
+ // meaning that the death test child process will re-execute the test binary
47
+ // from the start, running only a single death test, or "fast",
48
+ // meaning that the child process will execute the test logic immediately
49
+ // after forking.
50
+ GTEST_DECLARE_string_(death_test_style);
51
+
52
+ #if GTEST_HAS_DEATH_TEST
53
+
54
+ namespace internal {
55
+
56
+ // Returns a Boolean value indicating whether the caller is currently
57
+ // executing in the context of the death test child process. Tools such as
58
+ // Valgrind heap checkers may need this to modify their behavior in death
59
+ // tests. IMPORTANT: This is an internal utility. Using it may break the
60
+ // implementation of death tests. User code MUST NOT use it.
61
+ GTEST_API_ bool InDeathTestChild();
62
+
63
+ } // namespace internal
64
+
65
+ // The following macros are useful for writing death tests.
66
+
67
+ // Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
68
+ // executed:
69
+ //
70
+ // 1. It generates a warning if there is more than one active
71
+ // thread. This is because it's safe to fork() or clone() only
72
+ // when there is a single thread.
73
+ //
74
+ // 2. The parent process clone()s a sub-process and runs the death
75
+ // test in it; the sub-process exits with code 0 at the end of the
76
+ // death test, if it hasn't exited already.
77
+ //
78
+ // 3. The parent process waits for the sub-process to terminate.
79
+ //
80
+ // 4. The parent process checks the exit code and error message of
81
+ // the sub-process.
82
+ //
83
+ // Examples:
84
+ //
85
+ // ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
86
+ // for (int i = 0; i < 5; i++) {
87
+ // EXPECT_DEATH(server.ProcessRequest(i),
88
+ // "Invalid request .* in ProcessRequest()")
89
+ // << "Failed to die on request " << i;
90
+ // }
91
+ //
92
+ // ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
93
+ //
94
+ // bool KilledBySIGHUP(int exit_code) {
95
+ // return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
96
+ // }
97
+ //
98
+ // ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
99
+ //
100
+ // On the regular expressions used in death tests:
101
+ //
102
+ // On POSIX-compliant systems (*nix), we use the <regex.h> library,
103
+ // which uses the POSIX extended regex syntax.
104
+ //
105
+ // On other platforms (e.g. Windows), we only support a simple regex
106
+ // syntax implemented as part of Google Test. This limited
107
+ // implementation should be enough most of the time when writing
108
+ // death tests; though it lacks many features you can find in PCRE
109
+ // or POSIX extended regex syntax. For example, we don't support
110
+ // union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
111
+ // repetition count ("x{5,7}"), among others.
112
+ //
113
+ // Below is the syntax that we do support. We chose it to be a
114
+ // subset of both PCRE and POSIX extended regex, so it's easy to
115
+ // learn wherever you come from. In the following: 'A' denotes a
116
+ // literal character, period (.), or a single \\ escape sequence;
117
+ // 'x' and 'y' denote regular expressions; 'm' and 'n' are for
118
+ // natural numbers.
119
+ //
120
+ // c matches any literal character c
121
+ // \\d matches any decimal digit
122
+ // \\D matches any character that's not a decimal digit
123
+ // \\f matches \f
124
+ // \\n matches \n
125
+ // \\r matches \r
126
+ // \\s matches any ASCII whitespace, including \n
127
+ // \\S matches any character that's not a whitespace
128
+ // \\t matches \t
129
+ // \\v matches \v
130
+ // \\w matches any letter, _, or decimal digit
131
+ // \\W matches any character that \\w doesn't match
132
+ // \\c matches any literal character c, which must be a punctuation
133
+ // . matches any single character except \n
134
+ // A? matches 0 or 1 occurrences of A
135
+ // A* matches 0 or many occurrences of A
136
+ // A+ matches 1 or many occurrences of A
137
+ // ^ matches the beginning of a string (not that of each line)
138
+ // $ matches the end of a string (not that of each line)
139
+ // xy matches x followed by y
140
+ //
141
+ // If you accidentally use PCRE or POSIX extended regex features
142
+ // not implemented by us, you will get a run-time failure. In that
143
+ // case, please try to rewrite your regular expression within the
144
+ // above syntax.
145
+ //
146
+ // This implementation is *not* meant to be as highly tuned or robust
147
+ // as a compiled regex library, but should perform well enough for a
148
+ // death test, which already incurs significant overhead by launching
149
+ // a child process.
150
+ //
151
+ // Known caveats:
152
+ //
153
+ // A "threadsafe" style death test obtains the path to the test
154
+ // program from argv[0] and re-executes it in the sub-process. For
155
+ // simplicity, the current implementation doesn't search the PATH
156
+ // when launching the sub-process. This means that the user must
157
+ // invoke the test program via a path that contains at least one
158
+ // path separator (e.g. path/to/foo_test and
159
+ // /absolute/path/to/bar_test are fine, but foo_test is not). This
160
+ // is rarely a problem as people usually don't put the test binary
161
+ // directory in PATH.
162
+ //
163
+ // TODO(wan@google.com): make thread-safe death tests search the PATH.
164
+
165
+ // Asserts that a given statement causes the program to exit, with an
166
+ // integer exit status that satisfies predicate, and emitting error output
167
+ // that matches regex.
168
+ # define ASSERT_EXIT(statement, predicate, regex) \
169
+ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_FATAL_FAILURE_)
170
+
171
+ // Like ASSERT_EXIT, but continues on to successive tests in the
172
+ // test case, if any:
173
+ # define EXPECT_EXIT(statement, predicate, regex) \
174
+ GTEST_DEATH_TEST_(statement, predicate, regex, GTEST_NONFATAL_FAILURE_)
175
+
176
+ // Asserts that a given statement causes the program to exit, either by
177
+ // explicitly exiting with a nonzero exit code or being killed by a
178
+ // signal, and emitting error output that matches regex.
179
+ # define ASSERT_DEATH(statement, regex) \
180
+ ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
181
+
182
+ // Like ASSERT_DEATH, but continues on to successive tests in the
183
+ // test case, if any:
184
+ # define EXPECT_DEATH(statement, regex) \
185
+ EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, regex)
186
+
187
+ // Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
188
+
189
+ // Tests that an exit code describes a normal exit with a given exit code.
190
+ class GTEST_API_ ExitedWithCode {
191
+ public:
192
+ explicit ExitedWithCode(int exit_code);
193
+ bool operator()(int exit_status) const;
194
+ private:
195
+ // No implementation - assignment is unsupported.
196
+ void operator=(const ExitedWithCode& other);
197
+
198
+ const int exit_code_;
199
+ };
200
+
201
+ # if !GTEST_OS_WINDOWS
202
+ // Tests that an exit code describes an exit due to termination by a
203
+ // given signal.
204
+ class GTEST_API_ KilledBySignal {
205
+ public:
206
+ explicit KilledBySignal(int signum);
207
+ bool operator()(int exit_status) const;
208
+ private:
209
+ const int signum_;
210
+ };
211
+ # endif // !GTEST_OS_WINDOWS
212
+
213
+ // EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
214
+ // The death testing framework causes this to have interesting semantics,
215
+ // since the sideeffects of the call are only visible in opt mode, and not
216
+ // in debug mode.
217
+ //
218
+ // In practice, this can be used to test functions that utilize the
219
+ // LOG(DFATAL) macro using the following style:
220
+ //
221
+ // int DieInDebugOr12(int* sideeffect) {
222
+ // if (sideeffect) {
223
+ // *sideeffect = 12;
224
+ // }
225
+ // LOG(DFATAL) << "death";
226
+ // return 12;
227
+ // }
228
+ //
229
+ // TEST(TestCase, TestDieOr12WorksInDgbAndOpt) {
230
+ // int sideeffect = 0;
231
+ // // Only asserts in dbg.
232
+ // EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
233
+ //
234
+ // #ifdef NDEBUG
235
+ // // opt-mode has sideeffect visible.
236
+ // EXPECT_EQ(12, sideeffect);
237
+ // #else
238
+ // // dbg-mode no visible sideeffect.
239
+ // EXPECT_EQ(0, sideeffect);
240
+ // #endif
241
+ // }
242
+ //
243
+ // This will assert that DieInDebugReturn12InOpt() crashes in debug
244
+ // mode, usually due to a DCHECK or LOG(DFATAL), but returns the
245
+ // appropriate fallback value (12 in this case) in opt mode. If you
246
+ // need to test that a function has appropriate side-effects in opt
247
+ // mode, include assertions against the side-effects. A general
248
+ // pattern for this is:
249
+ //
250
+ // EXPECT_DEBUG_DEATH({
251
+ // // Side-effects here will have an effect after this statement in
252
+ // // opt mode, but none in debug mode.
253
+ // EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
254
+ // }, "death");
255
+ //
256
+ # ifdef NDEBUG
257
+
258
+ # define EXPECT_DEBUG_DEATH(statement, regex) \
259
+ GTEST_EXECUTE_STATEMENT_(statement, regex)
260
+
261
+ # define ASSERT_DEBUG_DEATH(statement, regex) \
262
+ GTEST_EXECUTE_STATEMENT_(statement, regex)
263
+
264
+ # else
265
+
266
+ # define EXPECT_DEBUG_DEATH(statement, regex) \
267
+ EXPECT_DEATH(statement, regex)
268
+
269
+ # define ASSERT_DEBUG_DEATH(statement, regex) \
270
+ ASSERT_DEATH(statement, regex)
271
+
272
+ # endif // NDEBUG for EXPECT_DEBUG_DEATH
273
+ #endif // GTEST_HAS_DEATH_TEST
274
+
275
+ // EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
276
+ // ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
277
+ // death tests are supported; otherwise they just issue a warning. This is
278
+ // useful when you are combining death test assertions with normal test
279
+ // assertions in one test.
280
+ #if GTEST_HAS_DEATH_TEST
281
+ # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
282
+ EXPECT_DEATH(statement, regex)
283
+ # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
284
+ ASSERT_DEATH(statement, regex)
285
+ #else
286
+ # define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
287
+ GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, )
288
+ # define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
289
+ GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, return)
290
+ #endif
291
+
292
+ } // namespace testing
293
+
294
+ #endif // GTEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_