@eosrio/node-abieos 2.1.0-beta.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (740) hide show
  1. package/README.md +4 -1
  2. package/dist/abieos.node +0 -0
  3. package/lib/abieos.d.ts +19 -0
  4. package/lib/abieos.d.ts.map +1 -0
  5. package/lib/abieos.js +100 -0
  6. package/lib/abieos.ts +107 -0
  7. package/package.json +13 -8
  8. package/.gitmodules +0 -6
  9. package/.idea/misc.xml +0 -6
  10. package/.idea/modules.xml +0 -8
  11. package/.idea/node-abieos.iml +0 -12
  12. package/.idea/vcs.xml +0 -9
  13. package/.idea/workspace.xml +0 -266
  14. package/CMakeLists.txt +0 -35
  15. package/abieos.d.ts +0 -21
  16. package/abieos.js +0 -59
  17. package/eosio.json +0 -1596
  18. package/external/date/CMakeLists.txt +0 -175
  19. package/external/date/LICENSE.txt +0 -31
  20. package/external/date/README.md +0 -61
  21. package/external/date/compile_fail.sh +0 -16
  22. package/external/date/include/date/chrono_io.h +0 -34
  23. package/external/date/include/date/date.h +0 -8335
  24. package/external/date/include/date/ios.h +0 -50
  25. package/external/date/include/date/islamic.h +0 -3031
  26. package/external/date/include/date/iso_week.h +0 -1745
  27. package/external/date/include/date/julian.h +0 -3046
  28. package/external/date/include/date/ptz.h +0 -592
  29. package/external/date/include/date/tz.h +0 -2760
  30. package/external/date/include/date/tz_private.h +0 -318
  31. package/external/date/src/ios.mm +0 -337
  32. package/external/date/src/tz.cpp +0 -3801
  33. package/external/date/test/clock_cast_test/custom_clock.pass.cpp +0 -213
  34. package/external/date/test/clock_cast_test/deprecated.pass.cpp +0 -90
  35. package/external/date/test/clock_cast_test/local_t.pass.cpp +0 -132
  36. package/external/date/test/clock_cast_test/noncastable.pass.cpp +0 -251
  37. package/external/date/test/clock_cast_test/normal_clocks.pass.cpp +0 -102
  38. package/external/date/test/clock_cast_test/to_sys_return_int.fail.cpp +0 -49
  39. package/external/date/test/clock_cast_test/to_sys_return_reference.fail.cpp +0 -51
  40. package/external/date/test/clock_cast_test/to_sys_return_utc_time.fail.cpp +0 -49
  41. package/external/date/test/date_test/day.pass.cpp +0 -143
  42. package/external/date/test/date_test/daypday.fail.cpp +0 -32
  43. package/external/date/test/date_test/daysmday.fail.cpp +0 -32
  44. package/external/date/test/date_test/daysmweekday.fail.cpp +0 -32
  45. package/external/date/test/date_test/detail/decimal_format_seconds.pass.cpp +0 -145
  46. package/external/date/test/date_test/detail/make_precision.pass.cpp +0 -63
  47. package/external/date/test/date_test/detail/static_pow10.pass.cpp +0 -50
  48. package/external/date/test/date_test/detail/width.pass.cpp +0 -64
  49. package/external/date/test/date_test/durations.pass.cpp +0 -62
  50. package/external/date/test/date_test/durations_output.pass.cpp +0 -328
  51. package/external/date/test/date_test/format/century.pass.cpp +0 -117
  52. package/external/date/test/date_test/format/misc.pass.cpp +0 -52
  53. package/external/date/test/date_test/format/range.pass.cpp +0 -78
  54. package/external/date/test/date_test/format/two_dight_year.pass.cpp +0 -121
  55. package/external/date/test/date_test/last.pass.cpp +0 -34
  56. package/external/date/test/date_test/make_time.pass.cpp +0 -164
  57. package/external/date/test/date_test/month.pass.cpp +0 -181
  58. package/external/date/test/date_test/month_day.pass.cpp +0 -82
  59. package/external/date/test/date_test/month_day_last.pass.cpp +0 -75
  60. package/external/date/test/date_test/month_weekday.pass.cpp +0 -77
  61. package/external/date/test/date_test/month_weekday_last.pass.cpp +0 -77
  62. package/external/date/test/date_test/month_weekday_last_less.fail.cpp +0 -34
  63. package/external/date/test/date_test/month_weekday_less.fail.cpp +0 -34
  64. package/external/date/test/date_test/monthpmonth.fail.cpp +0 -32
  65. package/external/date/test/date_test/months_m_year_month.fail.cpp +0 -33
  66. package/external/date/test/date_test/months_m_year_month_day.fail.cpp +0 -33
  67. package/external/date/test/date_test/monthsmmonth.fail.cpp +0 -32
  68. package/external/date/test/date_test/multi_year_duration_addition.pass.cpp +0 -297
  69. package/external/date/test/date_test/op_div_day_day.fail.cpp +0 -33
  70. package/external/date/test/date_test/op_div_int_month.fail.cpp +0 -33
  71. package/external/date/test/date_test/op_div_int_year.fail.cpp +0 -33
  72. package/external/date/test/date_test/op_div_last_last.fail.cpp +0 -33
  73. package/external/date/test/date_test/op_div_month_day.pass.cpp +0 -41
  74. package/external/date/test/date_test/op_div_month_day_last.pass.cpp +0 -39
  75. package/external/date/test/date_test/op_div_month_day_month_day.fail.cpp +0 -33
  76. package/external/date/test/date_test/op_div_month_month.fail.cpp +0 -33
  77. package/external/date/test/date_test/op_div_month_weekday.pass.cpp +0 -39
  78. package/external/date/test/date_test/op_div_month_weekday_last.pass.cpp +0 -39
  79. package/external/date/test/date_test/op_div_month_year.fail.cpp +0 -33
  80. package/external/date/test/date_test/op_div_survey.pass.cpp +0 -437
  81. package/external/date/test/date_test/op_div_weekday_indexed_weekday_indexed.fail.cpp +0 -33
  82. package/external/date/test/date_test/op_div_weekday_last_weekday_last.fail.cpp +0 -33
  83. package/external/date/test/date_test/op_div_year_month.pass.cpp +0 -35
  84. package/external/date/test/date_test/op_div_year_month_day.pass.cpp +0 -43
  85. package/external/date/test/date_test/op_div_year_month_day_last.pass.cpp +0 -41
  86. package/external/date/test/date_test/op_div_year_month_weekday.pass.cpp +0 -41
  87. package/external/date/test/date_test/op_div_year_month_weekday_last.pass.cpp +0 -41
  88. package/external/date/test/date_test/op_div_year_month_year_month.fail.cpp +0 -33
  89. package/external/date/test/date_test/op_div_year_year.fail.cpp +0 -33
  90. package/external/date/test/date_test/parse.pass.cpp +0 -904
  91. package/external/date/test/date_test/sizeof.pass.cpp +0 -62
  92. package/external/date/test/date_test/time_of_day_hours.pass.cpp +0 -104
  93. package/external/date/test/date_test/time_of_day_microfortnights.pass.cpp +0 -119
  94. package/external/date/test/date_test/time_of_day_milliseconds.pass.cpp +0 -126
  95. package/external/date/test/date_test/time_of_day_minutes.pass.cpp +0 -110
  96. package/external/date/test/date_test/time_of_day_nanoseconds.pass.cpp +0 -126
  97. package/external/date/test/date_test/time_of_day_seconds.pass.cpp +0 -116
  98. package/external/date/test/date_test/weekday.pass.cpp +0 -201
  99. package/external/date/test/date_test/weekday_indexed.pass.cpp +0 -70
  100. package/external/date/test/date_test/weekday_last.pass.cpp +0 -66
  101. package/external/date/test/date_test/weekday_lessthan.fail.cpp +0 -32
  102. package/external/date/test/date_test/weekday_sum.fail.cpp +0 -32
  103. package/external/date/test/date_test/year.pass.cpp +0 -146
  104. package/external/date/test/date_test/year_month.pass.cpp +0 -142
  105. package/external/date/test/date_test/year_month_day.pass.cpp +0 -244
  106. package/external/date/test/date_test/year_month_day_last.pass.cpp +0 -177
  107. package/external/date/test/date_test/year_month_day_m_year_month_day.fail.cpp +0 -33
  108. package/external/date/test/date_test/year_month_day_p_year_month_day.fail.cpp +0 -33
  109. package/external/date/test/date_test/year_month_p_year_month.fail.cpp +0 -33
  110. package/external/date/test/date_test/year_month_weekday.pass.cpp +0 -178
  111. package/external/date/test/date_test/year_month_weekday_last.pass.cpp +0 -169
  112. package/external/date/test/date_test/year_p_year.fail.cpp +0 -32
  113. package/external/date/test/date_test/years_m_year.fail.cpp +0 -32
  114. package/external/date/test/date_test/years_m_year_month.fail.cpp +0 -33
  115. package/external/date/test/date_test/years_m_year_month_day.fail.cpp +0 -33
  116. package/external/date/test/iso_week/last.pass.cpp +0 -34
  117. package/external/date/test/iso_week/lastweek_weekday.pass.cpp +0 -82
  118. package/external/date/test/iso_week/op_div_survey.pass.cpp +0 -196
  119. package/external/date/test/iso_week/weekday.pass.cpp +0 -227
  120. package/external/date/test/iso_week/weekday_lessthan.fail.cpp +0 -32
  121. package/external/date/test/iso_week/weekday_sum.fail.cpp +0 -32
  122. package/external/date/test/iso_week/weeknum.pass.cpp +0 -121
  123. package/external/date/test/iso_week/weeknum_p_weeknum.fail.cpp +0 -32
  124. package/external/date/test/iso_week/weeknum_weekday.pass.cpp +0 -86
  125. package/external/date/test/iso_week/year.pass.cpp +0 -120
  126. package/external/date/test/iso_week/year_lastweek.pass.cpp +0 -97
  127. package/external/date/test/iso_week/year_lastweek_weekday.pass.cpp +0 -129
  128. package/external/date/test/iso_week/year_p_year.fail.cpp +0 -32
  129. package/external/date/test/iso_week/year_weeknum.pass.cpp +0 -97
  130. package/external/date/test/iso_week/year_weeknum_weekday.pass.cpp +0 -139
  131. package/external/date/test/iso_week/years_m_year.fail.cpp +0 -32
  132. package/external/date/test/just.pass.cpp +0 -26
  133. package/external/date/test/testit +0 -177
  134. package/external/date/test/tz_test/OffsetZone.pass.cpp +0 -81
  135. package/external/date/test/tz_test/README.md +0 -22
  136. package/external/date/test/tz_test/tzdata2015e.txt.zip +0 -0
  137. package/external/date/test/tz_test/tzdata2015f.txt.zip +0 -0
  138. package/external/date/test/tz_test/tzdata2016c.txt.zip +0 -0
  139. package/external/date/test/tz_test/tzdata2016d.txt.zip +0 -0
  140. package/external/date/test/tz_test/tzdata2016e.txt.zip +0 -0
  141. package/external/date/test/tz_test/tzdata2016f.txt.zip +0 -0
  142. package/external/date/test/tz_test/validate.cpp +0 -165
  143. package/external/date/test/tz_test/zone.pass.cpp +0 -37
  144. package/external/date/test/tz_test/zoned_time.pass.cpp +0 -464
  145. package/external/date/test_fail.sh +0 -10
  146. package/external/rapidjson/.gitattributes +0 -22
  147. package/external/rapidjson/.gitmodules +0 -3
  148. package/external/rapidjson/.travis.yml +0 -99
  149. package/external/rapidjson/CHANGELOG.md +0 -158
  150. package/external/rapidjson/CMakeLists.txt +0 -221
  151. package/external/rapidjson/CMakeModules/FindGTestSrc.cmake +0 -30
  152. package/external/rapidjson/RapidJSON.pc.in +0 -7
  153. package/external/rapidjson/RapidJSONConfig.cmake.in +0 -15
  154. package/external/rapidjson/RapidJSONConfigVersion.cmake.in +0 -10
  155. package/external/rapidjson/appveyor.yml +0 -54
  156. package/external/rapidjson/bin/data/glossary.json +0 -22
  157. package/external/rapidjson/bin/data/menu.json +0 -27
  158. package/external/rapidjson/bin/data/readme.txt +0 -1
  159. package/external/rapidjson/bin/data/sample.json +0 -3315
  160. package/external/rapidjson/bin/data/webapp.json +0 -88
  161. package/external/rapidjson/bin/data/widget.json +0 -26
  162. package/external/rapidjson/bin/encodings/utf16be.json +0 -0
  163. package/external/rapidjson/bin/encodings/utf16bebom.json +0 -0
  164. package/external/rapidjson/bin/encodings/utf16le.json +0 -0
  165. package/external/rapidjson/bin/encodings/utf16lebom.json +0 -0
  166. package/external/rapidjson/bin/encodings/utf32be.json +0 -0
  167. package/external/rapidjson/bin/encodings/utf32bebom.json +0 -0
  168. package/external/rapidjson/bin/encodings/utf32le.json +0 -0
  169. package/external/rapidjson/bin/encodings/utf32lebom.json +0 -0
  170. package/external/rapidjson/bin/encodings/utf8.json +0 -7
  171. package/external/rapidjson/bin/encodings/utf8bom.json +0 -7
  172. package/external/rapidjson/bin/jsonchecker/fail1.json +0 -1
  173. package/external/rapidjson/bin/jsonchecker/fail10.json +0 -1
  174. package/external/rapidjson/bin/jsonchecker/fail11.json +0 -1
  175. package/external/rapidjson/bin/jsonchecker/fail12.json +0 -1
  176. package/external/rapidjson/bin/jsonchecker/fail13.json +0 -1
  177. package/external/rapidjson/bin/jsonchecker/fail14.json +0 -1
  178. package/external/rapidjson/bin/jsonchecker/fail15.json +0 -1
  179. package/external/rapidjson/bin/jsonchecker/fail16.json +0 -1
  180. package/external/rapidjson/bin/jsonchecker/fail17.json +0 -1
  181. package/external/rapidjson/bin/jsonchecker/fail18.json +0 -1
  182. package/external/rapidjson/bin/jsonchecker/fail19.json +0 -1
  183. package/external/rapidjson/bin/jsonchecker/fail2.json +0 -1
  184. package/external/rapidjson/bin/jsonchecker/fail20.json +0 -1
  185. package/external/rapidjson/bin/jsonchecker/fail21.json +0 -1
  186. package/external/rapidjson/bin/jsonchecker/fail22.json +0 -1
  187. package/external/rapidjson/bin/jsonchecker/fail23.json +0 -1
  188. package/external/rapidjson/bin/jsonchecker/fail24.json +0 -1
  189. package/external/rapidjson/bin/jsonchecker/fail25.json +0 -1
  190. package/external/rapidjson/bin/jsonchecker/fail26.json +0 -1
  191. package/external/rapidjson/bin/jsonchecker/fail27.json +0 -2
  192. package/external/rapidjson/bin/jsonchecker/fail28.json +0 -2
  193. package/external/rapidjson/bin/jsonchecker/fail29.json +0 -1
  194. package/external/rapidjson/bin/jsonchecker/fail3.json +0 -1
  195. package/external/rapidjson/bin/jsonchecker/fail30.json +0 -1
  196. package/external/rapidjson/bin/jsonchecker/fail31.json +0 -1
  197. package/external/rapidjson/bin/jsonchecker/fail32.json +0 -1
  198. package/external/rapidjson/bin/jsonchecker/fail33.json +0 -1
  199. package/external/rapidjson/bin/jsonchecker/fail4.json +0 -1
  200. package/external/rapidjson/bin/jsonchecker/fail5.json +0 -1
  201. package/external/rapidjson/bin/jsonchecker/fail6.json +0 -1
  202. package/external/rapidjson/bin/jsonchecker/fail7.json +0 -1
  203. package/external/rapidjson/bin/jsonchecker/fail8.json +0 -1
  204. package/external/rapidjson/bin/jsonchecker/fail9.json +0 -1
  205. package/external/rapidjson/bin/jsonchecker/pass1.json +0 -58
  206. package/external/rapidjson/bin/jsonchecker/pass2.json +0 -1
  207. package/external/rapidjson/bin/jsonchecker/pass3.json +0 -6
  208. package/external/rapidjson/bin/jsonchecker/readme.txt +0 -3
  209. package/external/rapidjson/bin/types/booleans.json +0 -102
  210. package/external/rapidjson/bin/types/floats.json +0 -102
  211. package/external/rapidjson/bin/types/guids.json +0 -102
  212. package/external/rapidjson/bin/types/integers.json +0 -102
  213. package/external/rapidjson/bin/types/mixed.json +0 -592
  214. package/external/rapidjson/bin/types/nulls.json +0 -102
  215. package/external/rapidjson/bin/types/paragraphs.json +0 -102
  216. package/external/rapidjson/bin/types/readme.txt +0 -1
  217. package/external/rapidjson/contrib/natvis/LICENSE +0 -45
  218. package/external/rapidjson/contrib/natvis/README.md +0 -7
  219. package/external/rapidjson/contrib/natvis/rapidjson.natvis +0 -38
  220. package/external/rapidjson/doc/CMakeLists.txt +0 -27
  221. package/external/rapidjson/doc/Doxyfile.in +0 -2369
  222. package/external/rapidjson/doc/Doxyfile.zh-cn.in +0 -2369
  223. package/external/rapidjson/doc/diagram/architecture.dot +0 -50
  224. package/external/rapidjson/doc/diagram/architecture.png +0 -0
  225. package/external/rapidjson/doc/diagram/insituparsing.dot +0 -65
  226. package/external/rapidjson/doc/diagram/insituparsing.png +0 -0
  227. package/external/rapidjson/doc/diagram/iterative-parser-states-diagram.dot +0 -62
  228. package/external/rapidjson/doc/diagram/iterative-parser-states-diagram.png +0 -0
  229. package/external/rapidjson/doc/diagram/move1.dot +0 -47
  230. package/external/rapidjson/doc/diagram/move1.png +0 -0
  231. package/external/rapidjson/doc/diagram/move2.dot +0 -62
  232. package/external/rapidjson/doc/diagram/move2.png +0 -0
  233. package/external/rapidjson/doc/diagram/move3.dot +0 -60
  234. package/external/rapidjson/doc/diagram/move3.png +0 -0
  235. package/external/rapidjson/doc/diagram/normalparsing.dot +0 -56
  236. package/external/rapidjson/doc/diagram/normalparsing.png +0 -0
  237. package/external/rapidjson/doc/diagram/simpledom.dot +0 -54
  238. package/external/rapidjson/doc/diagram/simpledom.png +0 -0
  239. package/external/rapidjson/doc/diagram/tutorial.dot +0 -58
  240. package/external/rapidjson/doc/diagram/tutorial.png +0 -0
  241. package/external/rapidjson/doc/diagram/utilityclass.dot +0 -73
  242. package/external/rapidjson/doc/diagram/utilityclass.png +0 -0
  243. package/external/rapidjson/doc/dom.md +0 -280
  244. package/external/rapidjson/doc/dom.zh-cn.md +0 -284
  245. package/external/rapidjson/doc/encoding.md +0 -146
  246. package/external/rapidjson/doc/encoding.zh-cn.md +0 -152
  247. package/external/rapidjson/doc/faq.md +0 -289
  248. package/external/rapidjson/doc/faq.zh-cn.md +0 -290
  249. package/external/rapidjson/doc/features.md +0 -104
  250. package/external/rapidjson/doc/features.zh-cn.md +0 -103
  251. package/external/rapidjson/doc/internals.md +0 -368
  252. package/external/rapidjson/doc/internals.zh-cn.md +0 -363
  253. package/external/rapidjson/doc/logo/rapidjson.png +0 -0
  254. package/external/rapidjson/doc/logo/rapidjson.svg +0 -119
  255. package/external/rapidjson/doc/misc/DoxygenLayout.xml +0 -194
  256. package/external/rapidjson/doc/misc/doxygenextra.css +0 -274
  257. package/external/rapidjson/doc/misc/footer.html +0 -11
  258. package/external/rapidjson/doc/misc/header.html +0 -24
  259. package/external/rapidjson/doc/npm.md +0 -31
  260. package/external/rapidjson/doc/performance.md +0 -26
  261. package/external/rapidjson/doc/performance.zh-cn.md +0 -26
  262. package/external/rapidjson/doc/pointer.md +0 -234
  263. package/external/rapidjson/doc/pointer.zh-cn.md +0 -234
  264. package/external/rapidjson/doc/sax.md +0 -509
  265. package/external/rapidjson/doc/sax.zh-cn.md +0 -487
  266. package/external/rapidjson/doc/schema.md +0 -505
  267. package/external/rapidjson/doc/schema.zh-cn.md +0 -237
  268. package/external/rapidjson/doc/stream.md +0 -429
  269. package/external/rapidjson/doc/stream.zh-cn.md +0 -429
  270. package/external/rapidjson/doc/tutorial.md +0 -536
  271. package/external/rapidjson/doc/tutorial.zh-cn.md +0 -535
  272. package/external/rapidjson/docker/debian/Dockerfile +0 -8
  273. package/external/rapidjson/example/CMakeLists.txt +0 -45
  274. package/external/rapidjson/example/archiver/archiver.cpp +0 -292
  275. package/external/rapidjson/example/archiver/archiver.h +0 -145
  276. package/external/rapidjson/example/archiver/archivertest.cpp +0 -287
  277. package/external/rapidjson/example/capitalize/capitalize.cpp +0 -67
  278. package/external/rapidjson/example/condense/condense.cpp +0 -32
  279. package/external/rapidjson/example/filterkey/filterkey.cpp +0 -135
  280. package/external/rapidjson/example/filterkeydom/filterkeydom.cpp +0 -170
  281. package/external/rapidjson/example/jsonx/jsonx.cpp +0 -207
  282. package/external/rapidjson/example/lookaheadparser/lookaheadparser.cpp +0 -350
  283. package/external/rapidjson/example/messagereader/messagereader.cpp +0 -105
  284. package/external/rapidjson/example/parsebyparts/parsebyparts.cpp +0 -176
  285. package/external/rapidjson/example/pretty/pretty.cpp +0 -30
  286. package/external/rapidjson/example/prettyauto/prettyauto.cpp +0 -56
  287. package/external/rapidjson/example/schemavalidator/schemavalidator.cpp +0 -78
  288. package/external/rapidjson/example/serialize/serialize.cpp +0 -173
  289. package/external/rapidjson/example/simpledom/simpledom.cpp +0 -29
  290. package/external/rapidjson/example/simplepullreader/simplepullreader.cpp +0 -53
  291. package/external/rapidjson/example/simplereader/simplereader.cpp +0 -42
  292. package/external/rapidjson/example/simplewriter/simplewriter.cpp +0 -36
  293. package/external/rapidjson/example/tutorial/tutorial.cpp +0 -151
  294. package/external/rapidjson/include/rapidjson/allocators.h +0 -284
  295. package/external/rapidjson/include/rapidjson/cursorstreamwrapper.h +0 -78
  296. package/external/rapidjson/include/rapidjson/document.h +0 -2646
  297. package/external/rapidjson/include/rapidjson/encodedstream.h +0 -299
  298. package/external/rapidjson/include/rapidjson/encodings.h +0 -716
  299. package/external/rapidjson/include/rapidjson/error/en.h +0 -74
  300. package/external/rapidjson/include/rapidjson/error/error.h +0 -161
  301. package/external/rapidjson/include/rapidjson/filereadstream.h +0 -99
  302. package/external/rapidjson/include/rapidjson/filewritestream.h +0 -104
  303. package/external/rapidjson/include/rapidjson/fwd.h +0 -151
  304. package/external/rapidjson/include/rapidjson/internal/biginteger.h +0 -290
  305. package/external/rapidjson/include/rapidjson/internal/diyfp.h +0 -271
  306. package/external/rapidjson/include/rapidjson/internal/dtoa.h +0 -245
  307. package/external/rapidjson/include/rapidjson/internal/ieee754.h +0 -78
  308. package/external/rapidjson/include/rapidjson/internal/itoa.h +0 -308
  309. package/external/rapidjson/include/rapidjson/internal/meta.h +0 -186
  310. package/external/rapidjson/include/rapidjson/internal/pow10.h +0 -55
  311. package/external/rapidjson/include/rapidjson/internal/regex.h +0 -732
  312. package/external/rapidjson/include/rapidjson/internal/stack.h +0 -231
  313. package/external/rapidjson/include/rapidjson/internal/strfunc.h +0 -69
  314. package/external/rapidjson/include/rapidjson/internal/strtod.h +0 -290
  315. package/external/rapidjson/include/rapidjson/internal/swap.h +0 -46
  316. package/external/rapidjson/include/rapidjson/istreamwrapper.h +0 -113
  317. package/external/rapidjson/include/rapidjson/memorybuffer.h +0 -70
  318. package/external/rapidjson/include/rapidjson/memorystream.h +0 -71
  319. package/external/rapidjson/include/rapidjson/msinttypes/inttypes.h +0 -316
  320. package/external/rapidjson/include/rapidjson/msinttypes/stdint.h +0 -300
  321. package/external/rapidjson/include/rapidjson/ostreamwrapper.h +0 -81
  322. package/external/rapidjson/include/rapidjson/pointer.h +0 -1357
  323. package/external/rapidjson/include/rapidjson/prettywriter.h +0 -277
  324. package/external/rapidjson/include/rapidjson/rapidjson.h +0 -654
  325. package/external/rapidjson/include/rapidjson/reader.h +0 -2230
  326. package/external/rapidjson/include/rapidjson/schema.h +0 -2494
  327. package/external/rapidjson/include/rapidjson/stream.h +0 -223
  328. package/external/rapidjson/include/rapidjson/stringbuffer.h +0 -121
  329. package/external/rapidjson/include/rapidjson/writer.h +0 -710
  330. package/external/rapidjson/include_dirs.js +0 -2
  331. package/external/rapidjson/library.json +0 -15
  332. package/external/rapidjson/license.txt +0 -57
  333. package/external/rapidjson/package.json +0 -24
  334. package/external/rapidjson/rapidjson.autopkg +0 -77
  335. package/external/rapidjson/readme.md +0 -160
  336. package/external/rapidjson/readme.zh-cn.md +0 -152
  337. package/external/rapidjson/test/CMakeLists.txt +0 -20
  338. package/external/rapidjson/test/perftest/CMakeLists.txt +0 -28
  339. package/external/rapidjson/test/perftest/misctest.cpp +0 -974
  340. package/external/rapidjson/test/perftest/perftest.cpp +0 -24
  341. package/external/rapidjson/test/perftest/perftest.h +0 -185
  342. package/external/rapidjson/test/perftest/platformtest.cpp +0 -166
  343. package/external/rapidjson/test/perftest/rapidjsontest.cpp +0 -472
  344. package/external/rapidjson/test/perftest/schematest.cpp +0 -223
  345. package/external/rapidjson/test/unittest/CMakeLists.txt +0 -92
  346. package/external/rapidjson/test/unittest/allocatorstest.cpp +0 -100
  347. package/external/rapidjson/test/unittest/bigintegertest.cpp +0 -138
  348. package/external/rapidjson/test/unittest/cursorstreamwrappertest.cpp +0 -115
  349. package/external/rapidjson/test/unittest/documenttest.cpp +0 -672
  350. package/external/rapidjson/test/unittest/dtoatest.cpp +0 -98
  351. package/external/rapidjson/test/unittest/encodedstreamtest.cpp +0 -313
  352. package/external/rapidjson/test/unittest/encodingstest.cpp +0 -451
  353. package/external/rapidjson/test/unittest/filestreamtest.cpp +0 -112
  354. package/external/rapidjson/test/unittest/fwdtest.cpp +0 -230
  355. package/external/rapidjson/test/unittest/istreamwrappertest.cpp +0 -181
  356. package/external/rapidjson/test/unittest/itoatest.cpp +0 -160
  357. package/external/rapidjson/test/unittest/jsoncheckertest.cpp +0 -143
  358. package/external/rapidjson/test/unittest/namespacetest.cpp +0 -70
  359. package/external/rapidjson/test/unittest/ostreamwrappertest.cpp +0 -92
  360. package/external/rapidjson/test/unittest/pointertest.cpp +0 -1529
  361. package/external/rapidjson/test/unittest/prettywritertest.cpp +0 -373
  362. package/external/rapidjson/test/unittest/readertest.cpp +0 -2190
  363. package/external/rapidjson/test/unittest/regextest.cpp +0 -638
  364. package/external/rapidjson/test/unittest/schematest.cpp +0 -2072
  365. package/external/rapidjson/test/unittest/simdtest.cpp +0 -219
  366. package/external/rapidjson/test/unittest/strfunctest.cpp +0 -30
  367. package/external/rapidjson/test/unittest/stringbuffertest.cpp +0 -192
  368. package/external/rapidjson/test/unittest/strtodtest.cpp +0 -132
  369. package/external/rapidjson/test/unittest/unittest.cpp +0 -51
  370. package/external/rapidjson/test/unittest/unittest.h +0 -140
  371. package/external/rapidjson/test/unittest/valuetest.cpp +0 -1851
  372. package/external/rapidjson/test/unittest/writertest.cpp +0 -598
  373. package/external/rapidjson/test/valgrind.supp +0 -17
  374. package/external/rapidjson/thirdparty/gtest/.travis.yml +0 -81
  375. package/external/rapidjson/thirdparty/gtest/BUILD.bazel +0 -175
  376. package/external/rapidjson/thirdparty/gtest/CMakeLists.txt +0 -33
  377. package/external/rapidjson/thirdparty/gtest/CONTRIBUTING.md +0 -160
  378. package/external/rapidjson/thirdparty/gtest/LICENSE +0 -28
  379. package/external/rapidjson/thirdparty/gtest/Makefile.am +0 -14
  380. package/external/rapidjson/thirdparty/gtest/README.md +0 -122
  381. package/external/rapidjson/thirdparty/gtest/WORKSPACE +0 -8
  382. package/external/rapidjson/thirdparty/gtest/appveyor.yml +0 -104
  383. package/external/rapidjson/thirdparty/gtest/ci/build-linux-autotools.sh +0 -44
  384. package/external/rapidjson/thirdparty/gtest/ci/build-linux-bazel.sh +0 -36
  385. package/external/rapidjson/thirdparty/gtest/ci/env-linux.sh +0 -41
  386. package/external/rapidjson/thirdparty/gtest/ci/env-osx.sh +0 -40
  387. package/external/rapidjson/thirdparty/gtest/ci/get-nprocessors.sh +0 -48
  388. package/external/rapidjson/thirdparty/gtest/ci/install-linux.sh +0 -49
  389. package/external/rapidjson/thirdparty/gtest/ci/install-osx.sh +0 -39
  390. package/external/rapidjson/thirdparty/gtest/ci/log-config.sh +0 -51
  391. package/external/rapidjson/thirdparty/gtest/ci/travis.sh +0 -44
  392. package/external/rapidjson/thirdparty/gtest/configure.ac +0 -16
  393. package/external/rapidjson/thirdparty/gtest/googlemock/CHANGES +0 -126
  394. package/external/rapidjson/thirdparty/gtest/googlemock/CMakeLists.txt +0 -242
  395. package/external/rapidjson/thirdparty/gtest/googlemock/CONTRIBUTORS +0 -40
  396. package/external/rapidjson/thirdparty/gtest/googlemock/LICENSE +0 -28
  397. package/external/rapidjson/thirdparty/gtest/googlemock/Makefile.am +0 -224
  398. package/external/rapidjson/thirdparty/gtest/googlemock/README.md +0 -344
  399. package/external/rapidjson/thirdparty/gtest/googlemock/build-aux/.keep +0 -0
  400. package/external/rapidjson/thirdparty/gtest/googlemock/cmake/gmock.pc.in +0 -9
  401. package/external/rapidjson/thirdparty/gtest/googlemock/cmake/gmock_main.pc.in +0 -9
  402. package/external/rapidjson/thirdparty/gtest/googlemock/configure.ac +0 -146
  403. package/external/rapidjson/thirdparty/gtest/googlemock/docs/CheatSheet.md +0 -564
  404. package/external/rapidjson/thirdparty/gtest/googlemock/docs/CookBook.md +0 -3660
  405. package/external/rapidjson/thirdparty/gtest/googlemock/docs/DesignDoc.md +0 -280
  406. package/external/rapidjson/thirdparty/gtest/googlemock/docs/Documentation.md +0 -15
  407. package/external/rapidjson/thirdparty/gtest/googlemock/docs/ForDummies.md +0 -447
  408. package/external/rapidjson/thirdparty/gtest/googlemock/docs/FrequentlyAskedQuestions.md +0 -627
  409. package/external/rapidjson/thirdparty/gtest/googlemock/docs/KnownIssues.md +0 -19
  410. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-actions.h +0 -1262
  411. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-cardinalities.h +0 -147
  412. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h +0 -2571
  413. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-actions.h.pump +0 -833
  414. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h +0 -1379
  415. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +0 -347
  416. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h +0 -2258
  417. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-matchers.h.pump +0 -675
  418. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h +0 -458
  419. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-generated-nice-strict.h.pump +0 -178
  420. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-matchers.h +0 -5255
  421. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-actions.h +0 -246
  422. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-more-matchers.h +0 -91
  423. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock-spec-builders.h +0 -1918
  424. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/gmock.h +0 -95
  425. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h +0 -8
  426. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h.pump +0 -10
  427. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-matchers.h +0 -38
  428. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/custom/gmock-port.h +0 -46
  429. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +0 -286
  430. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +0 -136
  431. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-internal-utils.h +0 -574
  432. package/external/rapidjson/thirdparty/gtest/googlemock/include/gmock/internal/gmock-port.h +0 -87
  433. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.sln +0 -32
  434. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock.vcproj +0 -191
  435. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_config.vsprops +0 -15
  436. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_main.vcproj +0 -187
  437. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2005/gmock_test.vcproj +0 -201
  438. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.sln +0 -46
  439. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock.vcxproj +0 -145
  440. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_config.props +0 -19
  441. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_main.vcxproj +0 -151
  442. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2010/gmock_test.vcxproj +0 -176
  443. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.sln +0 -46
  444. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock.vcxproj +0 -145
  445. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_config.props +0 -19
  446. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_main.vcxproj +0 -151
  447. package/external/rapidjson/thirdparty/gtest/googlemock/msvc/2015/gmock_test.vcxproj +0 -176
  448. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/fuse_gmock_files.py +0 -240
  449. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/LICENSE +0 -203
  450. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README +0 -34
  451. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/README.cppclean +0 -115
  452. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/__init__.py +0 -0
  453. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/ast.py +0 -1733
  454. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class.py +0 -227
  455. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/gmock_class_test.py +0 -448
  456. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/keywords.py +0 -59
  457. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/tokenize.py +0 -287
  458. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/cpp/utils.py +0 -41
  459. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/generator/gmock_gen.py +0 -31
  460. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/gmock-config.in +0 -303
  461. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/gmock_doctor.py +0 -640
  462. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/upload.py +0 -1387
  463. package/external/rapidjson/thirdparty/gtest/googlemock/scripts/upload_gmock.py +0 -78
  464. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-all.cc +0 -47
  465. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-cardinalities.cc +0 -156
  466. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-internal-utils.cc +0 -204
  467. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-matchers.cc +0 -573
  468. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock-spec-builders.cc +0 -883
  469. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock.cc +0 -205
  470. package/external/rapidjson/thirdparty/gtest/googlemock/src/gmock_main.cc +0 -54
  471. package/external/rapidjson/thirdparty/gtest/googlemock/test/BUILD.bazel +0 -123
  472. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-actions_test.cc +0 -1575
  473. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-cardinalities_test.cc +0 -428
  474. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-actions_test.cc +0 -1230
  475. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-function-mockers_test.cc +0 -647
  476. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-internal-utils_test.cc +0 -129
  477. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-generated-matchers_test.cc +0 -1341
  478. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-internal-utils_test.cc +0 -718
  479. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-matchers_test.cc +0 -6767
  480. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-more-actions_test.cc +0 -710
  481. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-nice-strict_test.cc +0 -511
  482. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-port_test.cc +0 -43
  483. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock-spec-builders_test.cc +0 -2771
  484. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_all_test.cc +0 -51
  485. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_ex_test.cc +0 -81
  486. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test.py +0 -108
  487. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_leak_test_.cc +0 -100
  488. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link2_test.cc +0 -40
  489. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.cc +0 -40
  490. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_link_test.h +0 -691
  491. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test.py +0 -183
  492. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_.cc +0 -310
  493. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_output_test_golden.txt +0 -317
  494. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_stress_test.cc +0 -323
  495. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_test.cc +0 -262
  496. package/external/rapidjson/thirdparty/gtest/googlemock/test/gmock_test_utils.py +0 -110
  497. package/external/rapidjson/thirdparty/gtest/googletest/CHANGES +0 -157
  498. package/external/rapidjson/thirdparty/gtest/googletest/CMakeLists.txt +0 -312
  499. package/external/rapidjson/thirdparty/gtest/googletest/CONTRIBUTORS +0 -37
  500. package/external/rapidjson/thirdparty/gtest/googletest/LICENSE +0 -28
  501. package/external/rapidjson/thirdparty/gtest/googletest/Makefile.am +0 -339
  502. package/external/rapidjson/thirdparty/gtest/googletest/README.md +0 -341
  503. package/external/rapidjson/thirdparty/gtest/googletest/cmake/gtest.pc.in +0 -9
  504. package/external/rapidjson/thirdparty/gtest/googletest/cmake/gtest_main.pc.in +0 -10
  505. package/external/rapidjson/thirdparty/gtest/googletest/cmake/internal_utils.cmake +0 -280
  506. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest.cbproj +0 -138
  507. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest.groupproj +0 -54
  508. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_all.cc +0 -38
  509. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_link.cc +0 -40
  510. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_main.cbproj +0 -82
  511. package/external/rapidjson/thirdparty/gtest/googletest/codegear/gtest_unittest.cbproj +0 -88
  512. package/external/rapidjson/thirdparty/gtest/googletest/configure.ac +0 -68
  513. package/external/rapidjson/thirdparty/gtest/googletest/docs/Pkgconfig.md +0 -146
  514. package/external/rapidjson/thirdparty/gtest/googletest/docs/PumpManual.md +0 -177
  515. package/external/rapidjson/thirdparty/gtest/googletest/docs/XcodeGuide.md +0 -93
  516. package/external/rapidjson/thirdparty/gtest/googletest/docs/advanced.md +0 -2416
  517. package/external/rapidjson/thirdparty/gtest/googletest/docs/faq.md +0 -1092
  518. package/external/rapidjson/thirdparty/gtest/googletest/docs/primer.md +0 -536
  519. package/external/rapidjson/thirdparty/gtest/googletest/docs/samples.md +0 -14
  520. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-death-test.h +0 -342
  521. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-message.h +0 -249
  522. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h +0 -1438
  523. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-param-test.h.pump +0 -501
  524. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-printers.h +0 -1082
  525. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-spi.h +0 -231
  526. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-test-part.h +0 -179
  527. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest-typed-test.h +0 -264
  528. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest.h +0 -2332
  529. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_pred_impl.h +0 -357
  530. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/gtest_prod.h +0 -61
  531. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-port.h +0 -70
  532. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest-printers.h +0 -42
  533. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/custom/gtest.h +0 -45
  534. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h +0 -275
  535. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-filepath.h +0 -205
  536. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-internal.h +0 -1277
  537. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-linked_ptr.h +0 -243
  538. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h +0 -5139
  539. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util-generated.h.pump +0 -279
  540. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-param-util.h +0 -723
  541. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port-arch.h +0 -100
  542. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-port.h +0 -2687
  543. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-string.h +0 -167
  544. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h +0 -1020
  545. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-tuple.h.pump +0 -347
  546. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h +0 -3347
  547. package/external/rapidjson/thirdparty/gtest/googletest/include/gtest/internal/gtest-type-util.h.pump +0 -313
  548. package/external/rapidjson/thirdparty/gtest/googletest/m4/acx_pthread.m4 +0 -363
  549. package/external/rapidjson/thirdparty/gtest/googletest/m4/gtest.m4 +0 -74
  550. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.sln +0 -55
  551. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj +0 -149
  552. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest-md.vcxproj.filters +0 -18
  553. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.sln +0 -55
  554. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj +0 -149
  555. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest.vcxproj.filters +0 -18
  556. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj +0 -154
  557. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main-md.vcxproj.filters +0 -18
  558. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj +0 -162
  559. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_main.vcxproj.filters +0 -18
  560. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj +0 -199
  561. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test-md.vcxproj.filters +0 -26
  562. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj +0 -191
  563. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_prod_test.vcxproj.filters +0 -26
  564. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj +0 -188
  565. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest-md.vcxproj.filters +0 -18
  566. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj +0 -180
  567. package/external/rapidjson/thirdparty/gtest/googletest/msvc/2010/gtest_unittest.vcxproj.filters +0 -18
  568. package/external/rapidjson/thirdparty/gtest/googletest/samples/prime_tables.h +0 -127
  569. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1.cc +0 -68
  570. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1.h +0 -43
  571. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample10_unittest.cc +0 -140
  572. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample1_unittest.cc +0 -154
  573. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2.cc +0 -56
  574. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2.h +0 -85
  575. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample2_unittest.cc +0 -110
  576. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample3-inl.h +0 -172
  577. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample3_unittest.cc +0 -152
  578. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4.cc +0 -46
  579. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4.h +0 -53
  580. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample4_unittest.cc +0 -49
  581. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample5_unittest.cc +0 -199
  582. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample6_unittest.cc +0 -225
  583. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample7_unittest.cc +0 -118
  584. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample8_unittest.cc +0 -174
  585. package/external/rapidjson/thirdparty/gtest/googletest/samples/sample9_unittest.cc +0 -157
  586. package/external/rapidjson/thirdparty/gtest/googletest/scripts/common.py +0 -83
  587. package/external/rapidjson/thirdparty/gtest/googletest/scripts/fuse_gtest_files.py +0 -253
  588. package/external/rapidjson/thirdparty/gtest/googletest/scripts/gen_gtest_pred_impl.py +0 -730
  589. package/external/rapidjson/thirdparty/gtest/googletest/scripts/gtest-config.in +0 -274
  590. package/external/rapidjson/thirdparty/gtest/googletest/scripts/pump.py +0 -855
  591. package/external/rapidjson/thirdparty/gtest/googletest/scripts/release_docs.py +0 -158
  592. package/external/rapidjson/thirdparty/gtest/googletest/scripts/upload.py +0 -1387
  593. package/external/rapidjson/thirdparty/gtest/googletest/scripts/upload_gtest.py +0 -78
  594. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-all.cc +0 -48
  595. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-death-test.cc +0 -1536
  596. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-filepath.cc +0 -385
  597. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-internal-inl.h +0 -1175
  598. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-port.cc +0 -1277
  599. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-printers.cc +0 -458
  600. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-test-part.cc +0 -102
  601. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest-typed-test.cc +0 -119
  602. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest.cc +0 -5846
  603. package/external/rapidjson/thirdparty/gtest/googletest/src/gtest_main.cc +0 -38
  604. package/external/rapidjson/thirdparty/gtest/googletest/test/BUILD.bazel +0 -396
  605. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_ex_test.cc +0 -93
  606. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-death-test_test.cc +0 -1424
  607. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-filepath_test.cc +0 -652
  608. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-linked_ptr_test.cc +0 -154
  609. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-listener_test.cc +0 -311
  610. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-message_test.cc +0 -159
  611. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-options_test.cc +0 -213
  612. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test2_test.cc +0 -61
  613. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.cc +0 -1110
  614. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-param-test_test.h +0 -53
  615. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-port_test.cc +0 -1303
  616. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-printers_test.cc +0 -1737
  617. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-test-part_test.cc +0 -208
  618. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-tuple_test.cc +0 -320
  619. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test2_test.cc +0 -45
  620. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.cc +0 -380
  621. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-typed-test_test.h +0 -66
  622. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest-unittest-api_test.cc +0 -341
  623. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_all_test.cc +0 -47
  624. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_assert_by_exception_test.cc +0 -119
  625. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest.py +0 -210
  626. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_break_on_failure_unittest_.cc +0 -87
  627. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test.py +0 -235
  628. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_catch_exceptions_test_.cc +0 -311
  629. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test.py +0 -129
  630. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_color_test_.cc +0 -63
  631. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test.py +0 -119
  632. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_env_var_test_.cc +0 -124
  633. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_environment_test.cc +0 -189
  634. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest.py +0 -638
  635. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_filter_unittest_.cc +0 -138
  636. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test.py +0 -172
  637. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_help_test_.cc +0 -46
  638. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_outfiles_test.py +0 -162
  639. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_output_unittest.py +0 -611
  640. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_json_test_utils.py +0 -60
  641. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest.py +0 -207
  642. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_list_tests_unittest_.cc +0 -157
  643. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_main_unittest.cc +0 -45
  644. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_no_test_unittest.cc +0 -56
  645. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test.py +0 -344
  646. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_.cc +0 -1067
  647. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_output_test_golden_lin.txt +0 -781
  648. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_pred_impl_unittest.cc +0 -2427
  649. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_premature_exit_test.cc +0 -127
  650. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_prod_test.cc +0 -57
  651. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_repeat_test.cc +0 -236
  652. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test.py +0 -325
  653. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_shuffle_test_.cc +0 -103
  654. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_sole_header_test.cc +0 -57
  655. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_stress_test.cc +0 -250
  656. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_test_utils.py +0 -318
  657. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test.py +0 -65
  658. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_testbridge_test_.cc +0 -44
  659. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_ex_test.cc +0 -92
  660. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test.py +0 -171
  661. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_throw_on_failure_test_.cc +0 -72
  662. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test.py +0 -69
  663. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_uninitialized_test_.cc +0 -43
  664. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_unittest.cc +0 -7797
  665. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile1_test_.cc +0 -48
  666. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfile2_test_.cc +0 -48
  667. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_outfiles_test.py +0 -140
  668. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest.py +0 -378
  669. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_output_unittest_.cc +0 -179
  670. package/external/rapidjson/thirdparty/gtest/googletest/test/gtest_xml_test_utils.py +0 -196
  671. package/external/rapidjson/thirdparty/gtest/googletest/test/production.cc +0 -36
  672. package/external/rapidjson/thirdparty/gtest/googletest/test/production.h +0 -55
  673. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/DebugProject.xcconfig +0 -30
  674. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/FrameworkTarget.xcconfig +0 -17
  675. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/General.xcconfig +0 -41
  676. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/ReleaseProject.xcconfig +0 -32
  677. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/StaticLibraryTarget.xcconfig +0 -18
  678. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Config/TestTarget.xcconfig +0 -8
  679. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Resources/Info.plist +0 -30
  680. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/Info.plist +0 -28
  681. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj +0 -457
  682. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/runtests.sh +0 -62
  683. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.cc +0 -63
  684. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget.h +0 -59
  685. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Samples/FrameworkSample/widget_test.cc +0 -68
  686. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/runtests.sh +0 -65
  687. package/external/rapidjson/thirdparty/gtest/googletest/xcode/Scripts/versiongenerate.py +0 -100
  688. package/external/rapidjson/thirdparty/gtest/googletest/xcode/gtest.xcodeproj/project.pbxproj +0 -1182
  689. package/external/rapidjson/travis-doxygen.sh +0 -121
  690. package/include/.clang-format +0 -76
  691. package/include/eosio/abi.hpp +0 -286
  692. package/include/eosio/asset.hpp +0 -458
  693. package/include/eosio/bytes.hpp +0 -27
  694. package/include/eosio/chain_conversions.hpp +0 -450
  695. package/include/eosio/chain_types.hpp +0 -14
  696. package/include/eosio/check.hpp +0 -178
  697. package/include/eosio/convert.hpp +0 -95
  698. package/include/eosio/crypto.hpp +0 -147
  699. package/include/eosio/eosio_outcome.hpp +0 -41
  700. package/include/eosio/fixed_bytes.hpp +0 -246
  701. package/include/eosio/float.hpp +0 -35
  702. package/include/eosio/for_each_field.hpp +0 -48
  703. package/include/eosio/fpconv.c +0 -336
  704. package/include/eosio/fpconv.h +0 -41
  705. package/include/eosio/fpconv.license +0 -23
  706. package/include/eosio/from_bin.hpp +0 -272
  707. package/include/eosio/from_json.hpp +0 -737
  708. package/include/eosio/from_string.hpp +0 -28
  709. package/include/eosio/map_macro.h +0 -64
  710. package/include/eosio/murmur.hpp +0 -55
  711. package/include/eosio/name.hpp +0 -174
  712. package/include/eosio/opaque.hpp +0 -108
  713. package/include/eosio/operators.hpp +0 -71
  714. package/include/eosio/powers.h +0 -76
  715. package/include/eosio/reflection.hpp +0 -61
  716. package/include/eosio/ship_protocol.hpp +0 -850
  717. package/include/eosio/stream.hpp +0 -231
  718. package/include/eosio/symbol.hpp +0 -300
  719. package/include/eosio/time.hpp +0 -264
  720. package/include/eosio/to_bin.hpp +0 -189
  721. package/include/eosio/to_json.hpp +0 -279
  722. package/include/eosio/to_key.hpp +0 -298
  723. package/include/eosio/types.hpp +0 -97
  724. package/include/eosio/varint.hpp +0 -452
  725. package/include/outcome-basic.hpp +0 -6836
  726. package/src/abi.cpp +0 -297
  727. package/src/abieos.cpp +0 -263
  728. package/src/abieos.h +0 -76
  729. package/src/abieos.hpp +0 -1010
  730. package/src/abieos_exception.hpp +0 -89
  731. package/src/abieos_numeric.hpp +0 -94
  732. package/src/abieos_ripemd160.hpp +0 -417
  733. package/src/crypto.cpp +0 -215
  734. package/src/key_test.cpp +0 -218
  735. package/src/main.cpp +0 -242
  736. package/src/reflect_test.cpp +0 -28
  737. package/src/template_test.cpp +0 -240
  738. package/src/test.cpp +0 -940
  739. package/tools/CMakeLists.txt +0 -9
  740. package/tools/name.cpp +0 -86
