rj_schema 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (614) hide show
  1. checksums.yaml +4 -4
  2. data/ext/rj_schema/rapidjson/CHANGELOG.md +158 -0
  3. data/ext/rj_schema/rapidjson/CMakeLists.txt +226 -0
  4. data/ext/rj_schema/rapidjson/CMakeModules/FindGTestSrc.cmake +30 -0
  5. data/ext/rj_schema/rapidjson/RapidJSON.pc.in +7 -0
  6. data/ext/rj_schema/rapidjson/RapidJSONConfig.cmake.in +25 -0
  7. data/ext/rj_schema/rapidjson/RapidJSONConfigVersion.cmake.in +10 -0
  8. data/ext/rj_schema/rapidjson/appveyor.yml +54 -0
  9. data/ext/rj_schema/rapidjson/bin/data/abcde.txt +1 -0
  10. data/ext/rj_schema/rapidjson/bin/data/glossary.json +22 -0
  11. data/ext/rj_schema/rapidjson/bin/data/menu.json +27 -0
  12. data/ext/rj_schema/rapidjson/bin/data/readme.txt +1 -0
  13. data/ext/rj_schema/rapidjson/bin/data/sample.json +3315 -0
  14. data/ext/rj_schema/rapidjson/bin/data/webapp.json +88 -0
  15. data/ext/rj_schema/rapidjson/bin/data/widget.json +26 -0
  16. data/ext/rj_schema/rapidjson/bin/draft-04/schema +150 -0
  17. data/ext/rj_schema/rapidjson/bin/encodings/utf16be.json +0 -0
  18. data/ext/rj_schema/rapidjson/bin/encodings/utf16bebom.json +0 -0
  19. data/ext/rj_schema/rapidjson/bin/encodings/utf16le.json +0 -0
  20. data/ext/rj_schema/rapidjson/bin/encodings/utf16lebom.json +0 -0
  21. data/ext/rj_schema/rapidjson/bin/encodings/utf32be.json +0 -0
  22. data/ext/rj_schema/rapidjson/bin/encodings/utf32bebom.json +0 -0
  23. data/ext/rj_schema/rapidjson/bin/encodings/utf32le.json +0 -0
  24. data/ext/rj_schema/rapidjson/bin/encodings/utf32lebom.json +0 -0
  25. data/ext/rj_schema/rapidjson/bin/encodings/utf8.json +7 -0
  26. data/ext/rj_schema/rapidjson/bin/encodings/utf8bom.json +7 -0
  27. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail1.json +1 -0
  28. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail10.json +1 -0
  29. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail11.json +1 -0
  30. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail12.json +1 -0
  31. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail13.json +1 -0
  32. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail14.json +1 -0
  33. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail15.json +1 -0
  34. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail16.json +1 -0
  35. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail17.json +1 -0
  36. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail18.json +1 -0
  37. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail19.json +1 -0
  38. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail2.json +1 -0
  39. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail20.json +1 -0
  40. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail21.json +1 -0
  41. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail22.json +1 -0
  42. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail23.json +1 -0
  43. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail24.json +1 -0
  44. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail25.json +1 -0
  45. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail26.json +1 -0
  46. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail27.json +2 -0
  47. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail28.json +2 -0
  48. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail29.json +1 -0
  49. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail3.json +1 -0
  50. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail30.json +1 -0
  51. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail31.json +1 -0
  52. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail32.json +1 -0
  53. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail33.json +1 -0
  54. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail4.json +1 -0
  55. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail5.json +1 -0
  56. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail6.json +1 -0
  57. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail7.json +1 -0
  58. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail8.json +1 -0
  59. data/ext/rj_schema/rapidjson/bin/jsonchecker/fail9.json +1 -0
  60. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass1.json +58 -0
  61. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass2.json +1 -0
  62. data/ext/rj_schema/rapidjson/bin/jsonchecker/pass3.json +6 -0
  63. data/ext/rj_schema/rapidjson/bin/jsonchecker/readme.txt +3 -0
  64. data/ext/rj_schema/rapidjson/bin/jsonschema/LICENSE +19 -0
  65. data/ext/rj_schema/rapidjson/bin/jsonschema/README.md +148 -0
  66. data/ext/rj_schema/rapidjson/bin/jsonschema/bin/jsonschema_suite +283 -0
  67. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json +3 -0
  68. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/integer.json +3 -0
  69. data/ext/rj_schema/rapidjson/bin/jsonschema/remotes/subSchemas.json +8 -0
  70. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json +82 -0
  71. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json +88 -0
  72. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/default.json +49 -0
  73. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/dependencies.json +108 -0
  74. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/disallow.json +80 -0
  75. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json +60 -0
  76. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/enum.json +71 -0
  77. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/extends.json +94 -0
  78. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/items.json +46 -0
  79. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxItems.json +28 -0
  80. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maxLength.json +33 -0
  81. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/maximum.json +42 -0
  82. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minItems.json +28 -0
  83. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minLength.json +33 -0
  84. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/minimum.json +42 -0
  85. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json +107 -0
  86. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/format.json +222 -0
  87. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json +18 -0
  88. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json +15 -0
  89. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/pattern.json +34 -0
  90. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json +110 -0
  91. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/properties.json +92 -0
  92. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/ref.json +159 -0
  93. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/refRemote.json +74 -0
  94. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/required.json +53 -0
  95. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/type.json +474 -0
  96. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json +79 -0
  97. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json +82 -0
  98. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json +88 -0
  99. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/allOf.json +112 -0
  100. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/anyOf.json +68 -0
  101. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/default.json +49 -0
  102. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/definitions.json +32 -0
  103. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/dependencies.json +113 -0
  104. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/enum.json +72 -0
  105. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/items.json +46 -0
  106. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxItems.json +28 -0
  107. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxLength.json +33 -0
  108. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json +28 -0
  109. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/maximum.json +42 -0
  110. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minItems.json +28 -0
  111. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minLength.json +33 -0
  112. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minProperties.json +28 -0
  113. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/minimum.json +42 -0
  114. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json +60 -0
  115. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/not.json +96 -0
  116. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/oneOf.json +68 -0
  117. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json +107 -0
  118. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/format.json +148 -0
  119. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json +15 -0
  120. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/pattern.json +34 -0
  121. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json +110 -0
  122. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/properties.json +92 -0
  123. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/ref.json +159 -0
  124. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/refRemote.json +74 -0
  125. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/required.json +39 -0
  126. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/type.json +330 -0
  127. data/ext/rj_schema/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json +79 -0
  128. data/ext/rj_schema/rapidjson/bin/jsonschema/tox.ini +8 -0
  129. data/ext/rj_schema/rapidjson/bin/types/booleans.json +102 -0
  130. data/ext/rj_schema/rapidjson/bin/types/floats.json +102 -0
  131. data/ext/rj_schema/rapidjson/bin/types/guids.json +102 -0
  132. data/ext/rj_schema/rapidjson/bin/types/integers.json +102 -0
  133. data/ext/rj_schema/rapidjson/bin/types/mixed.json +592 -0
  134. data/ext/rj_schema/rapidjson/bin/types/nulls.json +102 -0
  135. data/ext/rj_schema/rapidjson/bin/types/paragraphs.json +102 -0
  136. data/ext/rj_schema/rapidjson/bin/types/readme.txt +1 -0
  137. data/ext/rj_schema/rapidjson/contrib/natvis/LICENSE +45 -0
  138. data/ext/rj_schema/rapidjson/contrib/natvis/README.md +7 -0
  139. data/ext/rj_schema/rapidjson/contrib/natvis/rapidjson.natvis +38 -0
  140. data/ext/rj_schema/rapidjson/doc/CMakeLists.txt +27 -0
  141. data/ext/rj_schema/rapidjson/doc/Doxyfile.in +2369 -0
  142. data/ext/rj_schema/rapidjson/doc/Doxyfile.zh-cn.in +2369 -0
  143. data/ext/rj_schema/rapidjson/doc/diagram/architecture.dot +50 -0
  144. data/ext/rj_schema/rapidjson/doc/diagram/architecture.png +0 -0
  145. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.dot +65 -0
  146. data/ext/rj_schema/rapidjson/doc/diagram/insituparsing.png +0 -0
  147. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +62 -0
  148. data/ext/rj_schema/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
  149. data/ext/rj_schema/rapidjson/doc/diagram/makefile +8 -0
  150. data/ext/rj_schema/rapidjson/doc/diagram/move1.dot +47 -0
  151. data/ext/rj_schema/rapidjson/doc/diagram/move1.png +0 -0
  152. data/ext/rj_schema/rapidjson/doc/diagram/move2.dot +62 -0
  153. data/ext/rj_schema/rapidjson/doc/diagram/move2.png +0 -0
  154. data/ext/rj_schema/rapidjson/doc/diagram/move3.dot +60 -0
  155. data/ext/rj_schema/rapidjson/doc/diagram/move3.png +0 -0
  156. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.dot +56 -0
  157. data/ext/rj_schema/rapidjson/doc/diagram/normalparsing.png +0 -0
  158. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.dot +54 -0
  159. data/ext/rj_schema/rapidjson/doc/diagram/simpledom.png +0 -0
  160. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.dot +58 -0
  161. data/ext/rj_schema/rapidjson/doc/diagram/tutorial.png +0 -0
  162. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.dot +73 -0
  163. data/ext/rj_schema/rapidjson/doc/diagram/utilityclass.png +0 -0
  164. data/ext/rj_schema/rapidjson/doc/dom.md +281 -0
  165. data/ext/rj_schema/rapidjson/doc/dom.zh-cn.md +285 -0
  166. data/ext/rj_schema/rapidjson/doc/encoding.md +146 -0
  167. data/ext/rj_schema/rapidjson/doc/encoding.zh-cn.md +152 -0
  168. data/ext/rj_schema/rapidjson/doc/faq.md +289 -0
  169. data/ext/rj_schema/rapidjson/doc/faq.zh-cn.md +290 -0
  170. data/ext/rj_schema/rapidjson/doc/features.md +104 -0
  171. data/ext/rj_schema/rapidjson/doc/features.zh-cn.md +103 -0
  172. data/ext/rj_schema/rapidjson/doc/internals.md +368 -0
  173. data/ext/rj_schema/rapidjson/doc/internals.zh-cn.md +363 -0
  174. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.png +0 -0
  175. data/ext/rj_schema/rapidjson/doc/logo/rapidjson.svg +119 -0
  176. data/ext/rj_schema/rapidjson/doc/misc/DoxygenLayout.xml +194 -0
  177. data/ext/rj_schema/rapidjson/doc/misc/doxygenextra.css +274 -0
  178. data/ext/rj_schema/rapidjson/doc/misc/footer.html +11 -0
  179. data/ext/rj_schema/rapidjson/doc/misc/header.html +24 -0
  180. data/ext/rj_schema/rapidjson/doc/npm.md +31 -0
  181. data/ext/rj_schema/rapidjson/doc/performance.md +26 -0
  182. data/ext/rj_schema/rapidjson/doc/performance.zh-cn.md +26 -0
  183. data/ext/rj_schema/rapidjson/doc/pointer.md +234 -0
  184. data/ext/rj_schema/rapidjson/doc/pointer.zh-cn.md +234 -0
  185. data/ext/rj_schema/rapidjson/doc/sax.md +509 -0
  186. data/ext/rj_schema/rapidjson/doc/sax.zh-cn.md +487 -0
  187. data/ext/rj_schema/rapidjson/doc/schema.md +505 -0
  188. data/ext/rj_schema/rapidjson/doc/schema.zh-cn.md +237 -0
  189. data/ext/rj_schema/rapidjson/doc/stream.md +429 -0
  190. data/ext/rj_schema/rapidjson/doc/stream.zh-cn.md +429 -0
  191. data/ext/rj_schema/rapidjson/doc/tutorial.md +536 -0
  192. data/ext/rj_schema/rapidjson/doc/tutorial.zh-cn.md +535 -0
  193. data/ext/rj_schema/rapidjson/docker/debian/Dockerfile +8 -0
  194. data/ext/rj_schema/rapidjson/example/CMakeLists.txt +46 -0
  195. data/ext/rj_schema/rapidjson/example/archiver/archiver.cpp +292 -0
  196. data/ext/rj_schema/rapidjson/example/archiver/archiver.h +145 -0
  197. data/ext/rj_schema/rapidjson/example/archiver/archivertest.cpp +287 -0
  198. data/ext/rj_schema/rapidjson/example/capitalize/capitalize.cpp +67 -0
  199. data/ext/rj_schema/rapidjson/example/condense/condense.cpp +32 -0
  200. data/ext/rj_schema/rapidjson/example/filterkey/filterkey.cpp +135 -0
  201. data/ext/rj_schema/rapidjson/example/filterkeydom/filterkeydom.cpp +170 -0
  202. data/ext/rj_schema/rapidjson/example/jsonx/jsonx.cpp +207 -0
  203. data/ext/rj_schema/rapidjson/example/lookaheadparser/lookaheadparser.cpp +350 -0
  204. data/ext/rj_schema/rapidjson/example/messagereader/messagereader.cpp +105 -0
  205. data/ext/rj_schema/rapidjson/example/parsebyparts/parsebyparts.cpp +176 -0
  206. data/ext/rj_schema/rapidjson/example/pretty/pretty.cpp +30 -0
  207. data/ext/rj_schema/rapidjson/example/prettyauto/prettyauto.cpp +56 -0
  208. data/ext/rj_schema/rapidjson/example/schemavalidator/schemavalidator.cpp +78 -0
  209. data/ext/rj_schema/rapidjson/example/serialize/serialize.cpp +173 -0
  210. data/ext/rj_schema/rapidjson/example/simpledom/simpledom.cpp +29 -0
  211. data/ext/rj_schema/rapidjson/example/simplepullreader/simplepullreader.cpp +53 -0
  212. data/ext/rj_schema/rapidjson/example/simplereader/simplereader.cpp +42 -0
  213. data/ext/rj_schema/rapidjson/example/simplewriter/simplewriter.cpp +36 -0
  214. data/ext/rj_schema/rapidjson/example/sortkeys/sortkeys.cpp +62 -0
  215. data/ext/rj_schema/rapidjson/example/tutorial/tutorial.cpp +151 -0
  216. data/ext/rj_schema/rapidjson/include/rapidjson/allocators.h +284 -0
  217. data/ext/rj_schema/rapidjson/include/rapidjson/cursorstreamwrapper.h +78 -0
  218. data/ext/rj_schema/rapidjson/include/rapidjson/document.h +2732 -0
  219. data/ext/rj_schema/rapidjson/include/rapidjson/encodedstream.h +299 -0
  220. data/ext/rj_schema/rapidjson/include/rapidjson/encodings.h +716 -0
  221. data/ext/rj_schema/rapidjson/include/rapidjson/error/en.h +74 -0
  222. data/ext/rj_schema/rapidjson/include/rapidjson/error/error.h +161 -0
  223. data/ext/rj_schema/rapidjson/include/rapidjson/filereadstream.h +99 -0
  224. data/ext/rj_schema/rapidjson/include/rapidjson/filewritestream.h +104 -0
  225. data/ext/rj_schema/rapidjson/include/rapidjson/fwd.h +151 -0
  226. data/ext/rj_schema/rapidjson/include/rapidjson/internal/biginteger.h +290 -0
  227. data/ext/rj_schema/rapidjson/include/rapidjson/internal/clzll.h +71 -0
  228. data/ext/rj_schema/rapidjson/include/rapidjson/internal/diyfp.h +257 -0
  229. data/ext/rj_schema/rapidjson/include/rapidjson/internal/dtoa.h +245 -0
  230. data/ext/rj_schema/rapidjson/include/rapidjson/internal/ieee754.h +78 -0
  231. data/ext/rj_schema/rapidjson/include/rapidjson/internal/itoa.h +308 -0
  232. data/ext/rj_schema/rapidjson/include/rapidjson/internal/meta.h +186 -0
  233. data/ext/rj_schema/rapidjson/include/rapidjson/internal/pow10.h +55 -0
  234. data/ext/rj_schema/rapidjson/include/rapidjson/internal/regex.h +739 -0
  235. data/ext/rj_schema/rapidjson/include/rapidjson/internal/stack.h +232 -0
  236. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strfunc.h +69 -0
  237. data/ext/rj_schema/rapidjson/include/rapidjson/internal/strtod.h +290 -0
  238. data/ext/rj_schema/rapidjson/include/rapidjson/internal/swap.h +46 -0
  239. data/ext/rj_schema/rapidjson/include/rapidjson/istreamwrapper.h +128 -0
  240. data/ext/rj_schema/rapidjson/include/rapidjson/memorybuffer.h +70 -0
  241. data/ext/rj_schema/rapidjson/include/rapidjson/memorystream.h +71 -0
  242. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/inttypes.h +316 -0
  243. data/ext/rj_schema/rapidjson/include/rapidjson/msinttypes/stdint.h +300 -0
  244. data/ext/rj_schema/rapidjson/include/rapidjson/ostreamwrapper.h +81 -0
  245. data/ext/rj_schema/rapidjson/include/rapidjson/pointer.h +1415 -0
  246. data/ext/rj_schema/rapidjson/include/rapidjson/prettywriter.h +277 -0
  247. data/ext/rj_schema/rapidjson/include/rapidjson/rapidjson.h +676 -0
  248. data/ext/rj_schema/rapidjson/include/rapidjson/reader.h +2236 -0
  249. data/ext/rj_schema/rapidjson/include/rapidjson/schema.h +2496 -0
  250. data/ext/rj_schema/rapidjson/include/rapidjson/stream.h +223 -0
  251. data/ext/rj_schema/rapidjson/include/rapidjson/stringbuffer.h +121 -0
  252. data/ext/rj_schema/rapidjson/include/rapidjson/writer.h +710 -0
  253. data/ext/rj_schema/rapidjson/include_dirs.js +2 -0
  254. data/ext/rj_schema/rapidjson/library.json +15 -0
  255. data/ext/rj_schema/rapidjson/license.txt +57 -0
  256. data/ext/rj_schema/rapidjson/package.json +24 -0
  257. data/ext/rj_schema/rapidjson/rapidjson.autopkg +77 -0
  258. data/ext/rj_schema/rapidjson/readme.md +210 -0
  259. data/ext/rj_schema/rapidjson/readme.zh-cn.md +152 -0
  260. data/ext/rj_schema/rapidjson/test/CMakeLists.txt +20 -0
  261. data/ext/rj_schema/rapidjson/test/perftest/CMakeLists.txt +28 -0
  262. data/ext/rj_schema/rapidjson/test/perftest/misctest.cpp +974 -0
  263. data/ext/rj_schema/rapidjson/test/perftest/perftest.cpp +24 -0
  264. data/ext/rj_schema/rapidjson/test/perftest/perftest.h +185 -0
  265. data/ext/rj_schema/rapidjson/test/perftest/platformtest.cpp +166 -0
  266. data/ext/rj_schema/rapidjson/test/perftest/rapidjsontest.cpp +546 -0
  267. data/ext/rj_schema/rapidjson/test/perftest/schematest.cpp +223 -0
  268. data/ext/rj_schema/rapidjson/test/unittest/CMakeLists.txt +92 -0
  269. data/ext/rj_schema/rapidjson/test/unittest/allocatorstest.cpp +100 -0
  270. data/ext/rj_schema/rapidjson/test/unittest/bigintegertest.cpp +138 -0
  271. data/ext/rj_schema/rapidjson/test/unittest/cursorstreamwrappertest.cpp +115 -0
  272. data/ext/rj_schema/rapidjson/test/unittest/documenttest.cpp +672 -0
  273. data/ext/rj_schema/rapidjson/test/unittest/dtoatest.cpp +98 -0
  274. data/ext/rj_schema/rapidjson/test/unittest/encodedstreamtest.cpp +313 -0
  275. data/ext/rj_schema/rapidjson/test/unittest/encodingstest.cpp +451 -0
  276. data/ext/rj_schema/rapidjson/test/unittest/filestreamtest.cpp +155 -0
  277. data/ext/rj_schema/rapidjson/test/unittest/fwdtest.cpp +230 -0
  278. data/ext/rj_schema/rapidjson/test/unittest/istreamwrappertest.cpp +181 -0
  279. data/ext/rj_schema/rapidjson/test/unittest/itoatest.cpp +160 -0
  280. data/ext/rj_schema/rapidjson/test/unittest/jsoncheckertest.cpp +143 -0
  281. data/ext/rj_schema/rapidjson/test/unittest/namespacetest.cpp +70 -0
  282. data/ext/rj_schema/rapidjson/test/unittest/ostreamwrappertest.cpp +92 -0
  283. data/ext/rj_schema/rapidjson/test/unittest/pointertest.cpp +1638 -0
  284. data/ext/rj_schema/rapidjson/test/unittest/prettywritertest.cpp +373 -0
  285. data/ext/rj_schema/rapidjson/test/unittest/readertest.cpp +2225 -0
  286. data/ext/rj_schema/rapidjson/test/unittest/regextest.cpp +639 -0
  287. data/ext/rj_schema/rapidjson/test/unittest/schematest.cpp +2072 -0
  288. data/ext/rj_schema/rapidjson/test/unittest/simdtest.cpp +219 -0
  289. data/ext/rj_schema/rapidjson/test/unittest/strfunctest.cpp +30 -0
  290. data/ext/rj_schema/rapidjson/test/unittest/stringbuffertest.cpp +192 -0
  291. data/ext/rj_schema/rapidjson/test/unittest/strtodtest.cpp +132 -0
  292. data/ext/rj_schema/rapidjson/test/unittest/unittest.cpp +51 -0
  293. data/ext/rj_schema/rapidjson/test/unittest/unittest.h +143 -0
  294. data/ext/rj_schema/rapidjson/test/unittest/valuetest.cpp +1851 -0
  295. data/ext/rj_schema/rapidjson/test/unittest/writertest.cpp +598 -0
  296. data/ext/rj_schema/rapidjson/test/valgrind.supp +17 -0
  297. data/ext/rj_schema/rapidjson/thirdparty/gtest/BUILD.bazel +175 -0
  298. data/ext/rj_schema/rapidjson/thirdparty/gtest/CMakeLists.txt +33 -0
  299. data/ext/rj_schema/rapidjson/thirdparty/gtest/CONTRIBUTING.md +160 -0
  300. data/ext/rj_schema/rapidjson/thirdparty/gtest/LICENSE +28 -0
  301. data/ext/rj_schema/rapidjson/thirdparty/gtest/Makefile.am +14 -0
  302. data/ext/rj_schema/rapidjson/thirdparty/gtest/README.md +122 -0
  303. data/ext/rj_schema/rapidjson/thirdparty/gtest/WORKSPACE +8 -0
  304. data/ext/rj_schema/rapidjson/thirdparty/gtest/appveyor.yml +104 -0
  305. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +44 -0
  306. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +36 -0
  307. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-linux.sh +41 -0
  308. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/env-osx.sh +40 -0
  309. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +48 -0
  310. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-linux.sh +49 -0
  311. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/install-osx.sh +39 -0
  312. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/log-config.sh +51 -0
  313. data/ext/rj_schema/rapidjson/thirdparty/gtest/ci/travis.sh +44 -0
  314. data/ext/rj_schema/rapidjson/thirdparty/gtest/configure.ac +16 -0
  315. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CHANGES +126 -0
  316. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +242 -0
  317. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +40 -0
  318. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/LICENSE +28 -0
  319. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/Makefile.am +224 -0
  320. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/README.md +344 -0
  321. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +9 -0
  322. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +9 -0
  323. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/configure.ac +146 -0
  324. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +564 -0
  325. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +3660 -0
  326. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +280 -0
  327. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +15 -0
  328. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +447 -0
  329. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +627 -0
  330. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +19 -0
  331. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +1262 -0
  332. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +147 -0
  333. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +2571 -0
  334. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +833 -0
  335. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +1379 -0
  336. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +347 -0
  337. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +2258 -0
  338. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +675 -0
  339. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +458 -0
  340. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +178 -0
  341. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +5255 -0
  342. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +246 -0
  343. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +91 -0
  344. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +1918 -0
  345. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +95 -0
  346. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +8 -0
  347. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +10 -0
  348. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +38 -0
  349. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +46 -0
  350. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +286 -0
  351. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +136 -0
  352. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +574 -0
  353. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +87 -0
  354. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/make/Makefile +101 -0
  355. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +32 -0
  356. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +191 -0
  357. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +15 -0
  358. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +187 -0
  359. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +201 -0
  360. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +46 -0
  361. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +145 -0
  362. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +19 -0
  363. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +151 -0
  364. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +176 -0
  365. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +46 -0
  366. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +145 -0
  367. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +19 -0
  368. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +151 -0
  369. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +176 -0
  370. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +240 -0
  371. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +203 -0
  372. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +34 -0
  373. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +115 -0
  374. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  375. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +1733 -0
  376. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +227 -0
  377. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +448 -0
  378. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +59 -0
  379. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +287 -0
  380. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +41 -0
  381. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +31 -0
  382. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +303 -0
  383. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +640 -0
  384. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +1387 -0
  385. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +78 -0
  386. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +47 -0
  387. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +156 -0
  388. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +204 -0
  389. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +573 -0
  390. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +883 -0
  391. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +205 -0
  392. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +54 -0
  393. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +123 -0
  394. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +1575 -0
  395. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +428 -0
  396. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +1230 -0
  397. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +647 -0
  398. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +129 -0
  399. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +1341 -0
  400. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +718 -0
  401. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +6767 -0
  402. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +710 -0
  403. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +511 -0
  404. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +43 -0
  405. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +2771 -0
  406. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +51 -0
  407. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +81 -0
  408. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +108 -0
  409. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +100 -0
  410. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +40 -0
  411. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +40 -0
  412. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +691 -0
  413. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +183 -0
  414. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +310 -0
  415. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +317 -0
  416. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +323 -0
  417. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +262 -0
  418. data/ext/rj_schema/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +110 -0
  419. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CHANGES +157 -0
  420. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +312 -0
  421. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +37 -0
  422. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/LICENSE +28 -0
  423. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/Makefile.am +339 -0
  424. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/README.md +341 -0
  425. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +9 -0
  426. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +10 -0
  427. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +280 -0
  428. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +138 -0
  429. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +54 -0
  430. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +38 -0
  431. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +40 -0
  432. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +82 -0
  433. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +88 -0
  434. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/configure.ac +68 -0
  435. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +146 -0
  436. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +177 -0
  437. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +93 -0
  438. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +2416 -0
  439. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/faq.md +1092 -0
  440. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/primer.md +536 -0
  441. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/docs/samples.md +14 -0
  442. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +342 -0
  443. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +249 -0
  444. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +1438 -0
  445. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +501 -0
  446. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +1082 -0
  447. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +231 -0
  448. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +179 -0
  449. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +264 -0
  450. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +2332 -0
  451. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +357 -0
  452. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +61 -0
  453. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +70 -0
  454. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +42 -0
  455. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +45 -0
  456. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +275 -0
  457. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +205 -0
  458. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +1277 -0
  459. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +243 -0
  460. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +5139 -0
  461. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +279 -0
  462. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +723 -0
  463. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +100 -0
  464. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +2687 -0
  465. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +167 -0
  466. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +1020 -0
  467. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +347 -0
  468. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +3347 -0
  469. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +313 -0
  470. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +363 -0
  471. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +74 -0
  472. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/make/Makefile +82 -0
  473. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +55 -0
  474. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +149 -0
  475. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +18 -0
  476. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +55 -0
  477. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +149 -0
  478. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +18 -0
  479. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +154 -0
  480. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +18 -0
  481. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +162 -0
  482. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +18 -0
  483. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +199 -0
  484. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +26 -0
  485. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +191 -0
  486. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +26 -0
  487. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +188 -0
  488. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +18 -0
  489. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +180 -0
  490. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +18 -0
  491. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +127 -0
  492. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +68 -0
  493. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +43 -0
  494. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +140 -0
  495. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +154 -0
  496. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +56 -0
  497. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +85 -0
  498. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +110 -0
  499. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +172 -0
  500. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +152 -0
  501. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +46 -0
  502. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +53 -0
  503. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +49 -0
  504. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +199 -0
  505. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +225 -0
  506. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +118 -0
  507. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +174 -0
  508. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +157 -0
  509. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/common.py +83 -0
  510. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +253 -0
  511. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +730 -0
  512. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +274 -0
  513. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +855 -0
  514. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +158 -0
  515. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/test/Makefile +59 -0
  516. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +1387 -0
  517. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +78 -0
  518. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +48 -0
  519. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +1536 -0
  520. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +385 -0
  521. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +1175 -0
  522. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +1277 -0
  523. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +458 -0
  524. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +102 -0
  525. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +119 -0
  526. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +5846 -0
  527. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +38 -0
  528. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +396 -0
  529. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +93 -0
  530. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +1424 -0
  531. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +652 -0
  532. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +154 -0
  533. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +311 -0
  534. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +159 -0
  535. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +213 -0
  536. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +61 -0
  537. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +1110 -0
  538. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +53 -0
  539. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +1303 -0
  540. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +1737 -0
  541. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +208 -0
  542. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +320 -0
  543. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +45 -0
  544. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +380 -0
  545. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +66 -0
  546. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +341 -0
  547. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +47 -0
  548. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +119 -0
  549. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +210 -0
  550. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +87 -0
  551. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +235 -0
  552. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +311 -0
  553. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +129 -0
  554. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +63 -0
  555. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +119 -0
  556. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +124 -0
  557. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +189 -0
  558. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +638 -0
  559. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +138 -0
  560. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +172 -0
  561. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +46 -0
  562. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +162 -0
  563. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +611 -0
  564. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +60 -0
  565. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +207 -0
  566. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +157 -0
  567. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +45 -0
  568. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +56 -0
  569. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +344 -0
  570. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +1067 -0
  571. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +781 -0
  572. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +2427 -0
  573. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +127 -0
  574. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +57 -0
  575. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +236 -0
  576. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +325 -0
  577. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +103 -0
  578. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +57 -0
  579. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +250 -0
  580. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +318 -0
  581. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +65 -0
  582. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +44 -0
  583. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +92 -0
  584. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +171 -0
  585. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +72 -0
  586. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +69 -0
  587. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +43 -0
  588. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +7797 -0
  589. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +48 -0
  590. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +48 -0
  591. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +140 -0
  592. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +378 -0
  593. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +179 -0
  594. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +196 -0
  595. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.cc +36 -0
  596. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/test/production.h +55 -0
  597. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +30 -0
  598. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +17 -0
  599. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +41 -0
  600. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +32 -0
  601. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +18 -0
  602. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +8 -0
  603. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +30 -0
  604. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +28 -0
  605. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +457 -0
  606. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +62 -0
  607. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +63 -0
  608. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +59 -0
  609. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +68 -0
  610. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +65 -0
  611. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +100 -0
  612. data/ext/rj_schema/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +1182 -0
  613. data/ext/rj_schema/rapidjson/travis-doxygen.sh +128 -0
  614. metadata +613 -1
