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,227 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # Copyright 2008 Google Inc. All Rights Reserved.
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ """Generate Google Mock classes from base classes.
18
+
19
+ This program will read in a C++ source file and output the Google Mock
20
+ classes for the specified classes. If no class is specified, all
21
+ classes in the source file are emitted.
22
+
23
+ Usage:
24
+ gmock_class.py header-file.h [ClassName]...
25
+
26
+ Output is sent to stdout.
27
+ """
28
+
29
+ __author__ = 'nnorwitz@google.com (Neal Norwitz)'
30
+
31
+
32
+ import os
33
+ import re
34
+ import sys
35
+
36
+ from cpp import ast
37
+ from cpp import utils
38
+
39
+ # Preserve compatibility with Python 2.3.
40
+ try:
41
+ _dummy = set
42
+ except NameError:
43
+ import sets
44
+ set = sets.Set
45
+
46
+ _VERSION = (1, 0, 1) # The version of this script.
47
+ # How many spaces to indent. Can set me with the INDENT environment variable.
48
+ _INDENT = 2
49
+
50
+
51
+ def _GenerateMethods(output_lines, source, class_node):
52
+ function_type = (ast.FUNCTION_VIRTUAL | ast.FUNCTION_PURE_VIRTUAL |
53
+ ast.FUNCTION_OVERRIDE)
54
+ ctor_or_dtor = ast.FUNCTION_CTOR | ast.FUNCTION_DTOR
55
+ indent = ' ' * _INDENT
56
+
57
+ for node in class_node.body:
58
+ # We only care about virtual functions.
59
+ if (isinstance(node, ast.Function) and
60
+ node.modifiers & function_type and
61
+ not node.modifiers & ctor_or_dtor):
62
+ # Pick out all the elements we need from the original function.
63
+ const = ''
64
+ if node.modifiers & ast.FUNCTION_CONST:
65
+ const = 'CONST_'
66
+ return_type = 'void'
67
+ if node.return_type:
68
+ # Add modifiers like 'const'.
69
+ modifiers = ''
70
+ if node.return_type.modifiers:
71
+ modifiers = ' '.join(node.return_type.modifiers) + ' '
72
+ return_type = modifiers + node.return_type.name
73
+ template_args = [arg.name for arg in node.return_type.templated_types]
74
+ if template_args:
75
+ return_type += '<' + ', '.join(template_args) + '>'
76
+ if len(template_args) > 1:
77
+ for line in [
78
+ '// The following line won\'t really compile, as the return',
79
+ '// type has multiple template arguments. To fix it, use a',
80
+ '// typedef for the return type.']:
81
+ output_lines.append(indent + line)
82
+ if node.return_type.pointer:
83
+ return_type += '*'
84
+ if node.return_type.reference:
85
+ return_type += '&'
86
+ num_parameters = len(node.parameters)
87
+ if len(node.parameters) == 1:
88
+ first_param = node.parameters[0]
89
+ if source[first_param.start:first_param.end].strip() == 'void':
90
+ # We must treat T(void) as a function with no parameters.
91
+ num_parameters = 0
92
+ tmpl = ''
93
+ if class_node.templated_types:
94
+ tmpl = '_T'
95
+ mock_method_macro = 'MOCK_%sMETHOD%d%s' % (const, num_parameters, tmpl)
96
+
97
+ args = ''
98
+ if node.parameters:
99
+ # Due to the parser limitations, it is impossible to keep comments
100
+ # while stripping the default parameters. When defaults are
101
+ # present, we choose to strip them and comments (and produce
102
+ # compilable code).
103
+ # TODO(nnorwitz@google.com): Investigate whether it is possible to
104
+ # preserve parameter name when reconstructing parameter text from
105
+ # the AST.
106
+ if len([param for param in node.parameters if param.default]) > 0:
107
+ args = ', '.join(param.type.name for param in node.parameters)
108
+ else:
109
+ # Get the full text of the parameters from the start
110
+ # of the first parameter to the end of the last parameter.
111
+ start = node.parameters[0].start
112
+ end = node.parameters[-1].end
113
+ # Remove // comments.
114
+ args_strings = re.sub(r'//.*', '', source[start:end])
115
+ # Condense multiple spaces and eliminate newlines putting the
116
+ # parameters together on a single line. Ensure there is a
117
+ # space in an argument which is split by a newline without
118
+ # intervening whitespace, e.g.: int\nBar
119
+ args = re.sub(' +', ' ', args_strings.replace('\n', ' '))
120
+
121
+ # Create the mock method definition.
122
+ output_lines.extend(['%s%s(%s,' % (indent, mock_method_macro, node.name),
123
+ '%s%s(%s));' % (indent*3, return_type, args)])
124
+
125
+
126
+ def _GenerateMocks(filename, source, ast_list, desired_class_names):
127
+ processed_class_names = set()
128
+ lines = []
129
+ for node in ast_list:
130
+ if (isinstance(node, ast.Class) and node.body and
131
+ # desired_class_names being None means that all classes are selected.
132
+ (not desired_class_names or node.name in desired_class_names)):
133
+ class_name = node.name
134
+ parent_name = class_name
135
+ processed_class_names.add(class_name)
136
+ class_node = node
137
+ # Add namespace before the class.
138
+ if class_node.namespace:
139
+ lines.extend(['namespace %s {' % n for n in class_node.namespace]) # }
140
+ lines.append('')
141
+
142
+ # Add template args for templated classes.
143
+ if class_node.templated_types:
144
+ # TODO(paulchang): The AST doesn't preserve template argument order,
145
+ # so we have to make up names here.
146
+ # TODO(paulchang): Handle non-type template arguments (e.g.
147
+ # template<typename T, int N>).
148
+ template_arg_count = len(class_node.templated_types.keys())
149
+ template_args = ['T%d' % n for n in range(template_arg_count)]
150
+ template_decls = ['typename ' + arg for arg in template_args]
151
+ lines.append('template <' + ', '.join(template_decls) + '>')
152
+ parent_name += '<' + ', '.join(template_args) + '>'
153
+
154
+ # Add the class prolog.
155
+ lines.append('class Mock%s : public %s {' # }
156
+ % (class_name, parent_name))
157
+ lines.append('%spublic:' % (' ' * (_INDENT // 2)))
158
+
159
+ # Add all the methods.
160
+ _GenerateMethods(lines, source, class_node)
161
+
162
+ # Close the class.
163
+ if lines:
164
+ # If there are no virtual methods, no need for a public label.
165
+ if len(lines) == 2:
166
+ del lines[-1]
167
+
168
+ # Only close the class if there really is a class.
169
+ lines.append('};')
170
+ lines.append('') # Add an extra newline.
171
+
172
+ # Close the namespace.
173
+ if class_node.namespace:
174
+ for i in range(len(class_node.namespace)-1, -1, -1):
175
+ lines.append('} // namespace %s' % class_node.namespace[i])
176
+ lines.append('') # Add an extra newline.
177
+
178
+ if desired_class_names:
179
+ missing_class_name_list = list(desired_class_names - processed_class_names)
180
+ if missing_class_name_list:
181
+ missing_class_name_list.sort()
182
+ sys.stderr.write('Class(es) not found in %s: %s\n' %
183
+ (filename, ', '.join(missing_class_name_list)))
184
+ elif not processed_class_names:
185
+ sys.stderr.write('No class found in %s\n' % filename)
186
+
187
+ return lines
188
+
189
+
190
+ def main(argv=sys.argv):
191
+ if len(argv) < 2:
192
+ sys.stderr.write('Google Mock Class Generator v%s\n\n' %
193
+ '.'.join(map(str, _VERSION)))
194
+ sys.stderr.write(__doc__)
195
+ return 1
196
+
197
+ global _INDENT
198
+ try:
199
+ _INDENT = int(os.environ['INDENT'])
200
+ except KeyError:
201
+ pass
202
+ except:
203
+ sys.stderr.write('Unable to use indent of %s\n' % os.environ.get('INDENT'))
204
+
205
+ filename = argv[1]
206
+ desired_class_names = None # None means all classes in the source file.
207
+ if len(argv) >= 3:
208
+ desired_class_names = set(argv[2:])
209
+ source = utils.ReadFile(filename)
210
+ if source is None:
211
+ return 1
212
+
213
+ builder = ast.BuilderFromSource(source, filename)
214
+ try:
215
+ entire_ast = filter(None, builder.Generate())
216
+ except KeyboardInterrupt:
217
+ return
218
+ except:
219
+ # An error message was already printed since we couldn't parse.
220
+ sys.exit(1)
221
+ else:
222
+ lines = _GenerateMocks(filename, source, entire_ast, desired_class_names)
223
+ sys.stdout.write('\n'.join(lines))
224
+
225
+
226
+ if __name__ == '__main__':
227
+ main(sys.argv)
@@ -0,0 +1,448 @@
1
+ #!/usr/bin/env python
2
+ #
3
+ # Copyright 2009 Neal Norwitz All Rights Reserved.
4
+ # Portions Copyright 2009 Google Inc. All Rights Reserved.
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License");
7
+ # you may not use this file except in compliance with the License.
8
+ # You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+
18
+ """Tests for gmock.scripts.generator.cpp.gmock_class."""
19
+
20
+ __author__ = 'nnorwitz@google.com (Neal Norwitz)'
21
+
22
+
23
+ import os
24
+ import sys
25
+ import unittest
26
+
27
+ # Allow the cpp imports below to work when run as a standalone script.
28
+ sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
29
+
30
+ from cpp import ast
31
+ from cpp import gmock_class
32
+
33
+
34
+ class TestCase(unittest.TestCase):
35
+ """Helper class that adds assert methods."""
36
+
37
+ def StripLeadingWhitespace(self, lines):
38
+ """Strip leading whitespace in each line in 'lines'."""
39
+ return '\n'.join([s.lstrip() for s in lines.split('\n')])
40
+
41
+ def assertEqualIgnoreLeadingWhitespace(self, expected_lines, lines):
42
+ """Specialized assert that ignores the indent level."""
43
+ self.assertEqual(expected_lines, self.StripLeadingWhitespace(lines))
44
+
45
+
46
+ class GenerateMethodsTest(TestCase):
47
+
48
+ def GenerateMethodSource(self, cpp_source):
49
+ """Convert C++ source to Google Mock output source lines."""
50
+ method_source_lines = []
51
+ # <test> is a pseudo-filename, it is not read or written.
52
+ builder = ast.BuilderFromSource(cpp_source, '<test>')
53
+ ast_list = list(builder.Generate())
54
+ gmock_class._GenerateMethods(method_source_lines, cpp_source, ast_list[0])
55
+ return '\n'.join(method_source_lines)
56
+
57
+ def testSimpleMethod(self):
58
+ source = """
59
+ class Foo {
60
+ public:
61
+ virtual int Bar();
62
+ };
63
+ """
64
+ self.assertEqualIgnoreLeadingWhitespace(
65
+ 'MOCK_METHOD0(Bar,\nint());',
66
+ self.GenerateMethodSource(source))
67
+
68
+ def testSimpleConstructorsAndDestructor(self):
69
+ source = """
70
+ class Foo {
71
+ public:
72
+ Foo();
73
+ Foo(int x);
74
+ Foo(const Foo& f);
75
+ Foo(Foo&& f);
76
+ ~Foo();
77
+ virtual int Bar() = 0;
78
+ };
79
+ """
80
+ # The constructors and destructor should be ignored.
81
+ self.assertEqualIgnoreLeadingWhitespace(
82
+ 'MOCK_METHOD0(Bar,\nint());',
83
+ self.GenerateMethodSource(source))
84
+
85
+ def testVirtualDestructor(self):
86
+ source = """
87
+ class Foo {
88
+ public:
89
+ virtual ~Foo();
90
+ virtual int Bar() = 0;
91
+ };
92
+ """
93
+ # The destructor should be ignored.
94
+ self.assertEqualIgnoreLeadingWhitespace(
95
+ 'MOCK_METHOD0(Bar,\nint());',
96
+ self.GenerateMethodSource(source))
97
+
98
+ def testExplicitlyDefaultedConstructorsAndDestructor(self):
99
+ source = """
100
+ class Foo {
101
+ public:
102
+ Foo() = default;
103
+ Foo(const Foo& f) = default;
104
+ Foo(Foo&& f) = default;
105
+ ~Foo() = default;
106
+ virtual int Bar() = 0;
107
+ };
108
+ """
109
+ # The constructors and destructor should be ignored.
110
+ self.assertEqualIgnoreLeadingWhitespace(
111
+ 'MOCK_METHOD0(Bar,\nint());',
112
+ self.GenerateMethodSource(source))
113
+
114
+ def testExplicitlyDeletedConstructorsAndDestructor(self):
115
+ source = """
116
+ class Foo {
117
+ public:
118
+ Foo() = delete;
119
+ Foo(const Foo& f) = delete;
120
+ Foo(Foo&& f) = delete;
121
+ ~Foo() = delete;
122
+ virtual int Bar() = 0;
123
+ };
124
+ """
125
+ # The constructors and destructor should be ignored.
126
+ self.assertEqualIgnoreLeadingWhitespace(
127
+ 'MOCK_METHOD0(Bar,\nint());',
128
+ self.GenerateMethodSource(source))
129
+
130
+ def testSimpleOverrideMethod(self):
131
+ source = """
132
+ class Foo {
133
+ public:
134
+ int Bar() override;
135
+ };
136
+ """
137
+ self.assertEqualIgnoreLeadingWhitespace(
138
+ 'MOCK_METHOD0(Bar,\nint());',
139
+ self.GenerateMethodSource(source))
140
+
141
+ def testSimpleConstMethod(self):
142
+ source = """
143
+ class Foo {
144
+ public:
145
+ virtual void Bar(bool flag) const;
146
+ };
147
+ """
148
+ self.assertEqualIgnoreLeadingWhitespace(
149
+ 'MOCK_CONST_METHOD1(Bar,\nvoid(bool flag));',
150
+ self.GenerateMethodSource(source))
151
+
152
+ def testExplicitVoid(self):
153
+ source = """
154
+ class Foo {
155
+ public:
156
+ virtual int Bar(void);
157
+ };
158
+ """
159
+ self.assertEqualIgnoreLeadingWhitespace(
160
+ 'MOCK_METHOD0(Bar,\nint(void));',
161
+ self.GenerateMethodSource(source))
162
+
163
+ def testStrangeNewlineInParameter(self):
164
+ source = """
165
+ class Foo {
166
+ public:
167
+ virtual void Bar(int
168
+ a) = 0;
169
+ };
170
+ """
171
+ self.assertEqualIgnoreLeadingWhitespace(
172
+ 'MOCK_METHOD1(Bar,\nvoid(int a));',
173
+ self.GenerateMethodSource(source))
174
+
175
+ def testDefaultParameters(self):
176
+ source = """
177
+ class Foo {
178
+ public:
179
+ virtual void Bar(int a, char c = 'x') = 0;
180
+ };
181
+ """
182
+ self.assertEqualIgnoreLeadingWhitespace(
183
+ 'MOCK_METHOD2(Bar,\nvoid(int, char));',
184
+ self.GenerateMethodSource(source))
185
+
186
+ def testMultipleDefaultParameters(self):
187
+ source = """
188
+ class Foo {
189
+ public:
190
+ virtual void Bar(int a = 42, char c = 'x') = 0;
191
+ };
192
+ """
193
+ self.assertEqualIgnoreLeadingWhitespace(
194
+ 'MOCK_METHOD2(Bar,\nvoid(int, char));',
195
+ self.GenerateMethodSource(source))
196
+
197
+ def testRemovesCommentsWhenDefaultsArePresent(self):
198
+ source = """
199
+ class Foo {
200
+ public:
201
+ virtual void Bar(int a = 42 /* a comment */,
202
+ char /* other comment */ c= 'x') = 0;
203
+ };
204
+ """
205
+ self.assertEqualIgnoreLeadingWhitespace(
206
+ 'MOCK_METHOD2(Bar,\nvoid(int, char));',
207
+ self.GenerateMethodSource(source))
208
+
209
+ def testDoubleSlashCommentsInParameterListAreRemoved(self):
210
+ source = """
211
+ class Foo {
212
+ public:
213
+ virtual void Bar(int a, // inline comments should be elided.
214
+ int b // inline comments should be elided.
215
+ ) const = 0;
216
+ };
217
+ """
218
+ self.assertEqualIgnoreLeadingWhitespace(
219
+ 'MOCK_CONST_METHOD2(Bar,\nvoid(int a, int b));',
220
+ self.GenerateMethodSource(source))
221
+
222
+ def testCStyleCommentsInParameterListAreNotRemoved(self):
223
+ # NOTE(nnorwitz): I'm not sure if it's the best behavior to keep these
224
+ # comments. Also note that C style comments after the last parameter
225
+ # are still elided.
226
+ source = """
227
+ class Foo {
228
+ public:
229
+ virtual const string& Bar(int /* keeper */, int b);
230
+ };
231
+ """
232
+ self.assertEqualIgnoreLeadingWhitespace(
233
+ 'MOCK_METHOD2(Bar,\nconst string&(int /* keeper */, int b));',
234
+ self.GenerateMethodSource(source))
235
+
236
+ def testArgsOfTemplateTypes(self):
237
+ source = """
238
+ class Foo {
239
+ public:
240
+ virtual int Bar(const vector<int>& v, map<int, string>* output);
241
+ };"""
242
+ self.assertEqualIgnoreLeadingWhitespace(
243
+ 'MOCK_METHOD2(Bar,\n'
244
+ 'int(const vector<int>& v, map<int, string>* output));',
245
+ self.GenerateMethodSource(source))
246
+
247
+ def testReturnTypeWithOneTemplateArg(self):
248
+ source = """
249
+ class Foo {
250
+ public:
251
+ virtual vector<int>* Bar(int n);
252
+ };"""
253
+ self.assertEqualIgnoreLeadingWhitespace(
254
+ 'MOCK_METHOD1(Bar,\nvector<int>*(int n));',
255
+ self.GenerateMethodSource(source))
256
+
257
+ def testReturnTypeWithManyTemplateArgs(self):
258
+ source = """
259
+ class Foo {
260
+ public:
261
+ virtual map<int, string> Bar();
262
+ };"""
263
+ # Comparing the comment text is brittle - we'll think of something
264
+ # better in case this gets annoying, but for now let's keep it simple.
265
+ self.assertEqualIgnoreLeadingWhitespace(
266
+ '// The following line won\'t really compile, as the return\n'
267
+ '// type has multiple template arguments. To fix it, use a\n'
268
+ '// typedef for the return type.\n'
269
+ 'MOCK_METHOD0(Bar,\nmap<int, string>());',
270
+ self.GenerateMethodSource(source))
271
+
272
+ def testSimpleMethodInTemplatedClass(self):
273
+ source = """
274
+ template<class T>
275
+ class Foo {
276
+ public:
277
+ virtual int Bar();
278
+ };
279
+ """
280
+ self.assertEqualIgnoreLeadingWhitespace(
281
+ 'MOCK_METHOD0_T(Bar,\nint());',
282
+ self.GenerateMethodSource(source))
283
+
284
+ def testPointerArgWithoutNames(self):
285
+ source = """
286
+ class Foo {
287
+ virtual int Bar(C*);
288
+ };
289
+ """
290
+ self.assertEqualIgnoreLeadingWhitespace(
291
+ 'MOCK_METHOD1(Bar,\nint(C*));',
292
+ self.GenerateMethodSource(source))
293
+
294
+ def testReferenceArgWithoutNames(self):
295
+ source = """
296
+ class Foo {
297
+ virtual int Bar(C&);
298
+ };
299
+ """
300
+ self.assertEqualIgnoreLeadingWhitespace(
301
+ 'MOCK_METHOD1(Bar,\nint(C&));',
302
+ self.GenerateMethodSource(source))
303
+
304
+ def testArrayArgWithoutNames(self):
305
+ source = """
306
+ class Foo {
307
+ virtual int Bar(C[]);
308
+ };
309
+ """
310
+ self.assertEqualIgnoreLeadingWhitespace(
311
+ 'MOCK_METHOD1(Bar,\nint(C[]));',
312
+ self.GenerateMethodSource(source))
313
+
314
+
315
+ class GenerateMocksTest(TestCase):
316
+
317
+ def GenerateMocks(self, cpp_source):
318
+ """Convert C++ source to complete Google Mock output source."""
319
+ # <test> is a pseudo-filename, it is not read or written.
320
+ filename = '<test>'
321
+ builder = ast.BuilderFromSource(cpp_source, filename)
322
+ ast_list = list(builder.Generate())
323
+ lines = gmock_class._GenerateMocks(filename, cpp_source, ast_list, None)
324
+ return '\n'.join(lines)
325
+
326
+ def testNamespaces(self):
327
+ source = """
328
+ namespace Foo {
329
+ namespace Bar { class Forward; }
330
+ namespace Baz {
331
+
332
+ class Test {
333
+ public:
334
+ virtual void Foo();
335
+ };
336
+
337
+ } // namespace Baz
338
+ } // namespace Foo
339
+ """
340
+ expected = """\
341
+ namespace Foo {
342
+ namespace Baz {
343
+
344
+ class MockTest : public Test {
345
+ public:
346
+ MOCK_METHOD0(Foo,
347
+ void());
348
+ };
349
+
350
+ } // namespace Baz
351
+ } // namespace Foo
352
+ """
353
+ self.assertEqualIgnoreLeadingWhitespace(
354
+ expected, self.GenerateMocks(source))
355
+
356
+ def testClassWithStorageSpecifierMacro(self):
357
+ source = """
358
+ class STORAGE_SPECIFIER Test {
359
+ public:
360
+ virtual void Foo();
361
+ };
362
+ """
363
+ expected = """\
364
+ class MockTest : public Test {
365
+ public:
366
+ MOCK_METHOD0(Foo,
367
+ void());
368
+ };
369
+ """
370
+ self.assertEqualIgnoreLeadingWhitespace(
371
+ expected, self.GenerateMocks(source))
372
+
373
+ def testTemplatedForwardDeclaration(self):
374
+ source = """
375
+ template <class T> class Forward; // Forward declaration should be ignored.
376
+ class Test {
377
+ public:
378
+ virtual void Foo();
379
+ };
380
+ """
381
+ expected = """\
382
+ class MockTest : public Test {
383
+ public:
384
+ MOCK_METHOD0(Foo,
385
+ void());
386
+ };
387
+ """
388
+ self.assertEqualIgnoreLeadingWhitespace(
389
+ expected, self.GenerateMocks(source))
390
+
391
+ def testTemplatedClass(self):
392
+ source = """
393
+ template <typename S, typename T>
394
+ class Test {
395
+ public:
396
+ virtual void Foo();
397
+ };
398
+ """
399
+ expected = """\
400
+ template <typename T0, typename T1>
401
+ class MockTest : public Test<T0, T1> {
402
+ public:
403
+ MOCK_METHOD0_T(Foo,
404
+ void());
405
+ };
406
+ """
407
+ self.assertEqualIgnoreLeadingWhitespace(
408
+ expected, self.GenerateMocks(source))
409
+
410
+ def testTemplateInATemplateTypedef(self):
411
+ source = """
412
+ class Test {
413
+ public:
414
+ typedef std::vector<std::list<int>> FooType;
415
+ virtual void Bar(const FooType& test_arg);
416
+ };
417
+ """
418
+ expected = """\
419
+ class MockTest : public Test {
420
+ public:
421
+ MOCK_METHOD1(Bar,
422
+ void(const FooType& test_arg));
423
+ };
424
+ """
425
+ self.assertEqualIgnoreLeadingWhitespace(
426
+ expected, self.GenerateMocks(source))
427
+
428
+ def testTemplateInATemplateTypedefWithComma(self):
429
+ source = """
430
+ class Test {
431
+ public:
432
+ typedef std::function<void(
433
+ const vector<std::list<int>>&, int> FooType;
434
+ virtual void Bar(const FooType& test_arg);
435
+ };
436
+ """
437
+ expected = """\
438
+ class MockTest : public Test {
439
+ public:
440
+ MOCK_METHOD1(Bar,
441
+ void(const FooType& test_arg));
442
+ };
443
+ """
444
+ self.assertEqualIgnoreLeadingWhitespace(
445
+ expected, self.GenerateMocks(source))
446
+
447
+ if __name__ == '__main__':
448
+ unittest.main()