@@ -1,1536 +0,0 @@
1
- // Copyright 2005, Google Inc.
2
- // All rights reserved.
3
- //
4
- // Redistribution and use in source and binary forms, with or without
5
- // modification, are permitted provided that the following conditions are
6
- // met:
7
- //
8
- // * Redistributions of source code must retain the above copyright
9
- // notice, this list of conditions and the following disclaimer.
10
- // * Redistributions in binary form must reproduce the above
11
- // copyright notice, this list of conditions and the following disclaimer
12
- // in the documentation and/or other materials provided with the
13
- // distribution.
14
- // * Neither the name of Google Inc. nor the names of its
15
- // contributors may be used to endorse or promote products derived from
16
- // this software without specific prior written permission.
17
- //
18
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
- // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
- // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
- // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
- // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
- // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
- // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
- // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
- // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
- // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
- //
30
- // Author: wan@google.com (Zhanyong Wan), vladl@google.com (Vlad Losev)
31
- //
32
- // This file implements death tests.
33
-
34
- #include "gtest/gtest-death-test.h"
35
- #include "gtest/internal/gtest-port.h"
36
- #include "gtest/internal/custom/gtest.h"
37
-
38
- #if GTEST_HAS_DEATH_TEST
39
-
40
- # if GTEST_OS_MAC
41
- # include <crt_externs.h>
42
- # endif // GTEST_OS_MAC
43
-
44
- # include <errno.h>
45
- # include <fcntl.h>
46
- # include <limits.h>
47
-
48
- # if GTEST_OS_LINUX
49
- # include <signal.h>
50
- # endif // GTEST_OS_LINUX
51
-
52
- # include <stdarg.h>
53
-
54
- # if GTEST_OS_WINDOWS
55
- # include <windows.h>
56
- # else
57
- # include <sys/mman.h>
58
- # include <sys/wait.h>
59
- # endif // GTEST_OS_WINDOWS
60
-
61
- # if GTEST_OS_QNX
62
- # include <spawn.h>
63
- # endif // GTEST_OS_QNX
64
-
65
- # if GTEST_OS_FUCHSIA
66
- # include <lib/fdio/io.h>
67
- # include <lib/fdio/spawn.h>
68
- # include <zircon/processargs.h>
69
- # include <zircon/syscalls.h>
70
- # endif // GTEST_OS_FUCHSIA
71
-
72
- #endif // GTEST_HAS_DEATH_TEST
73
-
74
- #include "gtest/gtest-message.h"
75
- #include "gtest/internal/gtest-string.h"
76
- #include "src/gtest-internal-inl.h"
77
-
78
- namespace testing {
79
-
80
- // Constants.
81
-
82
- // The default death test style.
83
- //
84
- // This is defined in internal/gtest-port.h as "fast", but can be overridden by
85
- // a definition in internal/custom/gtest-port.h. The recommended value, which is
86
- // used internally at Google, is "threadsafe".
87
- static const char kDefaultDeathTestStyle[] = GTEST_DEFAULT_DEATH_TEST_STYLE;
88
-
89
- GTEST_DEFINE_string_(
90
- death_test_style,
91
- internal::StringFromGTestEnv("death_test_style", kDefaultDeathTestStyle),
92
- "Indicates how to run a death test in a forked child process: "
93
- "\"threadsafe\" (child process re-executes the test binary "
94
- "from the beginning, running only the specific death test) or "
95
- "\"fast\" (child process runs the death test immediately "
96
- "after forking).");
97
-
98
- GTEST_DEFINE_bool_(
99
- death_test_use_fork,
100
- internal::BoolFromGTestEnv("death_test_use_fork", false),
101
- "Instructs to use fork()/_exit() instead of clone() in death tests. "
102
- "Ignored and always uses fork() on POSIX systems where clone() is not "
103
- "implemented. Useful when running under valgrind or similar tools if "
104
- "those do not support clone(). Valgrind 3.3.1 will just fail if "
105
- "it sees an unsupported combination of clone() flags. "
106
- "It is not recommended to use this flag w/o valgrind though it will "
107
- "work in 99% of the cases. Once valgrind is fixed, this flag will "
108
- "most likely be removed.");
109
-
110
- namespace internal {
111
- GTEST_DEFINE_string_(
112
- internal_run_death_test, "",
113
- "Indicates the file, line number, temporal index of "
114
- "the single death test to run, and a file descriptor to "
115
- "which a success code may be sent, all separated by "
116
- "the '|' characters. This flag is specified if and only if the current "
117
- "process is a sub-process launched for running a thread-safe "
118
- "death test. FOR INTERNAL USE ONLY.");
119
- } // namespace internal
120
-
121
- #if GTEST_HAS_DEATH_TEST
122
-
123
- namespace internal {
124
-
125
- // Valid only for fast death tests. Indicates the code is running in the
126
- // child process of a fast style death test.
127
- # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
128
- static bool g_in_fast_death_test_child = false;
129
- # endif
130
-
131
- // Returns a Boolean value indicating whether the caller is currently
132
- // executing in the context of the death test child process. Tools such as
133
- // Valgrind heap checkers may need this to modify their behavior in death
134
- // tests. IMPORTANT: This is an internal utility. Using it may break the
135
- // implementation of death tests. User code MUST NOT use it.
136
- bool InDeathTestChild() {
137
- # if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
138
-
139
- // On Windows and Fuchsia, death tests are thread-safe regardless of the value
140
- // of the death_test_style flag.
141
- return !GTEST_FLAG(internal_run_death_test).empty();
142
-
143
- # else
144
-
145
- if (GTEST_FLAG(death_test_style) == "threadsafe")
146
- return !GTEST_FLAG(internal_run_death_test).empty();
147
- else
148
- return g_in_fast_death_test_child;
149
- #endif
150
- }
151
-
152
- } // namespace internal
153
-
154
- // ExitedWithCode constructor.
155
- ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {
156
- }
157
-
158
- // ExitedWithCode function-call operator.
159
- bool ExitedWithCode::operator()(int exit_status) const {
160
- # if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
161
-
162
- return exit_status == exit_code_;
163
-
164
- # else
165
-
166
- return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;
167
-
168
- # endif // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
169
- }
170
-
171
- # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
172
- // KilledBySignal constructor.
173
- KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
174
- }
175
-
176
- // KilledBySignal function-call operator.
177
- bool KilledBySignal::operator()(int exit_status) const {
178
- # if defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
179
- {
180
- bool result;
181
- if (GTEST_KILLED_BY_SIGNAL_OVERRIDE_(signum_, exit_status, &result)) {
182
- return result;
183
- }
184
- }
185
- # endif // defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
186
- return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
187
- }
188
- # endif // !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
189
-
190
- namespace internal {
191
-
192
- // Utilities needed for death tests.
193
-
194
- // Generates a textual description of a given exit code, in the format
195
- // specified by wait(2).
196
- static std::string ExitSummary(int exit_code) {
197
- Message m;
198
-
199
- # if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
200
-
201
- m << "Exited with exit status " << exit_code;
202
-
203
- # else
204
-
205
- if (WIFEXITED(exit_code)) {
206
- m << "Exited with exit status " << WEXITSTATUS(exit_code);
207
- } else if (WIFSIGNALED(exit_code)) {
208
- m << "Terminated by signal " << WTERMSIG(exit_code);
209
- }
210
- # ifdef WCOREDUMP
211
- if (WCOREDUMP(exit_code)) {
212
- m << " (core dumped)";
213
- }
214
- # endif
215
- # endif // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
216
-
217
- return m.GetString();
218
- }
219
-
220
- // Returns true if exit_status describes a process that was terminated
221
- // by a signal, or exited normally with a nonzero exit code.
222
- bool ExitedUnsuccessfully(int exit_status) {
223
- return !ExitedWithCode(0)(exit_status);
224
- }
225
-
226
- # if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
227
- // Generates a textual failure message when a death test finds more than
228
- // one thread running, or cannot determine the number of threads, prior
229
- // to executing the given statement. It is the responsibility of the
230
- // caller not to pass a thread_count of 1.
231
- static std::string DeathTestThreadWarning(size_t thread_count) {
232
- Message msg;
233
- msg << "Death tests use fork(), which is unsafe particularly"
234
- << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
235
- if (thread_count == 0)
236
- msg << "couldn't detect the number of threads.";
237
- else
238
- msg << "detected " << thread_count << " threads.";
239
- return msg.GetString();
240
- }
241
- # endif // !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
242
-
243
- // Flag characters for reporting a death test that did not die.
244
- static const char kDeathTestLived = 'L';
245
- static const char kDeathTestReturned = 'R';
246
- static const char kDeathTestThrew = 'T';
247
- static const char kDeathTestInternalError = 'I';
248
-
249
- #if GTEST_OS_FUCHSIA
250
-
251
- // File descriptor used for the pipe in the child process.
252
- static const int kFuchsiaReadPipeFd = 3;
253
-
254
- #endif
255
-
256
- // An enumeration describing all of the possible ways that a death test can
257
- // conclude. DIED means that the process died while executing the test
258
- // code; LIVED means that process lived beyond the end of the test code;
259
- // RETURNED means that the test statement attempted to execute a return
260
- // statement, which is not allowed; THREW means that the test statement
261
- // returned control by throwing an exception. IN_PROGRESS means the test
262
- // has not yet concluded.
263
- // TODO(vladl@google.com): Unify names and possibly values for
264
- // AbortReason, DeathTestOutcome, and flag characters above.
265
- enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
266
-
267
- // Routine for aborting the program which is safe to call from an
268
- // exec-style death test child process, in which case the error
269
- // message is propagated back to the parent process. Otherwise, the
270
- // message is simply printed to stderr. In either case, the program
271
- // then exits with status 1.
272
- static void DeathTestAbort(const std::string& message) {
273
- // On a POSIX system, this function may be called from a threadsafe-style
274
- // death test child process, which operates on a very small stack. Use
275
- // the heap for any additional non-minuscule memory requirements.
276
- const InternalRunDeathTestFlag* const flag =
277
- GetUnitTestImpl()->internal_run_death_test_flag();
278
- if (flag != NULL) {
279
- FILE* parent = posix::FDOpen(flag->write_fd(), "w");
280
- fputc(kDeathTestInternalError, parent);
281
- fprintf(parent, "%s", message.c_str());
282
- fflush(parent);
283
- _exit(1);
284
- } else {
285
- fprintf(stderr, "%s", message.c_str());
286
- fflush(stderr);
287
- posix::Abort();
288
- }
289
- }
290
-
291
- // A replacement for CHECK that calls DeathTestAbort if the assertion
292
- // fails.
293
- # define GTEST_DEATH_TEST_CHECK_(expression) \
294
- do { \
295
- if (!::testing::internal::IsTrue(expression)) { \
296
- DeathTestAbort( \
297
- ::std::string("CHECK failed: File ") + __FILE__ + ", line " \
298
- + ::testing::internal::StreamableToString(__LINE__) + ": " \
299
- + #expression); \
300
- } \
301
- } while (::testing::internal::AlwaysFalse())
302
-
303
- // This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for
304
- // evaluating any system call that fulfills two conditions: it must return
305
- // -1 on failure, and set errno to EINTR when it is interrupted and
306
- // should be tried again. The macro expands to a loop that repeatedly
307
- // evaluates the expression as long as it evaluates to -1 and sets
308
- // errno to EINTR. If the expression evaluates to -1 but errno is
309
- // something other than EINTR, DeathTestAbort is called.
310
- # define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
311
- do { \
312
- int gtest_retval; \
313
- do { \
314
- gtest_retval = (expression); \
315
- } while (gtest_retval == -1 && errno == EINTR); \
316
- if (gtest_retval == -1) { \
317
- DeathTestAbort( \
318
- ::std::string("CHECK failed: File ") + __FILE__ + ", line " \
319
- + ::testing::internal::StreamableToString(__LINE__) + ": " \
320
- + #expression + " != -1"); \
321
- } \
322
- } while (::testing::internal::AlwaysFalse())
323
-
324
- // Returns the message describing the last system error in errno.
325
- std::string GetLastErrnoDescription() {
326
- return errno == 0 ? "" : posix::StrError(errno);
327
- }
328
-
329
- // This is called from a death test parent process to read a failure
330
- // message from the death test child process and log it with the FATAL
331
- // severity. On Windows, the message is read from a pipe handle. On other
332
- // platforms, it is read from a file descriptor.
333
- static void FailFromInternalError(int fd) {
334
- Message error;
335
- char buffer[256];
336
- int num_read;
337
-
338
- do {
339
- while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
340
- buffer[num_read] = '\0';
341
- error << buffer;
342
- }
343
- } while (num_read == -1 && errno == EINTR);
344
-
345
- if (num_read == 0) {
346
- GTEST_LOG_(FATAL) << error.GetString();
347
- } else {
348
- const int last_error = errno;
349
- GTEST_LOG_(FATAL) << "Error while reading death test internal: "
350
- << GetLastErrnoDescription() << " [" << last_error << "]";
351
- }
352
- }
353
-
354
- // Death test constructor. Increments the running death test count
355
- // for the current test.
356
- DeathTest::DeathTest() {
357
- TestInfo* const info = GetUnitTestImpl()->current_test_info();
358
- if (info == NULL) {
359
- DeathTestAbort("Cannot run a death test outside of a TEST or "
360
- "TEST_F construct");
361
- }
362
- }
363
-
364
- // Creates and returns a death test by dispatching to the current
365
- // death test factory.
366
- bool DeathTest::Create(const char* statement, const RE* regex,
367
- const char* file, int line, DeathTest** test) {
368
- return GetUnitTestImpl()->death_test_factory()->Create(
369
- statement, regex, file, line, test);
370
- }
371
-
372
- const char* DeathTest::LastMessage() {
373
- return last_death_test_message_.c_str();
374
- }
375
-
376
- void DeathTest::set_last_death_test_message(const std::string& message) {
377
- last_death_test_message_ = message;
378
- }
379
-
380
- std::string DeathTest::last_death_test_message_;
381
-
382
- // Provides cross platform implementation for some death functionality.
383
- class DeathTestImpl : public DeathTest {
384
- protected:
385
- DeathTestImpl(const char* a_statement, const RE* a_regex)
386
- : statement_(a_statement),
387
- regex_(a_regex),
388
- spawned_(false),
389
- status_(-1),
390
- outcome_(IN_PROGRESS),
391
- read_fd_(-1),
392
- write_fd_(-1) {}
393
-
394
- // read_fd_ is expected to be closed and cleared by a derived class.
395
- ~DeathTestImpl() { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
396
-
397
- void Abort(AbortReason reason);
398
- virtual bool Passed(bool status_ok);
399
-
400
- const char* statement() const { return statement_; }
401
- const RE* regex() const { return regex_; }
402
- bool spawned() const { return spawned_; }
403
- void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
404
- int status() const { return status_; }
405
- void set_status(int a_status) { status_ = a_status; }
406
- DeathTestOutcome outcome() const { return outcome_; }
407
- void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
408
- int read_fd() const { return read_fd_; }
409
- void set_read_fd(int fd) { read_fd_ = fd; }
410
- int write_fd() const { return write_fd_; }
411
- void set_write_fd(int fd) { write_fd_ = fd; }
412
-
413
- // Called in the parent process only. Reads the result code of the death
414
- // test child process via a pipe, interprets it to set the outcome_
415
- // member, and closes read_fd_. Outputs diagnostics and terminates in
416
- // case of unexpected codes.
417
- void ReadAndInterpretStatusByte();
418
-
419
- private:
420
- // The textual content of the code this object is testing. This class
421
- // doesn't own this string and should not attempt to delete it.
422
- const char* const statement_;
423
- // The regular expression which test output must match. DeathTestImpl
424
- // doesn't own this object and should not attempt to delete it.
425
- const RE* const regex_;
426
- // True if the death test child process has been successfully spawned.
427
- bool spawned_;
428
- // The exit status of the child process.
429
- int status_;
430
- // How the death test concluded.
431
- DeathTestOutcome outcome_;
432
- // Descriptor to the read end of the pipe to the child process. It is
433
- // always -1 in the child process. The child keeps its write end of the
434
- // pipe in write_fd_.
435
- int read_fd_;
436
- // Descriptor to the child's write end of the pipe to the parent process.
437
- // It is always -1 in the parent process. The parent keeps its end of the
438
- // pipe in read_fd_.
439
- int write_fd_;
440
- };
441
-
442
- // Called in the parent process only. Reads the result code of the death
443
- // test child process via a pipe, interprets it to set the outcome_
444
- // member, and closes read_fd_. Outputs diagnostics and terminates in
445
- // case of unexpected codes.
446
- void DeathTestImpl::ReadAndInterpretStatusByte() {
447
- char flag;
448
- int bytes_read;
449
-
450
- // The read() here blocks until data is available (signifying the
451
- // failure of the death test) or until the pipe is closed (signifying
452
- // its success), so it's okay to call this in the parent before
453
- // the child process has exited.
454
- do {
455
- bytes_read = posix::Read(read_fd(), &flag, 1);
456
- } while (bytes_read == -1 && errno == EINTR);
457
-
458
- if (bytes_read == 0) {
459
- set_outcome(DIED);
460
- } else if (bytes_read == 1) {
461
- switch (flag) {
462
- case kDeathTestReturned:
463
- set_outcome(RETURNED);
464
- break;
465
- case kDeathTestThrew:
466
- set_outcome(THREW);
467
- break;
468
- case kDeathTestLived:
469
- set_outcome(LIVED);
470
- break;
471
- case kDeathTestInternalError:
472
- FailFromInternalError(read_fd()); // Does not return.
473
- break;
474
- default:
475
- GTEST_LOG_(FATAL) << "Death test child process reported "
476
- << "unexpected status byte ("
477
- << static_cast<unsigned int>(flag) << ")";
478
- }
479
- } else {
480
- GTEST_LOG_(FATAL) << "Read from death test child process failed: "
481
- << GetLastErrnoDescription();
482
- }
483
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
484
- set_read_fd(-1);
485
- }
486
-
487
- // Signals that the death test code which should have exited, didn't.
488
- // Should be called only in a death test child process.
489
- // Writes a status byte to the child's status file descriptor, then
490
- // calls _exit(1).
491
- void DeathTestImpl::Abort(AbortReason reason) {
492
- // The parent process considers the death test to be a failure if
493
- // it finds any data in our pipe. So, here we write a single flag byte
494
- // to the pipe, then exit.
495
- const char status_ch =
496
- reason == TEST_DID_NOT_DIE ? kDeathTestLived :
497
- reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned;
498
-
499
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));
500
- // We are leaking the descriptor here because on some platforms (i.e.,
501
- // when built as Windows DLL), destructors of global objects will still
502
- // run after calling _exit(). On such systems, write_fd_ will be
503
- // indirectly closed from the destructor of UnitTestImpl, causing double
504
- // close if it is also closed here. On debug configurations, double close
505
- // may assert. As there are no in-process buffers to flush here, we are
506
- // relying on the OS to close the descriptor after the process terminates
507
- // when the destructors are not run.
508
- _exit(1); // Exits w/o any normal exit hooks (we were supposed to crash)
509
- }
510
-
511
- // Returns an indented copy of stderr output for a death test.
512
- // This makes distinguishing death test output lines from regular log lines
513
- // much easier.
514
- static ::std::string FormatDeathTestOutput(const ::std::string& output) {
515
- ::std::string ret;
516
- for (size_t at = 0; ; ) {
517
- const size_t line_end = output.find('\n', at);
518
- ret += "[ DEATH ] ";
519
- if (line_end == ::std::string::npos) {
520
- ret += output.substr(at);
521
- break;
522
- }
523
- ret += output.substr(at, line_end + 1 - at);
524
- at = line_end + 1;
525
- }
526
- return ret;
527
- }
528
-
529
- // Assesses the success or failure of a death test, using both private
530
- // members which have previously been set, and one argument:
531
- //
532
- // Private data members:
533
- // outcome: An enumeration describing how the death test
534
- // concluded: DIED, LIVED, THREW, or RETURNED. The death test
535
- // fails in the latter three cases.
536
- // status: The exit status of the child process. On *nix, it is in the
537
- // in the format specified by wait(2). On Windows, this is the
538
- // value supplied to the ExitProcess() API or a numeric code
539
- // of the exception that terminated the program.
540
- // regex: A regular expression object to be applied to
541
- // the test's captured standard error output; the death test
542
- // fails if it does not match.
543
- //
544
- // Argument:
545
- // status_ok: true if exit_status is acceptable in the context of
546
- // this particular death test, which fails if it is false
547
- //
548
- // Returns true iff all of the above conditions are met. Otherwise, the
549
- // first failing condition, in the order given above, is the one that is
550
- // reported. Also sets the last death test message string.
551
- bool DeathTestImpl::Passed(bool status_ok) {
552
- if (!spawned())
553
- return false;
554
-
555
- const std::string error_message = GetCapturedStderr();
556
-
557
- bool success = false;
558
- Message buffer;
559
-
560
- buffer << "Death test: " << statement() << "\n";
561
- switch (outcome()) {
562
- case LIVED:
563
- buffer << " Result: failed to die.\n"
564
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
565
- break;
566
- case THREW:
567
- buffer << " Result: threw an exception.\n"
568
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
569
- break;
570
- case RETURNED:
571
- buffer << " Result: illegal return in test statement.\n"
572
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
573
- break;
574
- case DIED:
575
- if (status_ok) {
576
- # if GTEST_USES_PCRE
577
- // PCRE regexes support embedded NULs.
578
- // GTEST_USES_PCRE is defined only in google3 mode
579
- const bool matched = RE::PartialMatch(error_message, *regex());
580
- # else
581
- const bool matched = RE::PartialMatch(error_message.c_str(), *regex());
582
- # endif // GTEST_USES_PCRE
583
- if (matched) {
584
- success = true;
585
- } else {
586
- buffer << " Result: died but not with expected error.\n"
587
- << " Expected: " << regex()->pattern() << "\n"
588
- << "Actual msg:\n" << FormatDeathTestOutput(error_message);
589
- }
590
- } else {
591
- buffer << " Result: died but not with expected exit code:\n"
592
- << " " << ExitSummary(status()) << "\n"
593
- << "Actual msg:\n" << FormatDeathTestOutput(error_message);
594
- }
595
- break;
596
- case IN_PROGRESS:
597
- default:
598
- GTEST_LOG_(FATAL)
599
- << "DeathTest::Passed somehow called before conclusion of test";
600
- }
601
-
602
- DeathTest::set_last_death_test_message(buffer.GetString());
603
- return success;
604
- }
605
-
606
- # if GTEST_OS_WINDOWS
607
- // WindowsDeathTest implements death tests on Windows. Due to the
608
- // specifics of starting new processes on Windows, death tests there are
609
- // always threadsafe, and Google Test considers the
610
- // --gtest_death_test_style=fast setting to be equivalent to
611
- // --gtest_death_test_style=threadsafe there.
612
- //
613
- // A few implementation notes: Like the Linux version, the Windows
614
- // implementation uses pipes for child-to-parent communication. But due to
615
- // the specifics of pipes on Windows, some extra steps are required:
616
- //
617
- // 1. The parent creates a communication pipe and stores handles to both
618
- // ends of it.
619
- // 2. The parent starts the child and provides it with the information
620
- // necessary to acquire the handle to the write end of the pipe.
621
- // 3. The child acquires the write end of the pipe and signals the parent
622
- // using a Windows event.
623
- // 4. Now the parent can release the write end of the pipe on its side. If
624
- // this is done before step 3, the object's reference count goes down to
625
- // 0 and it is destroyed, preventing the child from acquiring it. The
626
- // parent now has to release it, or read operations on the read end of
627
- // the pipe will not return when the child terminates.
628
- // 5. The parent reads child's output through the pipe (outcome code and
629
- // any possible error messages) from the pipe, and its stderr and then
630
- // determines whether to fail the test.
631
- //
632
- // Note: to distinguish Win32 API calls from the local method and function
633
- // calls, the former are explicitly resolved in the global namespace.
634
- //
635
- class WindowsDeathTest : public DeathTestImpl {
636
- public:
637
- WindowsDeathTest(const char* a_statement,
638
- const RE* a_regex,
639
- const char* file,
640
- int line)
641
- : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
642
-
643
- // All of these virtual functions are inherited from DeathTest.
644
- virtual int Wait();
645
- virtual TestRole AssumeRole();
646
-
647
- private:
648
- // The name of the file in which the death test is located.
649
- const char* const file_;
650
- // The line number on which the death test is located.
651
- const int line_;
652
- // Handle to the write end of the pipe to the child process.
653
- AutoHandle write_handle_;
654
- // Child process handle.
655
- AutoHandle child_handle_;
656
- // Event the child process uses to signal the parent that it has
657
- // acquired the handle to the write end of the pipe. After seeing this
658
- // event the parent can release its own handles to make sure its
659
- // ReadFile() calls return when the child terminates.
660
- AutoHandle event_handle_;
661
- };
662
-
663
- // Waits for the child in a death test to exit, returning its exit
664
- // status, or 0 if no child process exists. As a side effect, sets the
665
- // outcome data member.
666
- int WindowsDeathTest::Wait() {
667
- if (!spawned())
668
- return 0;
669
-
670
- // Wait until the child either signals that it has acquired the write end
671
- // of the pipe or it dies.
672
- const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
673
- switch (::WaitForMultipleObjects(2,
674
- wait_handles,
675
- FALSE, // Waits for any of the handles.
676
- INFINITE)) {
677
- case WAIT_OBJECT_0:
678
- case WAIT_OBJECT_0 + 1:
679
- break;
680
- default:
681
- GTEST_DEATH_TEST_CHECK_(false); // Should not get here.
682
- }
683
-
684
- // The child has acquired the write end of the pipe or exited.
685
- // We release the handle on our side and continue.
686
- write_handle_.Reset();
687
- event_handle_.Reset();
688
-
689
- ReadAndInterpretStatusByte();
690
-
691
- // Waits for the child process to exit if it haven't already. This
692
- // returns immediately if the child has already exited, regardless of
693
- // whether previous calls to WaitForMultipleObjects synchronized on this
694
- // handle or not.
695
- GTEST_DEATH_TEST_CHECK_(
696
- WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),
697
- INFINITE));
698
- DWORD status_code;
699
- GTEST_DEATH_TEST_CHECK_(
700
- ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE);
701
- child_handle_.Reset();
702
- set_status(static_cast<int>(status_code));
703
- return status();
704
- }
705
-
706
- // The AssumeRole process for a Windows death test. It creates a child
707
- // process with the same executable as the current process to run the
708
- // death test. The child process is given the --gtest_filter and
709
- // --gtest_internal_run_death_test flags such that it knows to run the
710
- // current death test only.
711
- DeathTest::TestRole WindowsDeathTest::AssumeRole() {
712
- const UnitTestImpl* const impl = GetUnitTestImpl();
713
- const InternalRunDeathTestFlag* const flag =
714
- impl->internal_run_death_test_flag();
715
- const TestInfo* const info = impl->current_test_info();
716
- const int death_test_index = info->result()->death_test_count();
717
-
718
- if (flag != NULL) {
719
- // ParseInternalRunDeathTestFlag() has performed all the necessary
720
- // processing.
721
- set_write_fd(flag->write_fd());
722
- return EXECUTE_TEST;
723
- }
724
-
725
- // WindowsDeathTest uses an anonymous pipe to communicate results of
726
- // a death test.
727
- SECURITY_ATTRIBUTES handles_are_inheritable = {
728
- sizeof(SECURITY_ATTRIBUTES), NULL, TRUE };
729
- HANDLE read_handle, write_handle;
730
- GTEST_DEATH_TEST_CHECK_(
731
- ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,
732
- 0) // Default buffer size.
733
- != FALSE);
734
- set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),
735
- O_RDONLY));
736
- write_handle_.Reset(write_handle);
737
- event_handle_.Reset(::CreateEvent(
738
- &handles_are_inheritable,
739
- TRUE, // The event will automatically reset to non-signaled state.
740
- FALSE, // The initial state is non-signalled.
741
- NULL)); // The even is unnamed.
742
- GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != NULL);
743
- const std::string filter_flag =
744
- std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "=" +
745
- info->test_case_name() + "." + info->name();
746
- const std::string internal_flag =
747
- std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag +
748
- "=" + file_ + "|" + StreamableToString(line_) + "|" +
749
- StreamableToString(death_test_index) + "|" +
750
- StreamableToString(static_cast<unsigned int>(::GetCurrentProcessId())) +
751
- // size_t has the same width as pointers on both 32-bit and 64-bit
752
- // Windows platforms.
753
- // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
754
- "|" + StreamableToString(reinterpret_cast<size_t>(write_handle)) +
755
- "|" + StreamableToString(reinterpret_cast<size_t>(event_handle_.Get()));
756
-
757
- char executable_path[_MAX_PATH + 1]; // NOLINT
758
- GTEST_DEATH_TEST_CHECK_(
759
- _MAX_PATH + 1 != ::GetModuleFileNameA(NULL,
760
- executable_path,
761
- _MAX_PATH));
762
-
763
- std::string command_line =
764
- std::string(::GetCommandLineA()) + " " + filter_flag + " \"" +
765
- internal_flag + "\"";
766
-
767
- DeathTest::set_last_death_test_message("");
768
-
769
- CaptureStderr();
770
- // Flush the log buffers since the log streams are shared with the child.
771
- FlushInfoLog();
772
-
773
- // The child process will share the standard handles with the parent.
774
- STARTUPINFOA startup_info;
775
- memset(&startup_info, 0, sizeof(STARTUPINFO));
776
- startup_info.dwFlags = STARTF_USESTDHANDLES;
777
- startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);
778
- startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
779
- startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
780
-
781
- PROCESS_INFORMATION process_info;
782
- GTEST_DEATH_TEST_CHECK_(::CreateProcessA(
783
- executable_path,
784
- const_cast<char*>(command_line.c_str()),
785
- NULL, // Retuned process handle is not inheritable.
786
- NULL, // Retuned thread handle is not inheritable.
787
- TRUE, // Child inherits all inheritable handles (for write_handle_).
788
- 0x0, // Default creation flags.
789
- NULL, // Inherit the parent's environment.
790
- UnitTest::GetInstance()->original_working_dir(),
791
- &startup_info,
792
- &process_info) != FALSE);
793
- child_handle_.Reset(process_info.hProcess);
794
- ::CloseHandle(process_info.hThread);
795
- set_spawned(true);
796
- return OVERSEE_TEST;
797
- }
798
-
799
- # elif GTEST_OS_FUCHSIA
800
-
801
- class FuchsiaDeathTest : public DeathTestImpl {
802
- public:
803
- FuchsiaDeathTest(const char* a_statement,
804
- const RE* a_regex,
805
- const char* file,
806
- int line)
807
- : DeathTestImpl(a_statement, a_regex), file_(file), line_(line) {}
808
-
809
- // All of these virtual functions are inherited from DeathTest.
810
- virtual int Wait();
811
- virtual TestRole AssumeRole();
812
-
813
- private:
814
- // The name of the file in which the death test is located.
815
- const char* const file_;
816
- // The line number on which the death test is located.
817
- const int line_;
818
-
819
- zx_handle_t child_process_;
820
- };
821
-
822
- // Utility class for accumulating command-line arguments.
823
- class Arguments {
824
- public:
825
- Arguments() {
826
- args_.push_back(NULL);
827
- }
828
-
829
- ~Arguments() {
830
- for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
831
- ++i) {
832
- free(*i);
833
- }
834
- }
835
- void AddArgument(const char* argument) {
836
- args_.insert(args_.end() - 1, posix::StrDup(argument));
837
- }
838
-
839
- template <typename Str>
840
- void AddArguments(const ::std::vector<Str>& arguments) {
841
- for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
842
- i != arguments.end();
843
- ++i) {
844
- args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
845
- }
846
- }
847
- char* const* Argv() {
848
- return &args_[0];
849
- }
850
-
851
- int size() {
852
- return args_.size() - 1;
853
- }
854
-
855
- private:
856
- std::vector<char*> args_;
857
- };
858
-
859
- // Waits for the child in a death test to exit, returning its exit
860
- // status, or 0 if no child process exists. As a side effect, sets the
861
- // outcome data member.
862
- int FuchsiaDeathTest::Wait() {
863
- if (!spawned())
864
- return 0;
865
-
866
- // Wait for child process to terminate.
867
- zx_status_t status_zx;
868
- zx_signals_t signals;
869
- status_zx = zx_object_wait_one(
870
- child_process_,
871
- ZX_PROCESS_TERMINATED,
872
- ZX_TIME_INFINITE,
873
- &signals);
874
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
875
-
876
- ReadAndInterpretStatusByte();
877
-
878
- zx_info_process_t buffer;
879
- status_zx = zx_object_get_info(
880
- child_process_,
881
- ZX_INFO_PROCESS,
882
- &buffer,
883
- sizeof(buffer),
884
- nullptr,
885
- nullptr);
886
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
887
-
888
- GTEST_DEATH_TEST_CHECK_(buffer.exited);
889
- set_status(buffer.return_code);
890
- return status();
891
- }
892
-
893
- // The AssumeRole process for a Fuchsia death test. It creates a child
894
- // process with the same executable as the current process to run the
895
- // death test. The child process is given the --gtest_filter and
896
- // --gtest_internal_run_death_test flags such that it knows to run the
897
- // current death test only.
898
- DeathTest::TestRole FuchsiaDeathTest::AssumeRole() {
899
- const UnitTestImpl* const impl = GetUnitTestImpl();
900
- const InternalRunDeathTestFlag* const flag =
901
- impl->internal_run_death_test_flag();
902
- const TestInfo* const info = impl->current_test_info();
903
- const int death_test_index = info->result()->death_test_count();
904
-
905
- if (flag != NULL) {
906
- // ParseInternalRunDeathTestFlag() has performed all the necessary
907
- // processing.
908
- set_write_fd(kFuchsiaReadPipeFd);
909
- return EXECUTE_TEST;
910
- }
911
-
912
- CaptureStderr();
913
- // Flush the log buffers since the log streams are shared with the child.
914
- FlushInfoLog();
915
-
916
- // Build the child process command line.
917
- const std::string filter_flag =
918
- std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "="
919
- + info->test_case_name() + "." + info->name();
920
- const std::string internal_flag =
921
- std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="
922
- + file_ + "|"
923
- + StreamableToString(line_) + "|"
924
- + StreamableToString(death_test_index);
925
- Arguments args;
926
- args.AddArguments(GetInjectableArgvs());
927
- args.AddArgument(filter_flag.c_str());
928
- args.AddArgument(internal_flag.c_str());
929
-
930
- // Build the pipe for communication with the child.
931
- zx_status_t status;
932
- zx_handle_t child_pipe_handle;
933
- uint32_t type;
934
- status = fdio_pipe_half(&child_pipe_handle, &type);
935
- GTEST_DEATH_TEST_CHECK_(status >= 0);
936
- set_read_fd(status);
937
-
938
- // Set the pipe handle for the child.
939
- fdio_spawn_action_t add_handle_action = {
940
- .action = FDIO_SPAWN_ACTION_ADD_HANDLE,
941
- .h = {
942
- .id = PA_HND(type, kFuchsiaReadPipeFd),
943
- .handle = child_pipe_handle
944
- }
945
- };
946
-
947
- // Spawn the child process.
948
- status = fdio_spawn_etc(ZX_HANDLE_INVALID, FDIO_SPAWN_CLONE_ALL,
949
- args.Argv()[0], args.Argv(), nullptr, 1,
950
- &add_handle_action, &child_process_, nullptr);
951
- GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
952
-
953
- set_spawned(true);
954
- return OVERSEE_TEST;
955
- }
956
-
957
- #else // We are neither on Windows, nor on Fuchsia.
958
-
959
- // ForkingDeathTest provides implementations for most of the abstract
960
- // methods of the DeathTest interface. Only the AssumeRole method is
961
- // left undefined.
962
- class ForkingDeathTest : public DeathTestImpl {
963
- public:
964
- ForkingDeathTest(const char* statement, const RE* regex);
965
-
966
- // All of these virtual functions are inherited from DeathTest.
967
- virtual int Wait();
968
-
969
- protected:
970
- void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
971
-
972
- private:
973
- // PID of child process during death test; 0 in the child process itself.
974
- pid_t child_pid_;
975
- };
976
-
977
- // Constructs a ForkingDeathTest.
978
- ForkingDeathTest::ForkingDeathTest(const char* a_statement, const RE* a_regex)
979
- : DeathTestImpl(a_statement, a_regex),
980
- child_pid_(-1) {}
981
-
982
- // Waits for the child in a death test to exit, returning its exit
983
- // status, or 0 if no child process exists. As a side effect, sets the
984
- // outcome data member.
985
- int ForkingDeathTest::Wait() {
986
- if (!spawned())
987
- return 0;
988
-
989
- ReadAndInterpretStatusByte();
990
-
991
- int status_value;
992
- GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
993
- set_status(status_value);
994
- return status_value;
995
- }
996
-
997
- // A concrete death test class that forks, then immediately runs the test
998
- // in the child process.
999
- class NoExecDeathTest : public ForkingDeathTest {
1000
- public:
1001
- NoExecDeathTest(const char* a_statement, const RE* a_regex) :
1002
- ForkingDeathTest(a_statement, a_regex) { }
1003
- virtual TestRole AssumeRole();
1004
- };
1005
-
1006
- // The AssumeRole process for a fork-and-run death test. It implements a
1007
- // straightforward fork, with a simple pipe to transmit the status byte.
1008
- DeathTest::TestRole NoExecDeathTest::AssumeRole() {
1009
- const size_t thread_count = GetThreadCount();
1010
- if (thread_count != 1) {
1011
- GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);
1012
- }
1013
-
1014
- int pipe_fd[2];
1015
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
1016
-
1017
- DeathTest::set_last_death_test_message("");
1018
- CaptureStderr();
1019
- // When we fork the process below, the log file buffers are copied, but the
1020
- // file descriptors are shared. We flush all log files here so that closing
1021
- // the file descriptors in the child process doesn't throw off the
1022
- // synchronization between descriptors and buffers in the parent process.
1023
- // This is as close to the fork as possible to avoid a race condition in case
1024
- // there are multiple threads running before the death test, and another
1025
- // thread writes to the log file.
1026
- FlushInfoLog();
1027
-
1028
- const pid_t child_pid = fork();
1029
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
1030
- set_child_pid(child_pid);
1031
- if (child_pid == 0) {
1032
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));
1033
- set_write_fd(pipe_fd[1]);
1034
- // Redirects all logging to stderr in the child process to prevent
1035
- // concurrent writes to the log files. We capture stderr in the parent
1036
- // process and append the child process' output to a log.
1037
- LogToStderr();
1038
- // Event forwarding to the listeners of event listener API mush be shut
1039
- // down in death test subprocesses.
1040
- GetUnitTestImpl()->listeners()->SuppressEventForwarding();
1041
- g_in_fast_death_test_child = true;
1042
- return EXECUTE_TEST;
1043
- } else {
1044
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
1045
- set_read_fd(pipe_fd[0]);
1046
- set_spawned(true);
1047
- return OVERSEE_TEST;
1048
- }
1049
- }
1050
-
1051
- // A concrete death test class that forks and re-executes the main
1052
- // program from the beginning, with command-line flags set that cause
1053
- // only this specific death test to be run.
1054
- class ExecDeathTest : public ForkingDeathTest {
1055
- public:
1056
- ExecDeathTest(const char* a_statement, const RE* a_regex,
1057
- const char* file, int line) :
1058
- ForkingDeathTest(a_statement, a_regex), file_(file), line_(line) { }
1059
- virtual TestRole AssumeRole();
1060
- private:
1061
- static ::std::vector<std::string> GetArgvsForDeathTestChildProcess() {
1062
- ::std::vector<std::string> args = GetInjectableArgvs();
1063
- # if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
1064
- ::std::vector<std::string> extra_args =
1065
- GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_();
1066
- args.insert(args.end(), extra_args.begin(), extra_args.end());
1067
- # endif // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
1068
- return args;
1069
- }
1070
- // The name of the file in which the death test is located.
1071
- const char* const file_;
1072
- // The line number on which the death test is located.
1073
- const int line_;
1074
- };
1075
-
1076
- // Utility class for accumulating command-line arguments.
1077
- class Arguments {
1078
- public:
1079
- Arguments() {
1080
- args_.push_back(NULL);
1081
- }
1082
-
1083
- ~Arguments() {
1084
- for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
1085
- ++i) {
1086
- free(*i);
1087
- }
1088
- }
1089
- void AddArgument(const char* argument) {
1090
- args_.insert(args_.end() - 1, posix::StrDup(argument));
1091
- }
1092
-
1093
- template <typename Str>
1094
- void AddArguments(const ::std::vector<Str>& arguments) {
1095
- for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
1096
- i != arguments.end();
1097
- ++i) {
1098
- args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
1099
- }
1100
- }
1101
- char* const* Argv() {
1102
- return &args_[0];
1103
- }
1104
-
1105
- private:
1106
- std::vector<char*> args_;
1107
- };
1108
-
1109
- // A struct that encompasses the arguments to the child process of a
1110
- // threadsafe-style death test process.
1111
- struct ExecDeathTestArgs {
1112
- char* const* argv; // Command-line arguments for the child's call to exec
1113
- int close_fd; // File descriptor to close; the read end of a pipe
1114
- };
1115
-
1116
- # if GTEST_OS_MAC
1117
- inline char** GetEnviron() {
1118
- // When Google Test is built as a framework on MacOS X, the environ variable
1119
- // is unavailable. Apple's documentation (man environ) recommends using
1120
- // _NSGetEnviron() instead.
1121
- return *_NSGetEnviron();
1122
- }
1123
- # else
1124
- // Some POSIX platforms expect you to declare environ. extern "C" makes
1125
- // it reside in the global namespace.
1126
- extern "C" char** environ;
1127
- inline char** GetEnviron() { return environ; }
1128
- # endif // GTEST_OS_MAC
1129
-
1130
- # if !GTEST_OS_QNX
1131
- // The main function for a threadsafe-style death test child process.
1132
- // This function is called in a clone()-ed process and thus must avoid
1133
- // any potentially unsafe operations like malloc or libc functions.
1134
- static int ExecDeathTestChildMain(void* child_arg) {
1135
- ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
1136
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));
1137
-
1138
- // We need to execute the test program in the same environment where
1139
- // it was originally invoked. Therefore we change to the original
1140
- // working directory first.
1141
- const char* const original_dir =
1142
- UnitTest::GetInstance()->original_working_dir();
1143
- // We can safely call chdir() as it's a direct system call.
1144
- if (chdir(original_dir) != 0) {
1145
- DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
1146
- GetLastErrnoDescription());
1147
- return EXIT_FAILURE;
1148
- }
1149
-
1150
- // We can safely call execve() as it's a direct system call. We
1151
- // cannot use execvp() as it's a libc function and thus potentially
1152
- // unsafe. Since execve() doesn't search the PATH, the user must
1153
- // invoke the test program via a valid path that contains at least
1154
- // one path separator.
1155
- execve(args->argv[0], args->argv, GetEnviron());
1156
- DeathTestAbort(std::string("execve(") + args->argv[0] + ", ...) in " +
1157
- original_dir + " failed: " +
1158
- GetLastErrnoDescription());
1159
- return EXIT_FAILURE;
1160
- }
1161
- # endif // !GTEST_OS_QNX
1162
-
1163
- # if GTEST_HAS_CLONE
1164
- // Two utility routines that together determine the direction the stack
1165
- // grows.
1166
- // This could be accomplished more elegantly by a single recursive
1167
- // function, but we want to guard against the unlikely possibility of
1168
- // a smart compiler optimizing the recursion away.
1169
- //
1170
- // GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
1171
- // StackLowerThanAddress into StackGrowsDown, which then doesn't give
1172
- // correct answer.
1173
- static void StackLowerThanAddress(const void* ptr,
1174
- bool* result) GTEST_NO_INLINE_;
1175
- static void StackLowerThanAddress(const void* ptr, bool* result) {
1176
- int dummy;
1177
- *result = (&dummy < ptr);
1178
- }
1179
-
1180
- // Make sure AddressSanitizer does not tamper with the stack here.
1181
- GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
1182
- static bool StackGrowsDown() {
1183
- int dummy;
1184
- bool result;
1185
- StackLowerThanAddress(&dummy, &result);
1186
- return result;
1187
- }
1188
- # endif // GTEST_HAS_CLONE
1189
-
1190
- // Spawns a child process with the same executable as the current process in
1191
- // a thread-safe manner and instructs it to run the death test. The
1192
- // implementation uses fork(2) + exec. On systems where clone(2) is
1193
- // available, it is used instead, being slightly more thread-safe. On QNX,
1194
- // fork supports only single-threaded environments, so this function uses
1195
- // spawn(2) there instead. The function dies with an error message if
1196
- // anything goes wrong.
1197
- static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
1198
- ExecDeathTestArgs args = { argv, close_fd };
1199
- pid_t child_pid = -1;
1200
-
1201
- # if GTEST_OS_QNX
1202
- // Obtains the current directory and sets it to be closed in the child
1203
- // process.
1204
- const int cwd_fd = open(".", O_RDONLY);
1205
- GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);
1206
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));
1207
- // We need to execute the test program in the same environment where
1208
- // it was originally invoked. Therefore we change to the original
1209
- // working directory first.
1210
- const char* const original_dir =
1211
- UnitTest::GetInstance()->original_working_dir();
1212
- // We can safely call chdir() as it's a direct system call.
1213
- if (chdir(original_dir) != 0) {
1214
- DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
1215
- GetLastErrnoDescription());
1216
- return EXIT_FAILURE;
1217
- }
1218
-
1219
- int fd_flags;
1220
- // Set close_fd to be closed after spawn.
1221
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));
1222
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,
1223
- fd_flags | FD_CLOEXEC));
1224
- struct inheritance inherit = {0};
1225
- // spawn is a system call.
1226
- child_pid = spawn(args.argv[0], 0, NULL, &inherit, args.argv, GetEnviron());
1227
- // Restores the current working directory.
1228
- GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);
1229
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));
1230
-
1231
- # else // GTEST_OS_QNX
1232
- # if GTEST_OS_LINUX
1233
- // When a SIGPROF signal is received while fork() or clone() are executing,
1234
- // the process may hang. To avoid this, we ignore SIGPROF here and re-enable
1235
- // it after the call to fork()/clone() is complete.
1236
- struct sigaction saved_sigprof_action;
1237
- struct sigaction ignore_sigprof_action;
1238
- memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));
1239
- sigemptyset(&ignore_sigprof_action.sa_mask);
1240
- ignore_sigprof_action.sa_handler = SIG_IGN;
1241
- GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(
1242
- SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));
1243
- # endif // GTEST_OS_LINUX
1244
-
1245
- # if GTEST_HAS_CLONE
1246
- const bool use_fork = GTEST_FLAG(death_test_use_fork);
1247
-
1248
- if (!use_fork) {
1249
- static const bool stack_grows_down = StackGrowsDown();
1250
- const size_t stack_size = getpagesize();
1251
- // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
1252
- void* const stack = mmap(NULL, stack_size, PROT_READ | PROT_WRITE,
1253
- MAP_ANON | MAP_PRIVATE, -1, 0);
1254
- GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
1255
-
1256
- // Maximum stack alignment in bytes: For a downward-growing stack, this
1257
- // amount is subtracted from size of the stack space to get an address
1258
- // that is within the stack space and is aligned on all systems we care
1259
- // about. As far as I know there is no ABI with stack alignment greater
1260
- // than 64. We assume stack and stack_size already have alignment of
1261
- // kMaxStackAlignment.
1262
- const size_t kMaxStackAlignment = 64;
1263
- void* const stack_top =
1264
- static_cast<char*>(stack) +
1265
- (stack_grows_down ? stack_size - kMaxStackAlignment : 0);
1266
- GTEST_DEATH_TEST_CHECK_(stack_size > kMaxStackAlignment &&
1267
- reinterpret_cast<intptr_t>(stack_top) % kMaxStackAlignment == 0);
1268
-
1269
- child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
1270
-
1271
- GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);
1272
- }
1273
- # else
1274
- const bool use_fork = true;
1275
- # endif // GTEST_HAS_CLONE
1276
-
1277
- if (use_fork && (child_pid = fork()) == 0) {
1278
- ExecDeathTestChildMain(&args);
1279
- _exit(0);
1280
- }
1281
- # endif // GTEST_OS_QNX
1282
- # if GTEST_OS_LINUX
1283
- GTEST_DEATH_TEST_CHECK_SYSCALL_(
1284
- sigaction(SIGPROF, &saved_sigprof_action, NULL));
1285
- # endif // GTEST_OS_LINUX
1286
-
1287
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
1288
- return child_pid;
1289
- }
1290
-
1291
- // The AssumeRole process for a fork-and-exec death test. It re-executes the
1292
- // main program from the beginning, setting the --gtest_filter
1293
- // and --gtest_internal_run_death_test flags to cause only the current
1294
- // death test to be re-run.
1295
- DeathTest::TestRole ExecDeathTest::AssumeRole() {
1296
- const UnitTestImpl* const impl = GetUnitTestImpl();
1297
- const InternalRunDeathTestFlag* const flag =
1298
- impl->internal_run_death_test_flag();
1299
- const TestInfo* const info = impl->current_test_info();
1300
- const int death_test_index = info->result()->death_test_count();
1301
-
1302
- if (flag != NULL) {
1303
- set_write_fd(flag->write_fd());
1304
- return EXECUTE_TEST;
1305
- }
1306
-
1307
- int pipe_fd[2];
1308
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
1309
- // Clear the close-on-exec flag on the write end of the pipe, lest
1310
- // it be closed when the child process does an exec:
1311
- GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
1312
-
1313
- const std::string filter_flag =
1314
- std::string("--") + GTEST_FLAG_PREFIX_ + kFilterFlag + "="
1315
- + info->test_case_name() + "." + info->name();
1316
- const std::string internal_flag =
1317
- std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="
1318
- + file_ + "|" + StreamableToString(line_) + "|"
1319
- + StreamableToString(death_test_index) + "|"
1320
- + StreamableToString(pipe_fd[1]);
1321
- Arguments args;
1322
- args.AddArguments(GetArgvsForDeathTestChildProcess());
1323
- args.AddArgument(filter_flag.c_str());
1324
- args.AddArgument(internal_flag.c_str());
1325
-
1326
- DeathTest::set_last_death_test_message("");
1327
-
1328
- CaptureStderr();
1329
- // See the comment in NoExecDeathTest::AssumeRole for why the next line
1330
- // is necessary.
1331
- FlushInfoLog();
1332
-
1333
- const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]);
1334
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
1335
- set_child_pid(child_pid);
1336
- set_read_fd(pipe_fd[0]);
1337
- set_spawned(true);
1338
- return OVERSEE_TEST;
1339
- }
1340
-
1341
- # endif // !GTEST_OS_WINDOWS
1342
-
1343
- // Creates a concrete DeathTest-derived class that depends on the
1344
- // --gtest_death_test_style flag, and sets the pointer pointed to
1345
- // by the "test" argument to its address. If the test should be
1346
- // skipped, sets that pointer to NULL. Returns true, unless the
1347
- // flag is set to an invalid value.
1348
- bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
1349
- const char* file, int line,
1350
- DeathTest** test) {
1351
- UnitTestImpl* const impl = GetUnitTestImpl();
1352
- const InternalRunDeathTestFlag* const flag =
1353
- impl->internal_run_death_test_flag();
1354
- const int death_test_index = impl->current_test_info()
1355
- ->increment_death_test_count();
1356
-
1357
- if (flag != NULL) {
1358
- if (death_test_index > flag->index()) {
1359
- DeathTest::set_last_death_test_message(
1360
- "Death test count (" + StreamableToString(death_test_index)
1361
- + ") somehow exceeded expected maximum ("
1362
- + StreamableToString(flag->index()) + ")");
1363
- return false;
1364
- }
1365
-
1366
- if (!(flag->file() == file && flag->line() == line &&
1367
- flag->index() == death_test_index)) {
1368
- *test = NULL;
1369
- return true;
1370
- }
1371
- }
1372
-
1373
- # if GTEST_OS_WINDOWS
1374
-
1375
- if (GTEST_FLAG(death_test_style) == "threadsafe" ||
1376
- GTEST_FLAG(death_test_style) == "fast") {
1377
- *test = new WindowsDeathTest(statement, regex, file, line);
1378
- }
1379
-
1380
- # elif GTEST_OS_FUCHSIA
1381
-
1382
- if (GTEST_FLAG(death_test_style) == "threadsafe" ||
1383
- GTEST_FLAG(death_test_style) == "fast") {
1384
- *test = new FuchsiaDeathTest(statement, regex, file, line);
1385
- }
1386
-
1387
- # else
1388
-
1389
- if (GTEST_FLAG(death_test_style) == "threadsafe") {
1390
- *test = new ExecDeathTest(statement, regex, file, line);
1391
- } else if (GTEST_FLAG(death_test_style) == "fast") {
1392
- *test = new NoExecDeathTest(statement, regex);
1393
- }
1394
-
1395
- # endif // GTEST_OS_WINDOWS
1396
-
1397
- else { // NOLINT - this is more readable than unbalanced brackets inside #if.
1398
- DeathTest::set_last_death_test_message(
1399
- "Unknown death test style \"" + GTEST_FLAG(death_test_style)
1400
- + "\" encountered");
1401
- return false;
1402
- }
1403
-
1404
- return true;
1405
- }
1406
-
1407
- # if GTEST_OS_WINDOWS
1408
- // Recreates the pipe and event handles from the provided parameters,
1409
- // signals the event, and returns a file descriptor wrapped around the pipe
1410
- // handle. This function is called in the child process only.
1411
- static int GetStatusFileDescriptor(unsigned int parent_process_id,
1412
- size_t write_handle_as_size_t,
1413
- size_t event_handle_as_size_t) {
1414
- AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
1415
- FALSE, // Non-inheritable.
1416
- parent_process_id));
1417
- if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
1418
- DeathTestAbort("Unable to open parent process " +
1419
- StreamableToString(parent_process_id));
1420
- }
1421
-
1422
- // TODO(vladl@google.com): Replace the following check with a
1423
- // compile-time assertion when available.
1424
- GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
1425
-
1426
- const HANDLE write_handle =
1427
- reinterpret_cast<HANDLE>(write_handle_as_size_t);
1428
- HANDLE dup_write_handle;
1429
-
1430
- // The newly initialized handle is accessible only in the parent
1431
- // process. To obtain one accessible within the child, we need to use
1432
- // DuplicateHandle.
1433
- if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
1434
- ::GetCurrentProcess(), &dup_write_handle,
1435
- 0x0, // Requested privileges ignored since
1436
- // DUPLICATE_SAME_ACCESS is used.
1437
- FALSE, // Request non-inheritable handler.
1438
- DUPLICATE_SAME_ACCESS)) {
1439
- DeathTestAbort("Unable to duplicate the pipe handle " +
1440
- StreamableToString(write_handle_as_size_t) +
1441
- " from the parent process " +
1442
- StreamableToString(parent_process_id));
1443
- }
1444
-
1445
- const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);
1446
- HANDLE dup_event_handle;
1447
-
1448
- if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
1449
- ::GetCurrentProcess(), &dup_event_handle,
1450
- 0x0,
1451
- FALSE,
1452
- DUPLICATE_SAME_ACCESS)) {
1453
- DeathTestAbort("Unable to duplicate the event handle " +
1454
- StreamableToString(event_handle_as_size_t) +
1455
- " from the parent process " +
1456
- StreamableToString(parent_process_id));
1457
- }
1458
-
1459
- const int write_fd =
1460
- ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);
1461
- if (write_fd == -1) {
1462
- DeathTestAbort("Unable to convert pipe handle " +
1463
- StreamableToString(write_handle_as_size_t) +
1464
- " to a file descriptor");
1465
- }
1466
-
1467
- // Signals the parent that the write end of the pipe has been acquired
1468
- // so the parent can release its own write end.
1469
- ::SetEvent(dup_event_handle);
1470
-
1471
- return write_fd;
1472
- }
1473
- # endif // GTEST_OS_WINDOWS
1474
-
1475
- // Returns a newly created InternalRunDeathTestFlag object with fields
1476
- // initialized from the GTEST_FLAG(internal_run_death_test) flag if
1477
- // the flag is specified; otherwise returns NULL.
1478
- InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
1479
- if (GTEST_FLAG(internal_run_death_test) == "") return NULL;
1480
-
1481
- // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
1482
- // can use it here.
1483
- int line = -1;
1484
- int index = -1;
1485
- ::std::vector< ::std::string> fields;
1486
- SplitString(GTEST_FLAG(internal_run_death_test).c_str(), '|', &fields);
1487
- int write_fd = -1;
1488
-
1489
- # if GTEST_OS_WINDOWS
1490
-
1491
- unsigned int parent_process_id = 0;
1492
- size_t write_handle_as_size_t = 0;
1493
- size_t event_handle_as_size_t = 0;
1494
-
1495
- if (fields.size() != 6
1496
- || !ParseNaturalNumber(fields[1], &line)
1497
- || !ParseNaturalNumber(fields[2], &index)
1498
- || !ParseNaturalNumber(fields[3], &parent_process_id)
1499
- || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)
1500
- || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
1501
- DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
1502
- GTEST_FLAG(internal_run_death_test));
1503
- }
1504
- write_fd = GetStatusFileDescriptor(parent_process_id,
1505
- write_handle_as_size_t,
1506
- event_handle_as_size_t);
1507
-
1508
- # elif GTEST_OS_FUCHSIA
1509
-
1510
- if (fields.size() != 3
1511
- || !ParseNaturalNumber(fields[1], &line)
1512
- || !ParseNaturalNumber(fields[2], &index)) {
1513
- DeathTestAbort("Bad --gtest_internal_run_death_test flag: "
1514
- + GTEST_FLAG(internal_run_death_test));
1515
- }
1516
-
1517
- # else
1518
-
1519
- if (fields.size() != 4
1520
- || !ParseNaturalNumber(fields[1], &line)
1521
- || !ParseNaturalNumber(fields[2], &index)
1522
- || !ParseNaturalNumber(fields[3], &write_fd)) {
1523
- DeathTestAbort("Bad --gtest_internal_run_death_test flag: "
1524
- + GTEST_FLAG(internal_run_death_test));
1525
- }
1526
-
1527
- # endif // GTEST_OS_WINDOWS
1528
-
1529
- return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
1530
- }
1531
-
1532
- } // namespace internal
1533
-
1534
- #endif // GTEST_HAS_DEATH_TEST
1535
-
1536
- } // namespace testing