@@ -0,0 +1,385 @@
1
+ // Copyright 2008, Google Inc.
2
+ // All rights reserved.
3
+ //
4
+ // Redistribution and use in source and binary forms, with or without
5
+ // modification, are permitted provided that the following conditions are
6
+ // met:
7
+ //
8
+ // * Redistributions of source code must retain the above copyright
9
+ // notice, this list of conditions and the following disclaimer.
10
+ // * Redistributions in binary form must reproduce the above
11
+ // copyright notice, this list of conditions and the following disclaimer
12
+ // in the documentation and/or other materials provided with the
13
+ // distribution.
14
+ // * Neither the name of Google Inc. nor the names of its
15
+ // contributors may be used to endorse or promote products derived from
16
+ // this software without specific prior written permission.
17
+ //
18
+ // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
+
30
+ #include "gtest/internal/gtest-filepath.h"
31
+
32
+ #include <stdlib.h>
33
+ #include "gtest/internal/gtest-port.h"
34
+ #include "gtest/gtest-message.h"
35
+
36
+ #if GTEST_OS_WINDOWS_MOBILE
37
+ # include <windows.h>
38
+ #elif GTEST_OS_WINDOWS
39
+ # include <direct.h>
40
+ # include <io.h>
41
+ #elif GTEST_OS_SYMBIAN
42
+ // Symbian OpenC has PATH_MAX in sys/syslimits.h
43
+ # include <sys/syslimits.h>
44
+ #else
45
+ # include <limits.h>
46
+ # include <climits> // Some Linux distributions define PATH_MAX here.
47
+ #endif // GTEST_OS_WINDOWS_MOBILE
48
+
49
+ #include "gtest/internal/gtest-string.h"
50
+
51
+ #if GTEST_OS_WINDOWS
52
+ # define GTEST_PATH_MAX_ _MAX_PATH
53
+ #elif defined(PATH_MAX)
54
+ # define GTEST_PATH_MAX_ PATH_MAX
55
+ #elif defined(_XOPEN_PATH_MAX)
56
+ # define GTEST_PATH_MAX_ _XOPEN_PATH_MAX
57
+ #else
58
+ # define GTEST_PATH_MAX_ _POSIX_PATH_MAX
59
+ #endif // GTEST_OS_WINDOWS
60
+
61
+ namespace testing {
62
+ namespace internal {
63
+
64
+ #if GTEST_OS_WINDOWS
65
+ // On Windows, '\\' is the standard path separator, but many tools and the
66
+ // Windows API also accept '/' as an alternate path separator. Unless otherwise
67
+ // noted, a file path can contain either kind of path separators, or a mixture
68
+ // of them.
69
+ const char kPathSeparator = '\\';
70
+ const char kAlternatePathSeparator = '/';
71
+ const char kAlternatePathSeparatorString[] = "/";
72
+ # if GTEST_OS_WINDOWS_MOBILE
73
+ // Windows CE doesn't have a current directory. You should not use
74
+ // the current directory in tests on Windows CE, but this at least
75
+ // provides a reasonable fallback.
76
+ const char kCurrentDirectoryString[] = "\\";
77
+ // Windows CE doesn't define INVALID_FILE_ATTRIBUTES
78
+ const DWORD kInvalidFileAttributes = 0xffffffff;
79
+ # else
80
+ const char kCurrentDirectoryString[] = ".\\";
81
+ # endif // GTEST_OS_WINDOWS_MOBILE
82
+ #else
83
+ const char kPathSeparator = '/';
84
+ const char kCurrentDirectoryString[] = "./";
85
+ #endif // GTEST_OS_WINDOWS
86
+
87
+ // Returns whether the given character is a valid path separator.
88
+ static bool IsPathSeparator(char c) {
89
+ #if GTEST_HAS_ALT_PATH_SEP_
90
+ return (c == kPathSeparator) || (c == kAlternatePathSeparator);
91
+ #else
92
+ return c == kPathSeparator;
93
+ #endif
94
+ }
95
+
96
+ // Returns the current working directory, or "" if unsuccessful.
97
+ FilePath FilePath::GetCurrentDir() {
98
+ #if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
99
+ // Windows CE doesn't have a current directory, so we just return
100
+ // something reasonable.
101
+ return FilePath(kCurrentDirectoryString);
102
+ #elif GTEST_OS_WINDOWS
103
+ char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
104
+ return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
105
+ #else
106
+ char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
107
+ char* result = getcwd(cwd, sizeof(cwd));
108
+ # if GTEST_OS_NACL
109
+ // getcwd will likely fail in NaCl due to the sandbox, so return something
110
+ // reasonable. The user may have provided a shim implementation for getcwd,
111
+ // however, so fallback only when failure is detected.
112
+ return FilePath(result == NULL ? kCurrentDirectoryString : cwd);
113
+ # endif // GTEST_OS_NACL
114
+ return FilePath(result == NULL ? "" : cwd);
115
+ #endif // GTEST_OS_WINDOWS_MOBILE
116
+ }
117
+
118
+ // Returns a copy of the FilePath with the case-insensitive extension removed.
119
+ // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
120
+ // FilePath("dir/file"). If a case-insensitive extension is not
121
+ // found, returns a copy of the original FilePath.
122
+ FilePath FilePath::RemoveExtension(const char* extension) const {
123
+ const std::string dot_extension = std::string(".") + extension;
124
+ if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {
125
+ return FilePath(pathname_.substr(
126
+ 0, pathname_.length() - dot_extension.length()));
127
+ }
128
+ return *this;
129
+ }
130
+
131
+ // Returns a pointer to the last occurrence of a valid path separator in
132
+ // the FilePath. On Windows, for example, both '/' and '\' are valid path
133
+ // separators. Returns NULL if no path separator was found.
134
+ const char* FilePath::FindLastPathSeparator() const {
135
+ const char* const last_sep = strrchr(c_str(), kPathSeparator);
136
+ #if GTEST_HAS_ALT_PATH_SEP_
137
+ const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
138
+ // Comparing two pointers of which only one is NULL is undefined.
139
+ if (last_alt_sep != NULL &&
140
+ (last_sep == NULL || last_alt_sep > last_sep)) {
141
+ return last_alt_sep;
142
+ }
143
+ #endif
144
+ return last_sep;
145
+ }
146
+
147
+ // Returns a copy of the FilePath with the directory part removed.
148
+ // Example: FilePath("path/to/file").RemoveDirectoryName() returns
149
+ // FilePath("file"). If there is no directory part ("just_a_file"), it returns
150
+ // the FilePath unmodified. If there is no file part ("just_a_dir/") it
151
+ // returns an empty FilePath ("").
152
+ // On Windows platform, '\' is the path separator, otherwise it is '/'.
153
+ FilePath FilePath::RemoveDirectoryName() const {
154
+ const char* const last_sep = FindLastPathSeparator();
155
+ return last_sep ? FilePath(last_sep + 1) : *this;
156
+ }
157
+
158
+ // RemoveFileName returns the directory path with the filename removed.
159
+ // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
160
+ // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
161
+ // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
162
+ // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
163
+ // On Windows platform, '\' is the path separator, otherwise it is '/'.
164
+ FilePath FilePath::RemoveFileName() const {
165
+ const char* const last_sep = FindLastPathSeparator();
166
+ std::string dir;
167
+ if (last_sep) {
168
+ dir = std::string(c_str(), last_sep + 1 - c_str());
169
+ } else {
170
+ dir = kCurrentDirectoryString;
171
+ }
172
+ return FilePath(dir);
173
+ }
174
+
175
+ // Helper functions for naming files in a directory for xml output.
176
+
177
+ // Given directory = "dir", base_name = "test", number = 0,
178
+ // extension = "xml", returns "dir/test.xml". If number is greater
179
+ // than zero (e.g., 12), returns "dir/test_12.xml".
180
+ // On Windows platform, uses \ as the separator rather than /.
181
+ FilePath FilePath::MakeFileName(const FilePath& directory,
182
+ const FilePath& base_name,
183
+ int number,
184
+ const char* extension) {
185
+ std::string file;
186
+ if (number == 0) {
187
+ file = base_name.string() + "." + extension;
188
+ } else {
189
+ file = base_name.string() + "_" + StreamableToString(number)
190
+ + "." + extension;
191
+ }
192
+ return ConcatPaths(directory, FilePath(file));
193
+ }
194
+
195
+ // Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
196
+ // On Windows, uses \ as the separator rather than /.
197
+ FilePath FilePath::ConcatPaths(const FilePath& directory,
198
+ const FilePath& relative_path) {
199
+ if (directory.IsEmpty())
200
+ return relative_path;
201
+ const FilePath dir(directory.RemoveTrailingPathSeparator());
202
+ return FilePath(dir.string() + kPathSeparator + relative_path.string());
203
+ }
204
+
205
+ // Returns true if pathname describes something findable in the file-system,
206
+ // either a file, directory, or whatever.
207
+ bool FilePath::FileOrDirectoryExists() const {
208
+ #if GTEST_OS_WINDOWS_MOBILE
209
+ LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
210
+ const DWORD attributes = GetFileAttributes(unicode);
211
+ delete [] unicode;
212
+ return attributes != kInvalidFileAttributes;
213
+ #else
214
+ posix::StatStruct file_stat;
215
+ return posix::Stat(pathname_.c_str(), &file_stat) == 0;
216
+ #endif // GTEST_OS_WINDOWS_MOBILE
217
+ }
218
+
219
+ // Returns true if pathname describes a directory in the file-system
220
+ // that exists.
221
+ bool FilePath::DirectoryExists() const {
222
+ bool result = false;
223
+ #if GTEST_OS_WINDOWS
224
+ // Don't strip off trailing separator if path is a root directory on
225
+ // Windows (like "C:\\").
226
+ const FilePath& path(IsRootDirectory() ? *this :
227
+ RemoveTrailingPathSeparator());
228
+ #else
229
+ const FilePath& path(*this);
230
+ #endif
231
+
232
+ #if GTEST_OS_WINDOWS_MOBILE
233
+ LPCWSTR unicode = String::AnsiToUtf16(path.c_str());
234
+ const DWORD attributes = GetFileAttributes(unicode);
235
+ delete [] unicode;
236
+ if ((attributes != kInvalidFileAttributes) &&
237
+ (attributes & FILE_ATTRIBUTE_DIRECTORY)) {
238
+ result = true;
239
+ }
240
+ #else
241
+ posix::StatStruct file_stat;
242
+ result = posix::Stat(path.c_str(), &file_stat) == 0 &&
243
+ posix::IsDir(file_stat);
244
+ #endif // GTEST_OS_WINDOWS_MOBILE
245
+
246
+ return result;
247
+ }
248
+
249
+ // Returns true if pathname describes a root directory. (Windows has one
250
+ // root directory per disk drive.)
251
+ bool FilePath::IsRootDirectory() const {
252
+ #if GTEST_OS_WINDOWS
253
+ // TODO(wan@google.com): on Windows a network share like
254
+ // \\server\share can be a root directory, although it cannot be the
255
+ // current directory. Handle this properly.
256
+ return pathname_.length() == 3 && IsAbsolutePath();
257
+ #else
258
+ return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
259
+ #endif
260
+ }
261
+
262
+ // Returns true if pathname describes an absolute path.
263
+ bool FilePath::IsAbsolutePath() const {
264
+ const char* const name = pathname_.c_str();
265
+ #if GTEST_OS_WINDOWS
266
+ return pathname_.length() >= 3 &&
267
+ ((name[0] >= 'a' && name[0] <= 'z') ||
268
+ (name[0] >= 'A' && name[0] <= 'Z')) &&
269
+ name[1] == ':' &&
270
+ IsPathSeparator(name[2]);
271
+ #else
272
+ return IsPathSeparator(name[0]);
273
+ #endif
274
+ }
275
+
276
+ // Returns a pathname for a file that does not currently exist. The pathname
277
+ // will be directory/base_name.extension or
278
+ // directory/base_name_<number>.extension if directory/base_name.extension
279
+ // already exists. The number will be incremented until a pathname is found
280
+ // that does not already exist.
281
+ // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
282
+ // There could be a race condition if two or more processes are calling this
283
+ // function at the same time -- they could both pick the same filename.
284
+ FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,
285
+ const FilePath& base_name,
286
+ const char* extension) {
287
+ FilePath full_pathname;
288
+ int number = 0;
289
+ do {
290
+ full_pathname.Set(MakeFileName(directory, base_name, number++, extension));
291
+ } while (full_pathname.FileOrDirectoryExists());
292
+ return full_pathname;
293
+ }
294
+
295
+ // Returns true if FilePath ends with a path separator, which indicates that
296
+ // it is intended to represent a directory. Returns false otherwise.
297
+ // This does NOT check that a directory (or file) actually exists.
298
+ bool FilePath::IsDirectory() const {
299
+ return !pathname_.empty() &&
300
+ IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);
301
+ }
302
+
303
+ // Create directories so that path exists. Returns true if successful or if
304
+ // the directories already exist; returns false if unable to create directories
305
+ // for any reason.
306
+ bool FilePath::CreateDirectoriesRecursively() const {
307
+ if (!this->IsDirectory()) {
308
+ return false;
309
+ }
310
+
311
+ if (pathname_.length() == 0 || this->DirectoryExists()) {
312
+ return true;
313
+ }
314
+
315
+ const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
316
+ return parent.CreateDirectoriesRecursively() && this->CreateFolder();
317
+ }
318
+
319
+ // Create the directory so that path exists. Returns true if successful or
320
+ // if the directory already exists; returns false if unable to create the
321
+ // directory for any reason, including if the parent directory does not
322
+ // exist. Not named "CreateDirectory" because that's a macro on Windows.
323
+ bool FilePath::CreateFolder() const {
324
+ #if GTEST_OS_WINDOWS_MOBILE
325
+ FilePath removed_sep(this->RemoveTrailingPathSeparator());
326
+ LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
327
+ int result = CreateDirectory(unicode, NULL) ? 0 : -1;
328
+ delete [] unicode;
329
+ #elif GTEST_OS_WINDOWS
330
+ int result = _mkdir(pathname_.c_str());
331
+ #else
332
+ int result = mkdir(pathname_.c_str(), 0777);
333
+ #endif // GTEST_OS_WINDOWS_MOBILE
334
+
335
+ if (result == -1) {
336
+ return this->DirectoryExists(); // An error is OK if the directory exists.
337
+ }
338
+ return true; // No error.
339
+ }
340
+
341
+ // If input name has a trailing separator character, remove it and return the
342
+ // name, otherwise return the name string unmodified.
343
+ // On Windows platform, uses \ as the separator, other platforms use /.
344
+ FilePath FilePath::RemoveTrailingPathSeparator() const {
345
+ return IsDirectory()
346
+ ? FilePath(pathname_.substr(0, pathname_.length() - 1))
347
+ : *this;
348
+ }
349
+
350
+ // Removes any redundant separators that might be in the pathname.
351
+ // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
352
+ // redundancies that might be in a pathname involving "." or "..".
353
+ // TODO(wan@google.com): handle Windows network shares (e.g. \\server\share).
354
+ void FilePath::Normalize() {
355
+ if (pathname_.c_str() == NULL) {
356
+ pathname_ = "";
357
+ return;
358
+ }
359
+ const char* src = pathname_.c_str();
360
+ char* const dest = new char[pathname_.length() + 1];
361
+ char* dest_ptr = dest;
362
+ memset(dest_ptr, 0, pathname_.length() + 1);
363
+
364
+ while (*src != '\0') {
365
+ *dest_ptr = *src;
366
+ if (!IsPathSeparator(*src)) {
367
+ src++;
368
+ } else {
369
+ #if GTEST_HAS_ALT_PATH_SEP_
370
+ if (*dest_ptr == kAlternatePathSeparator) {
371
+ *dest_ptr = kPathSeparator;
372
+ }
373
+ #endif
374
+ while (IsPathSeparator(*src))
375
+ src++;
376
+ }
377
+ dest_ptr++;
378
+ }
379
+ *dest_ptr = '\0';
380
+ pathname_ = dest;
381
+ delete[] dest;
382
+ }
383
+
384
+ } // namespace internal
385
+ } // namespace testing
@@ -0,0 +1,1175 @@
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
+ // Utility functions and classes used by the Google C++ testing framework.
31
+ //
32
+ // Author: wan@google.com (Zhanyong Wan)
33
+ //
34
+ // This file contains purely Google Test's internal implementation. Please
35
+ // DO NOT #INCLUDE IT IN A USER PROGRAM.
36
+
37
+ #ifndef GTEST_SRC_GTEST_INTERNAL_INL_H_
38
+ #define GTEST_SRC_GTEST_INTERNAL_INL_H_
39
+
40
+ #ifndef _WIN32_WCE
41
+ # include <errno.h>
42
+ #endif // !_WIN32_WCE
43
+ #include <stddef.h>
44
+ #include <stdlib.h> // For strtoll/_strtoul64/malloc/free.
45
+ #include <string.h> // For memmove.
46
+
47
+ #include <algorithm>
48
+ #include <string>
49
+ #include <vector>
50
+
51
+ #include "gtest/internal/gtest-port.h"
52
+
53
+ #if GTEST_CAN_STREAM_RESULTS_
54
+ # include <arpa/inet.h> // NOLINT
55
+ # include <netdb.h> // NOLINT
56
+ #endif
57
+
58
+ #if GTEST_OS_WINDOWS
59
+ # include <windows.h> // NOLINT
60
+ #endif // GTEST_OS_WINDOWS
61
+
62
+ #include "gtest/gtest.h"
63
+ #include "gtest/gtest-spi.h"
64
+
65
+ namespace testing {
66
+
67
+ // Declares the flags.
68
+ //
69
+ // We don't want the users to modify this flag in the code, but want
70
+ // Google Test's own unit tests to be able to access it. Therefore we
71
+ // declare it here as opposed to in gtest.h.
72
+ GTEST_DECLARE_bool_(death_test_use_fork);
73
+
74
+ namespace internal {
75
+
76
+ // The value of GetTestTypeId() as seen from within the Google Test
77
+ // library. This is solely for testing GetTestTypeId().
78
+ GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;
79
+
80
+ // Names of the flags (needed for parsing Google Test flags).
81
+ const char kAlsoRunDisabledTestsFlag[] = "also_run_disabled_tests";
82
+ const char kBreakOnFailureFlag[] = "break_on_failure";
83
+ const char kCatchExceptionsFlag[] = "catch_exceptions";
84
+ const char kColorFlag[] = "color";
85
+ const char kFilterFlag[] = "filter";
86
+ const char kListTestsFlag[] = "list_tests";
87
+ const char kOutputFlag[] = "output";
88
+ const char kPrintTimeFlag[] = "print_time";
89
+ const char kPrintUTF8Flag[] = "print_utf8";
90
+ const char kRandomSeedFlag[] = "random_seed";
91
+ const char kRepeatFlag[] = "repeat";
92
+ const char kShuffleFlag[] = "shuffle";
93
+ const char kStackTraceDepthFlag[] = "stack_trace_depth";
94
+ const char kStreamResultToFlag[] = "stream_result_to";
95
+ const char kThrowOnFailureFlag[] = "throw_on_failure";
96
+ const char kFlagfileFlag[] = "flagfile";
97
+
98
+ // A valid random seed must be in [1, kMaxRandomSeed].
99
+ const int kMaxRandomSeed = 99999;
100
+
101
+ // g_help_flag is true iff the --help flag or an equivalent form is
102
+ // specified on the command line.
103
+ GTEST_API_ extern bool g_help_flag;
104
+
105
+ // Returns the current time in milliseconds.
106
+ GTEST_API_ TimeInMillis GetTimeInMillis();
107
+
108
+ // Returns true iff Google Test should use colors in the output.
109
+ GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
110
+
111
+ // Formats the given time in milliseconds as seconds.
112
+ GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
113
+
114
+ // Converts the given time in milliseconds to a date string in the ISO 8601
115
+ // format, without the timezone information. N.B.: due to the use the
116
+ // non-reentrant localtime() function, this function is not thread safe. Do
117
+ // not use it in any code that can be called from multiple threads.
118
+ GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);
119
+
120
+ // Parses a string for an Int32 flag, in the form of "--flag=value".
121
+ //
122
+ // On success, stores the value of the flag in *value, and returns
123
+ // true. On failure, returns false without changing *value.
124
+ GTEST_API_ bool ParseInt32Flag(
125
+ const char* str, const char* flag, Int32* value);
126
+
127
+ // Returns a random seed in range [1, kMaxRandomSeed] based on the
128
+ // given --gtest_random_seed flag value.
129
+ inline int GetRandomSeedFromFlag(Int32 random_seed_flag) {
130
+ const unsigned int raw_seed = (random_seed_flag == 0) ?
131
+ static_cast<unsigned int>(GetTimeInMillis()) :
132
+ static_cast<unsigned int>(random_seed_flag);
133
+
134
+ // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
135
+ // it's easy to type.
136
+ const int normalized_seed =
137
+ static_cast<int>((raw_seed - 1U) %
138
+ static_cast<unsigned int>(kMaxRandomSeed)) + 1;
139
+ return normalized_seed;
140
+ }
141
+
142
+ // Returns the first valid random seed after 'seed'. The behavior is
143
+ // undefined if 'seed' is invalid. The seed after kMaxRandomSeed is
144
+ // considered to be 1.
145
+ inline int GetNextRandomSeed(int seed) {
146
+ GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)
147
+ << "Invalid random seed " << seed << " - must be in [1, "
148
+ << kMaxRandomSeed << "].";
149
+ const int next_seed = seed + 1;
150
+ return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
151
+ }
152
+
153
+ // This class saves the values of all Google Test flags in its c'tor, and
154
+ // restores them in its d'tor.
155
+ class GTestFlagSaver {
156
+ public:
157
+ // The c'tor.
158
+ GTestFlagSaver() {
159
+ also_run_disabled_tests_ = GTEST_FLAG(also_run_disabled_tests);
160
+ break_on_failure_ = GTEST_FLAG(break_on_failure);
161
+ catch_exceptions_ = GTEST_FLAG(catch_exceptions);
162
+ color_ = GTEST_FLAG(color);
163
+ death_test_style_ = GTEST_FLAG(death_test_style);
164
+ death_test_use_fork_ = GTEST_FLAG(death_test_use_fork);
165
+ filter_ = GTEST_FLAG(filter);
166
+ internal_run_death_test_ = GTEST_FLAG(internal_run_death_test);
167
+ list_tests_ = GTEST_FLAG(list_tests);
168
+ output_ = GTEST_FLAG(output);
169
+ print_time_ = GTEST_FLAG(print_time);
170
+ print_utf8_ = GTEST_FLAG(print_utf8);
171
+ random_seed_ = GTEST_FLAG(random_seed);
172
+ repeat_ = GTEST_FLAG(repeat);
173
+ shuffle_ = GTEST_FLAG(shuffle);
174
+ stack_trace_depth_ = GTEST_FLAG(stack_trace_depth);
175
+ stream_result_to_ = GTEST_FLAG(stream_result_to);
176
+ throw_on_failure_ = GTEST_FLAG(throw_on_failure);
177
+ }
178
+
179
+ // The d'tor is not virtual. DO NOT INHERIT FROM THIS CLASS.
180
+ ~GTestFlagSaver() {
181
+ GTEST_FLAG(also_run_disabled_tests) = also_run_disabled_tests_;
182
+ GTEST_FLAG(break_on_failure) = break_on_failure_;
183
+ GTEST_FLAG(catch_exceptions) = catch_exceptions_;
184
+ GTEST_FLAG(color) = color_;
185
+ GTEST_FLAG(death_test_style) = death_test_style_;
186
+ GTEST_FLAG(death_test_use_fork) = death_test_use_fork_;
187
+ GTEST_FLAG(filter) = filter_;
188
+ GTEST_FLAG(internal_run_death_test) = internal_run_death_test_;
189
+ GTEST_FLAG(list_tests) = list_tests_;
190
+ GTEST_FLAG(output) = output_;
191
+ GTEST_FLAG(print_time) = print_time_;
192
+ GTEST_FLAG(print_utf8) = print_utf8_;
193
+ GTEST_FLAG(random_seed) = random_seed_;
194
+ GTEST_FLAG(repeat) = repeat_;
195
+ GTEST_FLAG(shuffle) = shuffle_;
196
+ GTEST_FLAG(stack_trace_depth) = stack_trace_depth_;
197
+ GTEST_FLAG(stream_result_to) = stream_result_to_;
198
+ GTEST_FLAG(throw_on_failure) = throw_on_failure_;
199
+ }
200
+
201
+ private:
202
+ // Fields for saving the original values of flags.
203
+ bool also_run_disabled_tests_;
204
+ bool break_on_failure_;
205
+ bool catch_exceptions_;
206
+ std::string color_;
207
+ std::string death_test_style_;
208
+ bool death_test_use_fork_;
209
+ std::string filter_;
210
+ std::string internal_run_death_test_;
211
+ bool list_tests_;
212
+ std::string output_;
213
+ bool print_time_;
214
+ bool print_utf8_;
215
+ internal::Int32 random_seed_;
216
+ internal::Int32 repeat_;
217
+ bool shuffle_;
218
+ internal::Int32 stack_trace_depth_;
219
+ std::string stream_result_to_;
220
+ bool throw_on_failure_;
221
+ } GTEST_ATTRIBUTE_UNUSED_;
222
+
223
+ // Converts a Unicode code point to a narrow string in UTF-8 encoding.
224
+ // code_point parameter is of type UInt32 because wchar_t may not be
225
+ // wide enough to contain a code point.
226
+ // If the code_point is not a valid Unicode code point
227
+ // (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted
228
+ // to "(Invalid Unicode 0xXXXXXXXX)".
229
+ GTEST_API_ std::string CodePointToUtf8(UInt32 code_point);
230
+
231
+ // Converts a wide string to a narrow string in UTF-8 encoding.
232
+ // The wide string is assumed to have the following encoding:
233
+ // UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin, Symbian OS)
234
+ // UTF-32 if sizeof(wchar_t) == 4 (on Linux)
235
+ // Parameter str points to a null-terminated wide string.
236
+ // Parameter num_chars may additionally limit the number
237
+ // of wchar_t characters processed. -1 is used when the entire string
238
+ // should be processed.
239
+ // If the string contains code points that are not valid Unicode code points
240
+ // (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
241
+ // as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
242
+ // and contains invalid UTF-16 surrogate pairs, values in those pairs
243
+ // will be encoded as individual Unicode characters from Basic Normal Plane.
244
+ GTEST_API_ std::string WideStringToUtf8(const wchar_t* str, int num_chars);
245
+
246
+ // Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
247
+ // if the variable is present. If a file already exists at this location, this
248
+ // function will write over it. If the variable is present, but the file cannot
249
+ // be created, prints an error and exits.
250
+ void WriteToShardStatusFileIfNeeded();
251
+
252
+ // Checks whether sharding is enabled by examining the relevant
253
+ // environment variable values. If the variables are present,
254
+ // but inconsistent (e.g., shard_index >= total_shards), prints
255
+ // an error and exits. If in_subprocess_for_death_test, sharding is
256
+ // disabled because it must only be applied to the original test
257
+ // process. Otherwise, we could filter out death tests we intended to execute.
258
+ GTEST_API_ bool ShouldShard(const char* total_shards_str,
259
+ const char* shard_index_str,
260
+ bool in_subprocess_for_death_test);
261
+
262
+ // Parses the environment variable var as an Int32. If it is unset,
263
+ // returns default_val. If it is not an Int32, prints an error and
264
+ // and aborts.
265
+ GTEST_API_ Int32 Int32FromEnvOrDie(const char* env_var, Int32 default_val);
266
+
267
+ // Given the total number of shards, the shard index, and the test id,
268
+ // returns true iff the test should be run on this shard. The test id is
269
+ // some arbitrary but unique non-negative integer assigned to each test
270
+ // method. Assumes that 0 <= shard_index < total_shards.
271
+ GTEST_API_ bool ShouldRunTestOnShard(
272
+ int total_shards, int shard_index, int test_id);
273
+
274
+ // STL container utilities.
275
+
276
+ // Returns the number of elements in the given container that satisfy
277
+ // the given predicate.
278
+ template <class Container, typename Predicate>
279
+ inline int CountIf(const Container& c, Predicate predicate) {
280
+ // Implemented as an explicit loop since std::count_if() in libCstd on
281
+ // Solaris has a non-standard signature.
282
+ int count = 0;
283
+ for (typename Container::const_iterator it = c.begin(); it != c.end(); ++it) {
284
+ if (predicate(*it))
285
+ ++count;
286
+ }
287
+ return count;
288
+ }
289
+
290
+ // Applies a function/functor to each element in the container.
291
+ template <class Container, typename Functor>
292
+ void ForEach(const Container& c, Functor functor) {
293
+ std::for_each(c.begin(), c.end(), functor);
294
+ }
295
+
296
+ // Returns the i-th element of the vector, or default_value if i is not
297
+ // in range [0, v.size()).
298
+ template <typename E>
299
+ inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
300
+ return (i < 0 || i >= static_cast<int>(v.size())) ? default_value : v[i];
301
+ }
302
+
303
+ // Performs an in-place shuffle of a range of the vector's elements.
304
+ // 'begin' and 'end' are element indices as an STL-style range;
305
+ // i.e. [begin, end) are shuffled, where 'end' == size() means to
306
+ // shuffle to the end of the vector.
307
+ template <typename E>
308
+ void ShuffleRange(internal::Random* random, int begin, int end,
309
+ std::vector<E>* v) {
310
+ const int size = static_cast<int>(v->size());
311
+ GTEST_CHECK_(0 <= begin && begin <= size)
312
+ << "Invalid shuffle range start " << begin << ": must be in range [0, "
313
+ << size << "].";
314
+ GTEST_CHECK_(begin <= end && end <= size)
315
+ << "Invalid shuffle range finish " << end << ": must be in range ["
316
+ << begin << ", " << size << "].";
317
+
318
+ // Fisher-Yates shuffle, from
319
+ // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
320
+ for (int range_width = end - begin; range_width >= 2; range_width--) {
321
+ const int last_in_range = begin + range_width - 1;
322
+ const int selected = begin + random->Generate(range_width);
323
+ std::swap((*v)[selected], (*v)[last_in_range]);
324
+ }
325
+ }
326
+
327
+ // Performs an in-place shuffle of the vector's elements.
328
+ template <typename E>
329
+ inline void Shuffle(internal::Random* random, std::vector<E>* v) {
330
+ ShuffleRange(random, 0, static_cast<int>(v->size()), v);
331
+ }
332
+
333
+ // A function for deleting an object. Handy for being used as a
334
+ // functor.
335
+ template <typename T>
336
+ static void Delete(T* x) {
337
+ delete x;
338
+ }
339
+
340
+ // A predicate that checks the key of a TestProperty against a known key.
341
+ //
342
+ // TestPropertyKeyIs is copyable.
343
+ class TestPropertyKeyIs {
344
+ public:
345
+ // Constructor.
346
+ //
347
+ // TestPropertyKeyIs has NO default constructor.
348
+ explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}
349
+
350
+ // Returns true iff the test name of test property matches on key_.
351
+ bool operator()(const TestProperty& test_property) const {
352
+ return test_property.key() == key_;
353
+ }
354
+
355
+ private:
356
+ std::string key_;
357
+ };
358
+
359
+ // Class UnitTestOptions.
360
+ //
361
+ // This class contains functions for processing options the user
362
+ // specifies when running the tests. It has only static members.
363
+ //
364
+ // In most cases, the user can specify an option using either an
365
+ // environment variable or a command line flag. E.g. you can set the
366
+ // test filter using either GTEST_FILTER or --gtest_filter. If both
367
+ // the variable and the flag are present, the latter overrides the
368
+ // former.
369
+ class GTEST_API_ UnitTestOptions {
370
+ public:
371
+ // Functions for processing the gtest_output flag.
372
+
373
+ // Returns the output format, or "" for normal printed output.
374
+ static std::string GetOutputFormat();
375
+
376
+ // Returns the absolute path of the requested output file, or the
377
+ // default (test_detail.xml in the original working directory) if
378
+ // none was explicitly specified.
379
+ static std::string GetAbsolutePathToOutputFile();
380
+
381
+ // Functions for processing the gtest_filter flag.
382
+
383
+ // Returns true iff the wildcard pattern matches the string. The
384
+ // first ':' or '\0' character in pattern marks the end of it.
385
+ //
386
+ // This recursive algorithm isn't very efficient, but is clear and
387
+ // works well enough for matching test names, which are short.
388
+ static bool PatternMatchesString(const char *pattern, const char *str);
389
+
390
+ // Returns true iff the user-specified filter matches the test case
391
+ // name and the test name.
392
+ static bool FilterMatchesTest(const std::string &test_case_name,
393
+ const std::string &test_name);
394
+
395
+ #if GTEST_OS_WINDOWS
396
+ // Function for supporting the gtest_catch_exception flag.
397
+
398
+ // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
399
+ // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
400
+ // This function is useful as an __except condition.
401
+ static int GTestShouldProcessSEH(DWORD exception_code);
402
+ #endif // GTEST_OS_WINDOWS
403
+
404
+ // Returns true if "name" matches the ':' separated list of glob-style
405
+ // filters in "filter".
406
+ static bool MatchesFilter(const std::string& name, const char* filter);
407
+ };
408
+
409
+ // Returns the current application's name, removing directory path if that
410
+ // is present. Used by UnitTestOptions::GetOutputFile.
411
+ GTEST_API_ FilePath GetCurrentExecutableName();
412
+
413
+ // The role interface for getting the OS stack trace as a string.
414
+ class OsStackTraceGetterInterface {
415
+ public:
416
+ OsStackTraceGetterInterface() {}
417
+ virtual ~OsStackTraceGetterInterface() {}
418
+
419
+ // Returns the current OS stack trace as an std::string. Parameters:
420
+ //
421
+ // max_depth - the maximum number of stack frames to be included
422
+ // in the trace.
423
+ // skip_count - the number of top frames to be skipped; doesn't count
424
+ // against max_depth.
425
+ virtual std::string CurrentStackTrace(int max_depth, int skip_count) = 0;
426
+
427
+ // UponLeavingGTest() should be called immediately before Google Test calls
428
+ // user code. It saves some information about the current stack that
429
+ // CurrentStackTrace() will use to find and hide Google Test stack frames.
430
+ virtual void UponLeavingGTest() = 0;
431
+
432
+ // This string is inserted in place of stack frames that are part of
433
+ // Google Test's implementation.
434
+ static const char* const kElidedFramesMarker;
435
+
436
+ private:
437
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
438
+ };
439
+
440
+ // A working implementation of the OsStackTraceGetterInterface interface.
441
+ class OsStackTraceGetter : public OsStackTraceGetterInterface {
442
+ public:
443
+ OsStackTraceGetter() {}
444
+
445
+ virtual std::string CurrentStackTrace(int max_depth, int skip_count);
446
+ virtual void UponLeavingGTest();
447
+
448
+ private:
449
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
450
+ };
451
+
452
+ // Information about a Google Test trace point.
453
+ struct TraceInfo {
454
+ const char* file;
455
+ int line;
456
+ std::string message;
457
+ };
458
+
459
+ // This is the default global test part result reporter used in UnitTestImpl.
460
+ // This class should only be used by UnitTestImpl.
461
+ class DefaultGlobalTestPartResultReporter
462
+ : public TestPartResultReporterInterface {
463
+ public:
464
+ explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
465
+ // Implements the TestPartResultReporterInterface. Reports the test part
466
+ // result in the current test.
467
+ virtual void ReportTestPartResult(const TestPartResult& result);
468
+
469
+ private:
470
+ UnitTestImpl* const unit_test_;
471
+
472
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);
473
+ };
474
+
475
+ // This is the default per thread test part result reporter used in
476
+ // UnitTestImpl. This class should only be used by UnitTestImpl.
477
+ class DefaultPerThreadTestPartResultReporter
478
+ : public TestPartResultReporterInterface {
479
+ public:
480
+ explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
481
+ // Implements the TestPartResultReporterInterface. The implementation just
482
+ // delegates to the current global test part result reporter of *unit_test_.
483
+ virtual void ReportTestPartResult(const TestPartResult& result);
484
+
485
+ private:
486
+ UnitTestImpl* const unit_test_;
487
+
488
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);
489
+ };
490
+
491
+ // The private implementation of the UnitTest class. We don't protect
492
+ // the methods under a mutex, as this class is not accessible by a
493
+ // user and the UnitTest class that delegates work to this class does
494
+ // proper locking.
495
+ class GTEST_API_ UnitTestImpl {
496
+ public:
497
+ explicit UnitTestImpl(UnitTest* parent);
498
+ virtual ~UnitTestImpl();
499
+
500
+ // There are two different ways to register your own TestPartResultReporter.
501
+ // You can register your own repoter to listen either only for test results
502
+ // from the current thread or for results from all threads.
503
+ // By default, each per-thread test result repoter just passes a new
504
+ // TestPartResult to the global test result reporter, which registers the
505
+ // test part result for the currently running test.
506
+
507
+ // Returns the global test part result reporter.
508
+ TestPartResultReporterInterface* GetGlobalTestPartResultReporter();
509
+
510
+ // Sets the global test part result reporter.
511
+ void SetGlobalTestPartResultReporter(
512
+ TestPartResultReporterInterface* reporter);
513
+
514
+ // Returns the test part result reporter for the current thread.
515
+ TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();
516
+
517
+ // Sets the test part result reporter for the current thread.
518
+ void SetTestPartResultReporterForCurrentThread(
519
+ TestPartResultReporterInterface* reporter);
520
+
521
+ // Gets the number of successful test cases.
522
+ int successful_test_case_count() const;
523
+
524
+ // Gets the number of failed test cases.
525
+ int failed_test_case_count() const;
526
+
527
+ // Gets the number of all test cases.
528
+ int total_test_case_count() const;
529
+
530
+ // Gets the number of all test cases that contain at least one test
531
+ // that should run.
532
+ int test_case_to_run_count() const;
533
+
534
+ // Gets the number of successful tests.
535
+ int successful_test_count() const;
536
+
537
+ // Gets the number of failed tests.
538
+ int failed_test_count() const;
539
+
540
+ // Gets the number of disabled tests that will be reported in the XML report.
541
+ int reportable_disabled_test_count() const;
542
+
543
+ // Gets the number of disabled tests.
544
+ int disabled_test_count() const;
545
+
546
+ // Gets the number of tests to be printed in the XML report.
547
+ int reportable_test_count() const;
548
+
549
+ // Gets the number of all tests.
550
+ int total_test_count() const;
551
+
552
+ // Gets the number of tests that should run.
553
+ int test_to_run_count() const;
554
+
555
+ // Gets the time of the test program start, in ms from the start of the
556
+ // UNIX epoch.
557
+ TimeInMillis start_timestamp() const { return start_timestamp_; }
558
+
559
+ // Gets the elapsed time, in milliseconds.
560
+ TimeInMillis elapsed_time() const { return elapsed_time_; }
561
+
562
+ // Returns true iff the unit test passed (i.e. all test cases passed).
563
+ bool Passed() const { return !Failed(); }
564
+
565
+ // Returns true iff the unit test failed (i.e. some test case failed
566
+ // or something outside of all tests failed).
567
+ bool Failed() const {
568
+ return failed_test_case_count() > 0 || ad_hoc_test_result()->Failed();
569
+ }
570
+
571
+ // Gets the i-th test case among all the test cases. i can range from 0 to
572
+ // total_test_case_count() - 1. If i is not in that range, returns NULL.
573
+ const TestCase* GetTestCase(int i) const {
574
+ const int index = GetElementOr(test_case_indices_, i, -1);
575
+ return index < 0 ? NULL : test_cases_[i];
576
+ }
577
+
578
+ // Gets the i-th test case among all the test cases. i can range from 0 to
579
+ // total_test_case_count() - 1. If i is not in that range, returns NULL.
580
+ TestCase* GetMutableTestCase(int i) {
581
+ const int index = GetElementOr(test_case_indices_, i, -1);
582
+ return index < 0 ? NULL : test_cases_[index];
583
+ }
584
+
585
+ // Provides access to the event listener list.
586
+ TestEventListeners* listeners() { return &listeners_; }
587
+
588
+ // Returns the TestResult for the test that's currently running, or
589
+ // the TestResult for the ad hoc test if no test is running.
590
+ TestResult* current_test_result();
591
+
592
+ // Returns the TestResult for the ad hoc test.
593
+ const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }
594
+
595
+ // Sets the OS stack trace getter.
596
+ //
597
+ // Does nothing if the input and the current OS stack trace getter
598
+ // are the same; otherwise, deletes the old getter and makes the
599
+ // input the current getter.
600
+ void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);
601
+
602
+ // Returns the current OS stack trace getter if it is not NULL;
603
+ // otherwise, creates an OsStackTraceGetter, makes it the current
604
+ // getter, and returns it.
605
+ OsStackTraceGetterInterface* os_stack_trace_getter();
606
+
607
+ // Returns the current OS stack trace as an std::string.
608
+ //
609
+ // The maximum number of stack frames to be included is specified by
610
+ // the gtest_stack_trace_depth flag. The skip_count parameter
611
+ // specifies the number of top frames to be skipped, which doesn't
612
+ // count against the number of frames to be included.
613
+ //
614
+ // For example, if Foo() calls Bar(), which in turn calls
615
+ // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
616
+ // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
617
+ std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;
618
+
619
+ // Finds and returns a TestCase with the given name. If one doesn't
620
+ // exist, creates one and returns it.
621
+ //
622
+ // Arguments:
623
+ //
624
+ // test_case_name: name of the test case
625
+ // type_param: the name of the test's type parameter, or NULL if
626
+ // this is not a typed or a type-parameterized test.
627
+ // set_up_tc: pointer to the function that sets up the test case
628
+ // tear_down_tc: pointer to the function that tears down the test case
629
+ TestCase* GetTestCase(const char* test_case_name,
630
+ const char* type_param,
631
+ Test::SetUpTestCaseFunc set_up_tc,
632
+ Test::TearDownTestCaseFunc tear_down_tc);
633
+
634
+ // Adds a TestInfo to the unit test.
635
+ //
636
+ // Arguments:
637
+ //
638
+ // set_up_tc: pointer to the function that sets up the test case
639
+ // tear_down_tc: pointer to the function that tears down the test case
640
+ // test_info: the TestInfo object
641
+ void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
642
+ Test::TearDownTestCaseFunc tear_down_tc,
643
+ TestInfo* test_info) {
644
+ // In order to support thread-safe death tests, we need to
645
+ // remember the original working directory when the test program
646
+ // was first invoked. We cannot do this in RUN_ALL_TESTS(), as
647
+ // the user may have changed the current directory before calling
648
+ // RUN_ALL_TESTS(). Therefore we capture the current directory in
649
+ // AddTestInfo(), which is called to register a TEST or TEST_F
650
+ // before main() is reached.
651
+ if (original_working_dir_.IsEmpty()) {
652
+ original_working_dir_.Set(FilePath::GetCurrentDir());
653
+ GTEST_CHECK_(!original_working_dir_.IsEmpty())
654
+ << "Failed to get the current working directory.";
655
+ }
656
+
657
+ GetTestCase(test_info->test_case_name(),
658
+ test_info->type_param(),
659
+ set_up_tc,
660
+ tear_down_tc)->AddTestInfo(test_info);
661
+ }
662
+
663
+ // Returns ParameterizedTestCaseRegistry object used to keep track of
664
+ // value-parameterized tests and instantiate and register them.
665
+ internal::ParameterizedTestCaseRegistry& parameterized_test_registry() {
666
+ return parameterized_test_registry_;
667
+ }
668
+
669
+ // Sets the TestCase object for the test that's currently running.
670
+ void set_current_test_case(TestCase* a_current_test_case) {
671
+ current_test_case_ = a_current_test_case;
672
+ }
673
+
674
+ // Sets the TestInfo object for the test that's currently running. If
675
+ // current_test_info is NULL, the assertion results will be stored in
676
+ // ad_hoc_test_result_.
677
+ void set_current_test_info(TestInfo* a_current_test_info) {
678
+ current_test_info_ = a_current_test_info;
679
+ }
680
+
681
+ // Registers all parameterized tests defined using TEST_P and
682
+ // INSTANTIATE_TEST_CASE_P, creating regular tests for each test/parameter
683
+ // combination. This method can be called more then once; it has guards
684
+ // protecting from registering the tests more then once. If
685
+ // value-parameterized tests are disabled, RegisterParameterizedTests is
686
+ // present but does nothing.
687
+ void RegisterParameterizedTests();
688
+
689
+ // Runs all tests in this UnitTest object, prints the result, and
690
+ // returns true if all tests are successful. If any exception is
691
+ // thrown during a test, this test is considered to be failed, but
692
+ // the rest of the tests will still be run.
693
+ bool RunAllTests();
694
+
695
+ // Clears the results of all tests, except the ad hoc tests.
696
+ void ClearNonAdHocTestResult() {
697
+ ForEach(test_cases_, TestCase::ClearTestCaseResult);
698
+ }
699
+
700
+ // Clears the results of ad-hoc test assertions.
701
+ void ClearAdHocTestResult() {
702
+ ad_hoc_test_result_.Clear();
703
+ }
704
+
705
+ // Adds a TestProperty to the current TestResult object when invoked in a
706
+ // context of a test or a test case, or to the global property set. If the
707
+ // result already contains a property with the same key, the value will be
708
+ // updated.
709
+ void RecordProperty(const TestProperty& test_property);
710
+
711
+ enum ReactionToSharding {
712
+ HONOR_SHARDING_PROTOCOL,
713
+ IGNORE_SHARDING_PROTOCOL
714
+ };
715
+
716
+ // Matches the full name of each test against the user-specified
717
+ // filter to decide whether the test should run, then records the
718
+ // result in each TestCase and TestInfo object.
719
+ // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests
720
+ // based on sharding variables in the environment.
721
+ // Returns the number of tests that should run.
722
+ int FilterTests(ReactionToSharding shard_tests);
723
+
724
+ // Prints the names of the tests matching the user-specified filter flag.
725
+ void ListTestsMatchingFilter();
726
+
727
+ const TestCase* current_test_case() const { return current_test_case_; }
728
+ TestInfo* current_test_info() { return current_test_info_; }
729
+ const TestInfo* current_test_info() const { return current_test_info_; }
730
+
731
+ // Returns the vector of environments that need to be set-up/torn-down
732
+ // before/after the tests are run.
733
+ std::vector<Environment*>& environments() { return environments_; }
734
+
735
+ // Getters for the per-thread Google Test trace stack.
736
+ std::vector<TraceInfo>& gtest_trace_stack() {
737
+ return *(gtest_trace_stack_.pointer());
738
+ }
739
+ const std::vector<TraceInfo>& gtest_trace_stack() const {
740
+ return gtest_trace_stack_.get();
741
+ }
742
+
743
+ #if GTEST_HAS_DEATH_TEST
744
+ void InitDeathTestSubprocessControlInfo() {
745
+ internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
746
+ }
747
+ // Returns a pointer to the parsed --gtest_internal_run_death_test
748
+ // flag, or NULL if that flag was not specified.
749
+ // This information is useful only in a death test child process.
750
+ // Must not be called before a call to InitGoogleTest.
751
+ const InternalRunDeathTestFlag* internal_run_death_test_flag() const {
752
+ return internal_run_death_test_flag_.get();
753
+ }
754
+
755
+ // Returns a pointer to the current death test factory.
756
+ internal::DeathTestFactory* death_test_factory() {
757
+ return death_test_factory_.get();
758
+ }
759
+
760
+ void SuppressTestEventsIfInSubprocess();
761
+
762
+ friend class ReplaceDeathTestFactory;
763
+ #endif // GTEST_HAS_DEATH_TEST
764
+
765
+ // Initializes the event listener performing XML output as specified by
766
+ // UnitTestOptions. Must not be called before InitGoogleTest.
767
+ void ConfigureXmlOutput();
768
+
769
+ #if GTEST_CAN_STREAM_RESULTS_
770
+ // Initializes the event listener for streaming test results to a socket.
771
+ // Must not be called before InitGoogleTest.
772
+ void ConfigureStreamingOutput();
773
+ #endif
774
+
775
+ // Performs initialization dependent upon flag values obtained in
776
+ // ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to
777
+ // ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest
778
+ // this function is also called from RunAllTests. Since this function can be
779
+ // called more than once, it has to be idempotent.
780
+ void PostFlagParsingInit();
781
+
782
+ // Gets the random seed used at the start of the current test iteration.
783
+ int random_seed() const { return random_seed_; }
784
+
785
+ // Gets the random number generator.
786
+ internal::Random* random() { return &random_; }
787
+
788
+ // Shuffles all test cases, and the tests within each test case,
789
+ // making sure that death tests are still run first.
790
+ void ShuffleTests();
791
+
792
+ // Restores the test cases and tests to their order before the first shuffle.
793
+ void UnshuffleTests();
794
+
795
+ // Returns the value of GTEST_FLAG(catch_exceptions) at the moment
796
+ // UnitTest::Run() starts.
797
+ bool catch_exceptions() const { return catch_exceptions_; }
798
+
799
+ private:
800
+ friend class ::testing::UnitTest;
801
+
802
+ // Used by UnitTest::Run() to capture the state of
803
+ // GTEST_FLAG(catch_exceptions) at the moment it starts.
804
+ void set_catch_exceptions(bool value) { catch_exceptions_ = value; }
805
+
806
+ // The UnitTest object that owns this implementation object.
807
+ UnitTest* const parent_;
808
+
809
+ // The working directory when the first TEST() or TEST_F() was
810
+ // executed.
811
+ internal::FilePath original_working_dir_;
812
+
813
+ // The default test part result reporters.
814
+ DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;
815
+ DefaultPerThreadTestPartResultReporter
816
+ default_per_thread_test_part_result_reporter_;
817
+
818
+ // Points to (but doesn't own) the global test part result reporter.
819
+ TestPartResultReporterInterface* global_test_part_result_repoter_;
820
+
821
+ // Protects read and write access to global_test_part_result_reporter_.
822
+ internal::Mutex global_test_part_result_reporter_mutex_;
823
+
824
+ // Points to (but doesn't own) the per-thread test part result reporter.
825
+ internal::ThreadLocal<TestPartResultReporterInterface*>
826
+ per_thread_test_part_result_reporter_;
827
+
828
+ // The vector of environments that need to be set-up/torn-down
829
+ // before/after the tests are run.
830
+ std::vector<Environment*> environments_;
831
+
832
+ // The vector of TestCases in their original order. It owns the
833
+ // elements in the vector.
834
+ std::vector<TestCase*> test_cases_;
835
+
836
+ // Provides a level of indirection for the test case list to allow
837
+ // easy shuffling and restoring the test case order. The i-th
838
+ // element of this vector is the index of the i-th test case in the
839
+ // shuffled order.
840
+ std::vector<int> test_case_indices_;
841
+
842
+ // ParameterizedTestRegistry object used to register value-parameterized
843
+ // tests.
844
+ internal::ParameterizedTestCaseRegistry parameterized_test_registry_;
845
+
846
+ // Indicates whether RegisterParameterizedTests() has been called already.
847
+ bool parameterized_tests_registered_;
848
+
849
+ // Index of the last death test case registered. Initially -1.
850
+ int last_death_test_case_;
851
+
852
+ // This points to the TestCase for the currently running test. It
853
+ // changes as Google Test goes through one test case after another.
854
+ // When no test is running, this is set to NULL and Google Test
855
+ // stores assertion results in ad_hoc_test_result_. Initially NULL.
856
+ TestCase* current_test_case_;
857
+
858
+ // This points to the TestInfo for the currently running test. It
859
+ // changes as Google Test goes through one test after another. When
860
+ // no test is running, this is set to NULL and Google Test stores
861
+ // assertion results in ad_hoc_test_result_. Initially NULL.
862
+ TestInfo* current_test_info_;
863
+
864
+ // Normally, a user only writes assertions inside a TEST or TEST_F,
865
+ // or inside a function called by a TEST or TEST_F. Since Google
866
+ // Test keeps track of which test is current running, it can
867
+ // associate such an assertion with the test it belongs to.
868
+ //
869
+ // If an assertion is encountered when no TEST or TEST_F is running,
870
+ // Google Test attributes the assertion result to an imaginary "ad hoc"
871
+ // test, and records the result in ad_hoc_test_result_.
872
+ TestResult ad_hoc_test_result_;
873
+
874
+ // The list of event listeners that can be used to track events inside
875
+ // Google Test.
876
+ TestEventListeners listeners_;
877
+
878
+ // The OS stack trace getter. Will be deleted when the UnitTest
879
+ // object is destructed. By default, an OsStackTraceGetter is used,
880
+ // but the user can set this field to use a custom getter if that is
881
+ // desired.
882
+ OsStackTraceGetterInterface* os_stack_trace_getter_;
883
+
884
+ // True iff PostFlagParsingInit() has been called.
885
+ bool post_flag_parse_init_performed_;
886
+
887
+ // The random number seed used at the beginning of the test run.
888
+ int random_seed_;
889
+
890
+ // Our random number generator.
891
+ internal::Random random_;
892
+
893
+ // The time of the test program start, in ms from the start of the
894
+ // UNIX epoch.
895
+ TimeInMillis start_timestamp_;
896
+
897
+ // How long the test took to run, in milliseconds.
898
+ TimeInMillis elapsed_time_;
899
+
900
+ #if GTEST_HAS_DEATH_TEST
901
+ // The decomposed components of the gtest_internal_run_death_test flag,
902
+ // parsed when RUN_ALL_TESTS is called.
903
+ internal::scoped_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
904
+ internal::scoped_ptr<internal::DeathTestFactory> death_test_factory_;
905
+ #endif // GTEST_HAS_DEATH_TEST
906
+
907
+ // A per-thread stack of traces created by the SCOPED_TRACE() macro.
908
+ internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;
909
+
910
+ // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests()
911
+ // starts.
912
+ bool catch_exceptions_;
913
+
914
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);
915
+ }; // class UnitTestImpl
916
+
917
+ // Convenience function for accessing the global UnitTest
918
+ // implementation object.
919
+ inline UnitTestImpl* GetUnitTestImpl() {
920
+ return UnitTest::GetInstance()->impl();
921
+ }
922
+
923
+ #if GTEST_USES_SIMPLE_RE
924
+
925
+ // Internal helper functions for implementing the simple regular
926
+ // expression matcher.
927
+ GTEST_API_ bool IsInSet(char ch, const char* str);
928
+ GTEST_API_ bool IsAsciiDigit(char ch);
929
+ GTEST_API_ bool IsAsciiPunct(char ch);
930
+ GTEST_API_ bool IsRepeat(char ch);
931
+ GTEST_API_ bool IsAsciiWhiteSpace(char ch);
932
+ GTEST_API_ bool IsAsciiWordChar(char ch);
933
+ GTEST_API_ bool IsValidEscape(char ch);
934
+ GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);
935
+ GTEST_API_ bool ValidateRegex(const char* regex);
936
+ GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);
937
+ GTEST_API_ bool MatchRepetitionAndRegexAtHead(
938
+ bool escaped, char ch, char repeat, const char* regex, const char* str);
939
+ GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);
940
+
941
+ #endif // GTEST_USES_SIMPLE_RE
942
+
943
+ // Parses the command line for Google Test flags, without initializing
944
+ // other parts of Google Test.
945
+ GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);
946
+ GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
947
+
948
+ #if GTEST_HAS_DEATH_TEST
949
+
950
+ // Returns the message describing the last system error, regardless of the
951
+ // platform.
952
+ GTEST_API_ std::string GetLastErrnoDescription();
953
+
954
+ // Attempts to parse a string into a positive integer pointed to by the
955
+ // number parameter. Returns true if that is possible.
956
+ // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
957
+ // it here.
958
+ template <typename Integer>
959
+ bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
960
+ // Fail fast if the given string does not begin with a digit;
961
+ // this bypasses strtoXXX's "optional leading whitespace and plus
962
+ // or minus sign" semantics, which are undesirable here.
963
+ if (str.empty() || !IsDigit(str[0])) {
964
+ return false;
965
+ }
966
+ errno = 0;
967
+
968
+ char* end;
969
+ // BiggestConvertible is the largest integer type that system-provided
970
+ // string-to-number conversion routines can return.
971
+
972
+ # if GTEST_OS_WINDOWS && !defined(__GNUC__)
973
+
974
+ // MSVC and C++ Builder define __int64 instead of the standard long long.
975
+ typedef unsigned __int64 BiggestConvertible;
976
+ const BiggestConvertible parsed = _strtoui64(str.c_str(), &end, 10);
977
+
978
+ # else
979
+
980
+ typedef unsigned long long BiggestConvertible; // NOLINT
981
+ const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10);
982
+
983
+ # endif // GTEST_OS_WINDOWS && !defined(__GNUC__)
984
+
985
+ const bool parse_success = *end == '\0' && errno == 0;
986
+
987
+ // TODO(vladl@google.com): Convert this to compile time assertion when it is
988
+ // available.
989
+ GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
990
+
991
+ const Integer result = static_cast<Integer>(parsed);
992
+ if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
993
+ *number = result;
994
+ return true;
995
+ }
996
+ return false;
997
+ }
998
+ #endif // GTEST_HAS_DEATH_TEST
999
+
1000
+ // TestResult contains some private methods that should be hidden from
1001
+ // Google Test user but are required for testing. This class allow our tests
1002
+ // to access them.
1003
+ //
1004
+ // This class is supplied only for the purpose of testing Google Test's own
1005
+ // constructs. Do not use it in user tests, either directly or indirectly.
1006
+ class TestResultAccessor {
1007
+ public:
1008
+ static void RecordProperty(TestResult* test_result,
1009
+ const std::string& xml_element,
1010
+ const TestProperty& property) {
1011
+ test_result->RecordProperty(xml_element, property);
1012
+ }
1013
+
1014
+ static void ClearTestPartResults(TestResult* test_result) {
1015
+ test_result->ClearTestPartResults();
1016
+ }
1017
+
1018
+ static const std::vector<testing::TestPartResult>& test_part_results(
1019
+ const TestResult& test_result) {
1020
+ return test_result.test_part_results();
1021
+ }
1022
+ };
1023
+
1024
+ #if GTEST_CAN_STREAM_RESULTS_
1025
+
1026
+ // Streams test results to the given port on the given host machine.
1027
+ class StreamingListener : public EmptyTestEventListener {
1028
+ public:
1029
+ // Abstract base class for writing strings to a socket.
1030
+ class AbstractSocketWriter {
1031
+ public:
1032
+ virtual ~AbstractSocketWriter() {}
1033
+
1034
+ // Sends a string to the socket.
1035
+ virtual void Send(const std::string& message) = 0;
1036
+
1037
+ // Closes the socket.
1038
+ virtual void CloseConnection() {}
1039
+
1040
+ // Sends a string and a newline to the socket.
1041
+ void SendLn(const std::string& message) { Send(message + "\n"); }
1042
+ };
1043
+
1044
+ // Concrete class for actually writing strings to a socket.
1045
+ class SocketWriter : public AbstractSocketWriter {
1046
+ public:
1047
+ SocketWriter(const std::string& host, const std::string& port)
1048
+ : sockfd_(-1), host_name_(host), port_num_(port) {
1049
+ MakeConnection();
1050
+ }
1051
+
1052
+ virtual ~SocketWriter() {
1053
+ if (sockfd_ != -1)
1054
+ CloseConnection();
1055
+ }
1056
+
1057
+ // Sends a string to the socket.
1058
+ virtual void Send(const std::string& message) {
1059
+ GTEST_CHECK_(sockfd_ != -1)
1060
+ << "Send() can be called only when there is a connection.";
1061
+
1062
+ const int len = static_cast<int>(message.length());
1063
+ if (write(sockfd_, message.c_str(), len) != len) {
1064
+ GTEST_LOG_(WARNING)
1065
+ << "stream_result_to: failed to stream to "
1066
+ << host_name_ << ":" << port_num_;
1067
+ }
1068
+ }
1069
+
1070
+ private:
1071
+ // Creates a client socket and connects to the server.
1072
+ void MakeConnection();
1073
+
1074
+ // Closes the socket.
1075
+ void CloseConnection() {
1076
+ GTEST_CHECK_(sockfd_ != -1)
1077
+ << "CloseConnection() can be called only when there is a connection.";
1078
+
1079
+ close(sockfd_);
1080
+ sockfd_ = -1;
1081
+ }
1082
+
1083
+ int sockfd_; // socket file descriptor
1084
+ const std::string host_name_;
1085
+ const std::string port_num_;
1086
+
1087
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter);
1088
+ }; // class SocketWriter
1089
+
1090
+ // Escapes '=', '&', '%', and '\n' characters in str as "%xx".
1091
+ static std::string UrlEncode(const char* str);
1092
+
1093
+ StreamingListener(const std::string& host, const std::string& port)
1094
+ : socket_writer_(new SocketWriter(host, port)) {
1095
+ Start();
1096
+ }
1097
+
1098
+ explicit StreamingListener(AbstractSocketWriter* socket_writer)
1099
+ : socket_writer_(socket_writer) { Start(); }
1100
+
1101
+ void OnTestProgramStart(const UnitTest& /* unit_test */) {
1102
+ SendLn("event=TestProgramStart");
1103
+ }
1104
+
1105
+ void OnTestProgramEnd(const UnitTest& unit_test) {
1106
+ // Note that Google Test current only report elapsed time for each
1107
+ // test iteration, not for the entire test program.
1108
+ SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
1109
+
1110
+ // Notify the streaming server to stop.
1111
+ socket_writer_->CloseConnection();
1112
+ }
1113
+
1114
+ void OnTestIterationStart(const UnitTest& /* unit_test */, int iteration) {
1115
+ SendLn("event=TestIterationStart&iteration=" +
1116
+ StreamableToString(iteration));
1117
+ }
1118
+
1119
+ void OnTestIterationEnd(const UnitTest& unit_test, int /* iteration */) {
1120
+ SendLn("event=TestIterationEnd&passed=" +
1121
+ FormatBool(unit_test.Passed()) + "&elapsed_time=" +
1122
+ StreamableToString(unit_test.elapsed_time()) + "ms");
1123
+ }
1124
+
1125
+ void OnTestCaseStart(const TestCase& test_case) {
1126
+ SendLn(std::string("event=TestCaseStart&name=") + test_case.name());
1127
+ }
1128
+
1129
+ void OnTestCaseEnd(const TestCase& test_case) {
1130
+ SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed())
1131
+ + "&elapsed_time=" + StreamableToString(test_case.elapsed_time())
1132
+ + "ms");
1133
+ }
1134
+
1135
+ void OnTestStart(const TestInfo& test_info) {
1136
+ SendLn(std::string("event=TestStart&name=") + test_info.name());
1137
+ }
1138
+
1139
+ void OnTestEnd(const TestInfo& test_info) {
1140
+ SendLn("event=TestEnd&passed=" +
1141
+ FormatBool((test_info.result())->Passed()) +
1142
+ "&elapsed_time=" +
1143
+ StreamableToString((test_info.result())->elapsed_time()) + "ms");
1144
+ }
1145
+
1146
+ void OnTestPartResult(const TestPartResult& test_part_result) {
1147
+ const char* file_name = test_part_result.file_name();
1148
+ if (file_name == NULL)
1149
+ file_name = "";
1150
+ SendLn("event=TestPartResult&file=" + UrlEncode(file_name) +
1151
+ "&line=" + StreamableToString(test_part_result.line_number()) +
1152
+ "&message=" + UrlEncode(test_part_result.message()));
1153
+ }
1154
+
1155
+ private:
1156
+ // Sends the given message and a newline to the socket.
1157
+ void SendLn(const std::string& message) { socket_writer_->SendLn(message); }
1158
+
1159
+ // Called at the start of streaming to notify the receiver what
1160
+ // protocol we are using.
1161
+ void Start() { SendLn("gtest_streaming_protocol_version=1.0"); }
1162
+
1163
+ std::string FormatBool(bool value) { return value ? "1" : "0"; }
1164
+
1165
+ const scoped_ptr<AbstractSocketWriter> socket_writer_;
1166
+
1167
+ GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);
1168
+ }; // class StreamingListener
1169
+
1170
+ #endif // GTEST_CAN_STREAM_RESULTS_
1171
+
1172
+ } // namespace internal
1173
+ } // namespace testing
1174
+
1175
+ #endif // GTEST_SRC_GTEST_INTERNAL_INL_H_