ceedling 0.15.1 → 0.15.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (295) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +9 -13
  4. data/README.md +21 -3
  5. data/{rakefile.rb → Rakefile} +0 -0
  6. data/lib/ceedling/version.rb +4 -4
  7. data/lib/ceedling/version.rb.erb +1 -1
  8. data/release/version.info +1 -1
  9. data/vendor/c_exception/Gemfile +1 -1
  10. data/vendor/c_exception/Gemfile.lock +12 -0
  11. data/vendor/c_exception/{docs/license.txt → LICENSE.txt} +9 -9
  12. data/vendor/c_exception/README.md +146 -0
  13. data/vendor/c_exception/{rakefile.rb → Rakefile} +6 -5
  14. data/vendor/c_exception/lib/CException.c +9 -6
  15. data/vendor/c_exception/release/build.info +1 -1
  16. data/vendor/c_exception/release/version.info +1 -1
  17. data/vendor/c_exception/test/CExceptionConfig.h +2 -0
  18. data/vendor/c_exception/test/TestException.c +4 -1
  19. data/vendor/cmock/README.md +24 -0
  20. data/vendor/cmock/{rakefile.rb → Rakefile} +12 -12
  21. data/vendor/cmock/docs/CMock Summary.odt +0 -0
  22. data/vendor/cmock/docs/CMock Summary.pdf +0 -0
  23. data/vendor/cmock/docs/CMock_Summary.md +130 -111
  24. data/vendor/cmock/docs/license.txt +1 -1
  25. data/vendor/cmock/lib/cmock.rb +36 -12
  26. data/vendor/cmock/lib/cmock_config.rb +39 -36
  27. data/vendor/cmock/lib/cmock_generator.rb +33 -25
  28. data/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb +68 -0
  29. data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +18 -42
  30. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -2
  31. data/vendor/cmock/lib/cmock_generator_utils.rb +39 -29
  32. data/vendor/cmock/lib/cmock_header_parser.rb +46 -39
  33. data/vendor/cmock/rakefile_helper.rb +38 -38
  34. data/vendor/cmock/src/cmock.c +20 -4
  35. data/vendor/cmock/src/cmock.h +6 -1
  36. data/vendor/cmock/src/cmock_internals.h +26 -3
  37. data/vendor/cmock/targets/clang_strict.yml +85 -0
  38. data/vendor/cmock/targets/gcc.yml +4 -2
  39. data/vendor/cmock/targets/gcc_64.yml +55 -0
  40. data/vendor/cmock/test/c/TestCMockC.c +3 -3
  41. data/vendor/cmock/test/c/TestCMockCDynamic.c +11 -11
  42. data/vendor/cmock/test/c/TestCMockCDynamic_Runner.c +4 -2
  43. data/vendor/cmock/test/c/TestCMockC_Runner.c +1 -1
  44. data/vendor/cmock/test/system/systest_generator.rb +38 -26
  45. data/vendor/cmock/test/system/test_compilation/const.h +8 -3
  46. data/vendor/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml +92 -58
  47. data/vendor/cmock/test/system/test_interactions/all_plugins_coexist.yml +53 -48
  48. data/vendor/cmock/test/system/test_interactions/array_and_pointer_handling.yml +58 -56
  49. data/vendor/cmock/test/system/test_interactions/basic_expect_and_return.yml +19 -18
  50. data/vendor/cmock/test/system/test_interactions/expect_and_return_custom_types.yml +13 -13
  51. data/vendor/cmock/test/system/test_interactions/expect_and_return_treat_as.yml +20 -20
  52. data/vendor/cmock/test/system/test_interactions/expect_any_args.yml +238 -0
  53. data/vendor/cmock/test/system/test_interactions/fancy_pointer_handling.yml +36 -34
  54. data/vendor/cmock/test/system/test_interactions/ignore_and_return.yml +24 -15
  55. data/vendor/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml +11 -11
  56. data/vendor/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml +235 -0
  57. data/vendor/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml +22 -26
  58. data/vendor/cmock/test/system/test_interactions/stubs_with_callbacks.yml +31 -31
  59. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +141 -109
  60. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +82 -0
  61. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +17 -81
  62. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +10 -10
  63. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +47 -41
  64. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +290 -227
  65. data/vendor/unity/{rakefile.rb → Rakefile} +13 -6
  66. data/vendor/unity/auto/colour_prompt.rb +33 -12
  67. data/vendor/unity/auto/generate_test_runner.rb +67 -63
  68. data/vendor/unity/auto/parseOutput.rb +189 -0
  69. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/makefile +41 -40
  70. data/vendor/unity/examples/example_1/readme.txt +5 -0
  71. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode.c +24 -24
  72. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode.h +3 -3
  73. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode2.c +9 -9
  74. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_1}/src/ProductionCode2.h +2 -2
  75. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_1}/test/TestProductionCode.c +62 -62
  76. data/vendor/unity/examples/{test → example_1/test}/TestProductionCode2.c +31 -31
  77. data/vendor/unity/examples/{test/no_ruby → example_1/test/test_runners}/TestProductionCode2_Runner.c +46 -46
  78. data/vendor/unity/examples/{test/no_ruby → example_1/test/test_runners}/TestProductionCode_Runner.c +50 -50
  79. data/vendor/unity/examples/example_2/makefile +45 -0
  80. data/vendor/unity/examples/example_2/readme.txt +5 -0
  81. data/vendor/unity/examples/{src → example_2/src}/ProductionCode.c +24 -24
  82. data/vendor/unity/examples/{src → example_2/src}/ProductionCode.h +3 -3
  83. data/vendor/unity/examples/{src → example_2/src}/ProductionCode2.c +9 -9
  84. data/vendor/unity/examples/{src → example_2/src}/ProductionCode2.h +2 -2
  85. data/vendor/unity/examples/{test → example_2/test}/TestProductionCode.c +64 -62
  86. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_2}/test/TestProductionCode2.c +33 -31
  87. data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
  88. data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
  89. data/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
  90. data/vendor/unity/examples/{helper → example_3/helper}/UnityHelper.c +10 -10
  91. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/helper/UnityHelper.h +12 -12
  92. data/vendor/unity/examples/{makefile → example_3/makefile} +41 -40
  93. data/vendor/unity/examples/{rakefile.rb → example_3/rakefile.rb} +44 -43
  94. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/rakefile_helper.rb +256 -256
  95. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/readme.txt +18 -17
  96. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode.c +24 -24
  97. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode.h +3 -3
  98. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode2.c +9 -9
  99. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/src/ProductionCode2.h +2 -2
  100. data/vendor/{c_exception/vendor/unity/targets/gcc_64.yml → unity/examples/example_3/target_gcc_32.yml} +46 -44
  101. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/TestProductionCode.c +62 -62
  102. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/TestProductionCode2.c +31 -31
  103. data/vendor/{c_exception/vendor/unity/examples → unity/examples/example_3}/test/no_ruby/TestProductionCode2_Runner.c +46 -46
  104. data/vendor/{cmock/vendor/unity/examples → unity/examples/example_3}/test/no_ruby/TestProductionCode_Runner.c +50 -50
  105. data/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
  106. data/vendor/unity/extras/fixture/src/unity_fixture.c +4 -1
  107. data/vendor/unity/extras/fixture/src/unity_fixture.h +17 -16
  108. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +7 -7
  109. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +17 -0
  110. data/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +1 -0
  111. data/vendor/unity/makefile +6 -4
  112. data/vendor/unity/rakefile_helper.rb +36 -27
  113. data/vendor/unity/src/unity.c +180 -181
  114. data/vendor/unity/src/unity.h +64 -2
  115. data/vendor/unity/src/unity_internals.h +188 -102
  116. data/vendor/unity/targets/clang_strict.yml +83 -0
  117. data/vendor/unity/targets/gcc_32.yml +5 -0
  118. data/vendor/unity/targets/gcc_64.yml +5 -0
  119. data/vendor/{c_exception/vendor/unity/targets/gcc.yml → unity/targets/gcc_auto_limits.yml} +5 -2
  120. data/vendor/{cmock/vendor/unity/targets/gcc_64.yml → unity/targets/gcc_auto_sizeof.yml} +6 -3
  121. data/vendor/{cmock/vendor/unity/targets/gcc.yml → unity/targets/gcc_auto_stdint.yml} +4 -2
  122. data/vendor/unity/test/expectdata/testsample_cmd.c +57 -54
  123. data/vendor/unity/test/expectdata/testsample_def.c +53 -50
  124. data/vendor/unity/test/expectdata/testsample_mock_cmd.c +79 -76
  125. data/vendor/unity/test/expectdata/testsample_mock_def.c +75 -72
  126. data/vendor/unity/test/expectdata/testsample_mock_new1.c +88 -85
  127. data/vendor/unity/test/expectdata/testsample_mock_new2.c +88 -85
  128. data/vendor/unity/test/expectdata/testsample_mock_param.c +76 -73
  129. data/vendor/unity/test/expectdata/testsample_mock_run1.c +88 -85
  130. data/vendor/unity/test/expectdata/testsample_mock_run2.c +88 -85
  131. data/vendor/unity/test/expectdata/testsample_mock_yaml.c +89 -86
  132. data/vendor/unity/test/expectdata/testsample_new1.c +63 -60
  133. data/vendor/unity/test/expectdata/testsample_new2.c +66 -63
  134. data/vendor/unity/test/expectdata/testsample_param.c +54 -51
  135. data/vendor/unity/test/expectdata/testsample_run1.c +63 -60
  136. data/vendor/unity/test/expectdata/testsample_run2.c +66 -63
  137. data/vendor/unity/test/expectdata/testsample_yaml.c +67 -64
  138. data/vendor/unity/test/test_generate_test_runner.rb +66 -72
  139. data/vendor/unity/test/testunity.c +591 -111
  140. metadata +58 -195
  141. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +0 -94
  142. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +0 -39
  143. data/vendor/c_exception/vendor/unity/auto/generate_config.yml +0 -36
  144. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +0 -202
  145. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +0 -313
  146. data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +0 -23
  147. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +0 -139
  148. data/vendor/c_exception/vendor/unity/docs/Unity Summary.odt +0 -0
  149. data/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf +0 -0
  150. data/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +0 -217
  151. data/vendor/c_exception/vendor/unity/docs/license.txt +0 -31
  152. data/vendor/c_exception/vendor/unity/examples/helper/UnityHelper.c +0 -10
  153. data/vendor/c_exception/vendor/unity/examples/helper/UnityHelper.h +0 -12
  154. data/vendor/c_exception/vendor/unity/examples/makefile +0 -40
  155. data/vendor/c_exception/vendor/unity/examples/rakefile.rb +0 -32
  156. data/vendor/c_exception/vendor/unity/examples/rakefile_helper.rb +0 -256
  157. data/vendor/c_exception/vendor/unity/examples/test/no_ruby/TestProductionCode_Runner.c +0 -50
  158. data/vendor/c_exception/vendor/unity/extras/fixture/build/MakefileWorker.mk +0 -331
  159. data/vendor/c_exception/vendor/unity/extras/fixture/build/filterGcov.sh +0 -61
  160. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +0 -37
  161. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
  162. data/vendor/c_exception/vendor/unity/extras/fixture/readme.txt +0 -9
  163. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +0 -381
  164. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +0 -81
  165. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -44
  166. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -16
  167. data/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +0 -21
  168. data/vendor/c_exception/vendor/unity/extras/fixture/test/testunity_fixture.c +0 -39
  169. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -321
  170. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -40
  171. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -56
  172. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
  173. data/vendor/c_exception/vendor/unity/makefile +0 -35
  174. data/vendor/c_exception/vendor/unity/rakefile.rb +0 -59
  175. data/vendor/c_exception/vendor/unity/rakefile_helper.rb +0 -240
  176. data/vendor/c_exception/vendor/unity/release/build.info +0 -2
  177. data/vendor/c_exception/vendor/unity/release/version.info +0 -2
  178. data/vendor/c_exception/vendor/unity/src/unity.c +0 -979
  179. data/vendor/c_exception/vendor/unity/src/unity.h +0 -232
  180. data/vendor/c_exception/vendor/unity/src/unity_internals.h +0 -424
  181. data/vendor/c_exception/vendor/unity/targets/hitech_picc18.yml +0 -101
  182. data/vendor/c_exception/vendor/unity/targets/iar_arm_v4.yml +0 -89
  183. data/vendor/c_exception/vendor/unity/targets/iar_arm_v5.yml +0 -79
  184. data/vendor/c_exception/vendor/unity/targets/iar_arm_v5_3.yml +0 -79
  185. data/vendor/c_exception/vendor/unity/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -93
  186. data/vendor/c_exception/vendor/unity/targets/iar_cortexm3_v5.yml +0 -83
  187. data/vendor/c_exception/vendor/unity/targets/iar_msp430.yml +0 -94
  188. data/vendor/c_exception/vendor/unity/targets/iar_sh2a_v6.yml +0 -85
  189. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +0 -54
  190. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +0 -50
  191. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -76
  192. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +0 -72
  193. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -85
  194. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -85
  195. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +0 -73
  196. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -85
  197. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -85
  198. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -86
  199. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +0 -60
  200. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +0 -63
  201. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +0 -51
  202. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +0 -60
  203. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +0 -63
  204. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +0 -64
  205. data/vendor/c_exception/vendor/unity/test/test_generate_test_runner.rb +0 -94
  206. data/vendor/c_exception/vendor/unity/test/testdata/mocksample.c +0 -51
  207. data/vendor/c_exception/vendor/unity/test/testdata/sample.yml +0 -9
  208. data/vendor/c_exception/vendor/unity/test/testdata/testsample.c +0 -51
  209. data/vendor/c_exception/vendor/unity/test/testparameterized.c +0 -101
  210. data/vendor/c_exception/vendor/unity/test/testunity.c +0 -2024
  211. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  212. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  213. data/vendor/cmock/vendor/c_exception/docs/license.txt +0 -30
  214. data/vendor/cmock/vendor/c_exception/docs/readme.txt +0 -236
  215. data/vendor/cmock/vendor/c_exception/lib/CException.c +0 -39
  216. data/vendor/cmock/vendor/c_exception/lib/CException.h +0 -70
  217. data/vendor/cmock/vendor/c_exception/makefile +0 -24
  218. data/vendor/cmock/vendor/c_exception/rakefile.rb +0 -41
  219. data/vendor/cmock/vendor/c_exception/release/build.info +0 -2
  220. data/vendor/cmock/vendor/c_exception/release/version.info +0 -2
  221. data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +0 -27
  222. data/vendor/cmock/vendor/c_exception/test/TestException.c +0 -291
  223. data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +0 -62
  224. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +0 -94
  225. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +0 -39
  226. data/vendor/cmock/vendor/unity/auto/generate_config.yml +0 -36
  227. data/vendor/cmock/vendor/unity/auto/generate_module.rb +0 -202
  228. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +0 -313
  229. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +0 -23
  230. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +0 -139
  231. data/vendor/cmock/vendor/unity/docs/Unity Summary.odt +0 -0
  232. data/vendor/cmock/vendor/unity/docs/Unity Summary.pdf +0 -0
  233. data/vendor/cmock/vendor/unity/docs/Unity Summary.txt +0 -217
  234. data/vendor/cmock/vendor/unity/docs/license.txt +0 -31
  235. data/vendor/cmock/vendor/unity/examples/helper/UnityHelper.c +0 -10
  236. data/vendor/cmock/vendor/unity/examples/rakefile.rb +0 -32
  237. data/vendor/cmock/vendor/unity/examples/readme.txt +0 -18
  238. data/vendor/cmock/vendor/unity/examples/test/no_ruby/TestProductionCode2_Runner.c +0 -46
  239. data/vendor/cmock/vendor/unity/extras/fixture/build/MakefileWorker.mk +0 -331
  240. data/vendor/cmock/vendor/unity/extras/fixture/build/filterGcov.sh +0 -61
  241. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +0 -37
  242. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
  243. data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +0 -9
  244. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +0 -381
  245. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +0 -81
  246. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -44
  247. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -16
  248. data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +0 -21
  249. data/vendor/cmock/vendor/unity/extras/fixture/test/testunity_fixture.c +0 -39
  250. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -321
  251. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -40
  252. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -56
  253. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
  254. data/vendor/cmock/vendor/unity/makefile +0 -35
  255. data/vendor/cmock/vendor/unity/rakefile.rb +0 -48
  256. data/vendor/cmock/vendor/unity/rakefile_helper.rb +0 -240
  257. data/vendor/cmock/vendor/unity/release/build.info +0 -2
  258. data/vendor/cmock/vendor/unity/release/version.info +0 -2
  259. data/vendor/cmock/vendor/unity/src/unity.c +0 -979
  260. data/vendor/cmock/vendor/unity/src/unity.h +0 -232
  261. data/vendor/cmock/vendor/unity/src/unity_internals.h +0 -424
  262. data/vendor/cmock/vendor/unity/targets/hitech_picc18.yml +0 -101
  263. data/vendor/cmock/vendor/unity/targets/iar_arm_v4.yml +0 -89
  264. data/vendor/cmock/vendor/unity/targets/iar_arm_v5.yml +0 -79
  265. data/vendor/cmock/vendor/unity/targets/iar_arm_v5_3.yml +0 -79
  266. data/vendor/cmock/vendor/unity/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -93
  267. data/vendor/cmock/vendor/unity/targets/iar_cortexm3_v5.yml +0 -83
  268. data/vendor/cmock/vendor/unity/targets/iar_msp430.yml +0 -94
  269. data/vendor/cmock/vendor/unity/targets/iar_sh2a_v6.yml +0 -85
  270. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +0 -54
  271. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +0 -50
  272. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -76
  273. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +0 -72
  274. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -85
  275. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -85
  276. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +0 -73
  277. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -85
  278. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -85
  279. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -86
  280. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +0 -60
  281. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +0 -63
  282. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +0 -51
  283. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +0 -60
  284. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +0 -63
  285. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +0 -64
  286. data/vendor/cmock/vendor/unity/test/test_generate_test_runner.rb +0 -94
  287. data/vendor/cmock/vendor/unity/test/testdata/mocksample.c +0 -51
  288. data/vendor/cmock/vendor/unity/test/testdata/sample.yml +0 -9
  289. data/vendor/cmock/vendor/unity/test/testdata/testsample.c +0 -51
  290. data/vendor/cmock/vendor/unity/test/testparameterized.c +0 -101
  291. data/vendor/cmock/vendor/unity/test/testunity.c +0 -2024
  292. data/vendor/unity/Gemfile +0 -4
  293. data/vendor/unity/examples/helper/UnityHelper.h +0 -12
  294. data/vendor/unity/examples/rakefile_helper.rb +0 -256
  295. data/vendor/unity/examples/readme.txt +0 -18
@@ -1,39 +0,0 @@
1
- # ==========================================
2
- # Unity Project - A Test Framework for C
3
- # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
- # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
6
-
7
- require "#{File.expand_path(File.dirname(__FILE__))}/colour_prompt"
8
-
9
- $colour_output = true
10
-
11
- def report(message)
12
- if not $colour_output
13
- $stdout.puts(message)
14
- else
15
- message = message.join('\n') if (message.class == Array)
16
- message.each_line do |line|
17
- line.chomp!
18
- colour = case(line)
19
- when /(?:total\s+)?tests:?\s+(\d+)\s+(?:total\s+)?failures:?\s+\d+\s+Ignored:?/i
20
- ($1.to_i == 0) ? :green : :red
21
- when /PASS/
22
- :green
23
- when /^OK$/
24
- :green
25
- when /(?:FAIL|ERROR)/
26
- :red
27
- when /IGNORE/
28
- :yellow
29
- when /^(?:Creating|Compiling|Linking)/
30
- :white
31
- else
32
- :silver
33
- end
34
- colour_puts(colour, line)
35
- end
36
- end
37
- $stdout.flush
38
- $stderr.flush
39
- end
@@ -1,36 +0,0 @@
1
- #this is a sample configuration file for generate_module
2
- #you would use it by calling generate_module with the -ygenerate_config.yml option
3
- #files like this are useful for customizing generate_module to your environment
4
- :generate_module:
5
- :defaults:
6
- #these defaults are used in place of any missing options at the command line
7
- :path_src: ../src/
8
- :path_inc: ../src/
9
- :path_tst: ../test/
10
- :update_svn: true
11
- :includes:
12
- #use [] for no additional includes, otherwise list the includes on separate lines
13
- :src:
14
- - Defs.h
15
- - Board.h
16
- :inc: []
17
- :tst:
18
- - Defs.h
19
- - Board.h
20
- - Exception.h
21
- :boilerplates:
22
- #these are inserted at the top of generated files.
23
- #just comment out or remove if not desired.
24
- #use %1$s where you would like the file name to appear (path/extension not included)
25
- :src: |
26
- //-------------------------------------------
27
- // %1$s.c
28
- //-------------------------------------------
29
- :inc: |
30
- //-------------------------------------------
31
- // %1$s.h
32
- //-------------------------------------------
33
- :tst: |
34
- //-------------------------------------------
35
- // Test%1$s.c : Units tests for %1$s.c
36
- //-------------------------------------------
@@ -1,202 +0,0 @@
1
- # ==========================================
2
- # Unity Project - A Test Framework for C
3
- # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
- # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
6
-
7
- # This script creates all the files with start code necessary for a new module.
8
- # A simple module only requires a source file, header file, and test file.
9
- # Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware).
10
-
11
- require 'rubygems'
12
- require 'fileutils'
13
-
14
- HERE = File.expand_path(File.dirname(__FILE__)) + '/'
15
-
16
- #help text when requested
17
- HELP_TEXT = [ "\nGENERATE MODULE\n-------- ------",
18
- "\nUsage: ruby generate_module [options] module_name",
19
- " -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)",
20
- " -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)",
21
- " -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)",
22
- " -p\"MCH\" sets the output pattern to MCH.",
23
- " dh - driver hardware.",
24
- " dih - driver interrupt hardware.",
25
- " mch - model conductor hardware.",
26
- " mvp - model view presenter.",
27
- " src - just a single source module. (DEFAULT)",
28
- " -d destroy module instead of creating it.",
29
- " -u update subversion too (requires subversion command line)",
30
- " -y\"my.yml\" selects a different yaml config file for module generation",
31
- "" ].join("\n")
32
-
33
- #Built in patterns
34
- PATTERNS = { 'src' => {'' => { :inc => [] } },
35
- 'dh' => {'Driver' => { :inc => ['%1$sHardware.h'] },
36
- 'Hardware' => { :inc => [] }
37
- },
38
- 'dih' => {'Driver' => { :inc => ['%1$sHardware.h', '%1$sInterrupt.h'] },
39
- 'Interrupt'=> { :inc => ['%1$sHardware.h'] },
40
- 'Hardware' => { :inc => [] }
41
- },
42
- 'mch' => {'Model' => { :inc => [] },
43
- 'Conductor'=> { :inc => ['%1$sModel.h', '%1$sHardware.h'] },
44
- 'Hardware' => { :inc => [] }
45
- },
46
- 'mvp' => {'Model' => { :inc => [] },
47
- 'Presenter'=> { :inc => ['%1$sModel.h', '%1$sView.h'] },
48
- 'View' => { :inc => [] }
49
- }
50
- }
51
-
52
- #TEMPLATE_TST
53
- TEMPLATE_TST = %q[#include "unity.h"
54
- %2$s#include "%1$s.h"
55
-
56
- void setUp(void)
57
- {
58
- }
59
-
60
- void tearDown(void)
61
- {
62
- }
63
-
64
- void test_%1$s_NeedToImplement(void)
65
- {
66
- TEST_IGNORE();
67
- }
68
- ]
69
-
70
- #TEMPLATE_SRC
71
- TEMPLATE_SRC = %q[%2$s#include "%1$s.h"
72
- ]
73
-
74
- #TEMPLATE_INC
75
- TEMPLATE_INC = %q[#ifndef _%3$s_H
76
- #define _%3$s_H%2$s
77
-
78
- #endif // _%3$s_H
79
- ]
80
-
81
- # Parse the command line parameters.
82
- ARGV.each do |arg|
83
- case(arg)
84
- when /^-d/ then @destroy = true
85
- when /^-u/ then @update_svn = true
86
- when /^-p(\w+)/ then @pattern = $1
87
- when /^-s(.+)/ then @path_src = $1
88
- when /^-i(.+)/ then @path_inc = $1
89
- when /^-t(.+)/ then @path_tst = $1
90
- when /^-y(.+)/ then @yaml_config = $1
91
- when /^(\w+)/
92
- raise "ERROR: You can't have more than one Module name specified!" unless @module_name.nil?
93
- @module_name = arg
94
- when /^-(h|-help)/
95
- puts HELP_TEXT
96
- exit
97
- else
98
- raise "ERROR: Unknown option specified '#{arg}'"
99
- end
100
- end
101
- raise "ERROR: You must have a Module name specified! (use option -h for help)" if @module_name.nil?
102
-
103
- #load yaml file if one was requested
104
- if @yaml_config
105
- require 'yaml'
106
- cfg = YAML.load_file(HERE + @yaml_config)[:generate_module]
107
- @path_src = cfg[:defaults][:path_src] if @path_src.nil?
108
- @path_inc = cfg[:defaults][:path_inc] if @path_inc.nil?
109
- @path_tst = cfg[:defaults][:path_tst] if @path_tst.nil?
110
- @update_svn = cfg[:defaults][:update_svn] if @update_svn.nil?
111
- @extra_inc = cfg[:includes]
112
- @boilerplates = cfg[:boilerplates]
113
- else
114
- @boilerplates = {}
115
- end
116
-
117
- # Create default file paths if none were provided
118
- @path_src = HERE + "../src/" if @path_src.nil?
119
- @path_inc = @path_src if @path_inc.nil?
120
- @path_tst = HERE + "../test/" if @path_tst.nil?
121
- @path_src += '/' unless (@path_src[-1] == 47)
122
- @path_inc += '/' unless (@path_inc[-1] == 47)
123
- @path_tst += '/' unless (@path_tst[-1] == 47)
124
- @pattern = 'src' if @pattern.nil?
125
- @includes = { :src => [], :inc => [], :tst => [] }
126
- @includes.merge!(@extra_inc) unless @extra_inc.nil?
127
-
128
- #create triad definition
129
- TRIAD = [ { :ext => '.c', :path => @path_src, :template => TEMPLATE_SRC, :inc => :src, :boilerplate => @boilerplates[:src] },
130
- { :ext => '.h', :path => @path_inc, :template => TEMPLATE_INC, :inc => :inc, :boilerplate => @boilerplates[:inc] },
131
- { :ext => '.c', :path => @path_tst+'Test', :template => TEMPLATE_TST, :inc => :tst, :boilerplate => @boilerplates[:tst] },
132
- ]
133
-
134
- #prepare the pattern for use
135
- @patterns = PATTERNS[@pattern.downcase]
136
- raise "ERROR: The design pattern specified isn't one that I recognize!" if @patterns.nil?
137
-
138
- # Assemble the path/names of the files we need to work with.
139
- files = []
140
- TRIAD.each do |triad|
141
- @patterns.each_pair do |pattern_file, pattern_traits|
142
- files << {
143
- :path => "#{triad[:path]}#{@module_name}#{pattern_file}#{triad[:ext]}",
144
- :name => "#{@module_name}#{pattern_file}",
145
- :template => triad[:template],
146
- :boilerplate => triad[:boilerplate],
147
- :includes => case(triad[:inc])
148
- when :src then @includes[:src] | pattern_traits[:inc].map{|f| f % [@module_name]}
149
- when :inc then @includes[:inc]
150
- when :tst then @includes[:tst] | pattern_traits[:inc].map{|f| "Mock#{f}"% [@module_name]}
151
- end
152
- }
153
- end
154
- end
155
-
156
- # destroy files if that was what was requested
157
- if @destroy
158
- files.each do |filespec|
159
- file = filespec[:path]
160
- if File.exist?(file)
161
- if @update_svn
162
- `svn delete \"#{file}\" --force`
163
- puts "File #{file} deleted and removed from source control"
164
- else
165
- FileUtils.remove(file)
166
- puts "File #{file} deleted"
167
- end
168
- else
169
- puts "File #{file} does not exist so cannot be removed."
170
- end
171
- end
172
- puts "Destroy Complete"
173
- exit
174
- end
175
-
176
- #Abort if any module already exists
177
- files.each do |file|
178
- raise "ERROR: File #{file[:name]} already exists. Exiting." if File.exist?(file[:path])
179
- end
180
-
181
- # Create Source Modules
182
- files.each_with_index do |file, i|
183
- File.open(file[:path], 'w') do |f|
184
- f.write(file[:boilerplate] % [file[:name]]) unless file[:boilerplate].nil?
185
- f.write(file[:template] % [ file[:name],
186
- file[:includes].map{|f| "#include \"#{f}\"\n"}.join,
187
- file[:name].upcase ]
188
- )
189
- end
190
- if (@update_svn)
191
- `svn add \"#{file[:path]}\"`
192
- if $?.exitstatus == 0
193
- puts "File #{file[:path]} created and added to source control"
194
- else
195
- puts "File #{file[:path]} created but FAILED adding to source control!"
196
- end
197
- else
198
- puts "File #{file[:path]} created"
199
- end
200
- end
201
-
202
- puts 'Generate Complete'
@@ -1,313 +0,0 @@
1
- # ==========================================
2
- # Unity Project - A Test Framework for C
3
- # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
- # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
6
-
7
- File.expand_path(File.join(File.dirname(__FILE__),'colour_prompt'))
8
-
9
- class UnityTestRunnerGenerator
10
-
11
- def initialize(options = nil)
12
- @options = { :includes => [], :plugins => [], :framework => :unity }
13
- case(options)
14
- when NilClass then @options
15
- when String then @options.merge!(UnityTestRunnerGenerator.grab_config(options))
16
- when Hash then @options.merge!(options)
17
- else raise "If you specify arguments, it should be a filename or a hash of options"
18
- end
19
- end
20
-
21
- def self.grab_config(config_file)
22
- options = { :includes => [], :plugins => [], :framework => :unity }
23
- unless (config_file.nil? or config_file.empty?)
24
- require 'yaml'
25
- yaml_guts = YAML.load_file(config_file)
26
- options.merge!(yaml_guts[:unity] ? yaml_guts[:unity] : yaml_guts[:cmock])
27
- raise "No :unity or :cmock section found in #{config_file}" unless options
28
- end
29
- return(options)
30
- end
31
-
32
- def run(input_file, output_file, options=nil)
33
- tests = []
34
- testfile_includes = []
35
- used_mocks = []
36
-
37
- @options.merge!(options) unless options.nil?
38
- module_name = File.basename(input_file)
39
-
40
- #pull required data from source file
41
- File.open(input_file, 'r') do |input|
42
- tests = find_tests(input)
43
- testfile_includes = find_includes(input)
44
- used_mocks = find_mocks(testfile_includes)
45
- end
46
-
47
- #build runner file
48
- generate(input_file, output_file, tests, used_mocks)
49
-
50
- #determine which files were used to return them
51
- all_files_used = [input_file, output_file]
52
- all_files_used += testfile_includes.map {|filename| filename + '.c'} unless testfile_includes.empty?
53
- all_files_used += @options[:includes] unless @options[:includes].empty?
54
- return all_files_used.uniq
55
- end
56
-
57
- def generate(input_file, output_file, tests, used_mocks)
58
- File.open(output_file, 'w') do |output|
59
- create_header(output, used_mocks)
60
- create_externs(output, tests, used_mocks)
61
- create_mock_management(output, used_mocks)
62
- create_suite_setup_and_teardown(output)
63
- create_reset(output, used_mocks)
64
- create_main(output, input_file, tests)
65
- end
66
- end
67
-
68
- def find_tests(input_file)
69
- tests_raw = []
70
- tests_args = []
71
- tests_and_line_numbers = []
72
-
73
- input_file.rewind
74
- source_raw = input_file.read
75
- source_scrubbed = source_raw.gsub(/\/\/.*$/, '') # remove line comments
76
- source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments
77
- lines = source_scrubbed.split(/(^\s*\#.*$) # Treat preprocessor directives as a logical line
78
- | (;|\{|\}) /x) # Match ;, {, and } as end of lines
79
-
80
- lines.each_with_index do |line, index|
81
- #find tests
82
- if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+(test.*?)\s*\(\s*(.*)\s*\)/
83
- arguments = $1
84
- name = $2
85
- call = $3
86
- args = nil
87
- if (@options[:use_param_tests] and !arguments.empty?)
88
- args = []
89
- arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]}
90
- end
91
- tests_and_line_numbers << { :test => name, :args => args, :call => call, :line_number => 0 }
92
- tests_args = []
93
- end
94
- end
95
-
96
- #determine line numbers and create tests to run
97
- source_lines = source_raw.split("\n")
98
- source_index = 0;
99
- tests_and_line_numbers.size.times do |i|
100
- source_lines[source_index..-1].each_with_index do |line, index|
101
- if (line =~ /#{tests_and_line_numbers[i][:test]}/)
102
- source_index += index
103
- tests_and_line_numbers[i][:line_number] = source_index + 1
104
- break
105
- end
106
- end
107
- end
108
-
109
- return tests_and_line_numbers
110
- end
111
-
112
- def find_includes(input_file)
113
- input_file.rewind
114
-
115
- #read in file
116
- source = input_file.read
117
-
118
- #remove comments (block and line, in three steps to ensure correct precedence)
119
- source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks
120
- source.gsub!(/\/\*.*?\*\//m, '') # remove block comments
121
- source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
122
-
123
- #parse out includes
124
- return source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten
125
- end
126
-
127
- def find_mocks(includes)
128
- mock_headers = []
129
- includes.each do |include_file|
130
- mock_headers << File.basename(include_file) if (include_file =~ /^mock/i)
131
- end
132
- return mock_headers
133
- end
134
-
135
- def create_header(output, mocks)
136
- output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
137
- create_runtest(output, mocks)
138
- output.puts("\n//=======Automagically Detected Files To Include=====")
139
- output.puts("#include \"#{@options[:framework].to_s}.h\"")
140
- output.puts('#include "cmock.h"') unless (mocks.empty?)
141
- @options[:includes].flatten.uniq.compact.each do |inc|
142
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h','')}.h\""}")
143
- end
144
- output.puts('#include <setjmp.h>')
145
- output.puts('#include <stdio.h>')
146
- output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
147
- mocks.each do |mock|
148
- output.puts("#include \"#{mock.gsub('.h','')}.h\"")
149
- end
150
- if @options[:enforce_strict_ordering]
151
- output.puts('')
152
- output.puts('int GlobalExpectCount;')
153
- output.puts('int GlobalVerifyOrder;')
154
- output.puts('char* GlobalOrderError;')
155
- end
156
- end
157
-
158
- def create_externs(output, tests, mocks)
159
- output.puts("\n//=======External Functions This Runner Calls=====")
160
- output.puts("extern void setUp(void);")
161
- output.puts("extern void tearDown(void);")
162
- tests.each do |test|
163
- output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});")
164
- end
165
- output.puts('')
166
- end
167
-
168
- def create_mock_management(output, mocks)
169
- unless (mocks.empty?)
170
- output.puts("\n//=======Mock Management=====")
171
- output.puts("static void CMock_Init(void)")
172
- output.puts("{")
173
- if @options[:enforce_strict_ordering]
174
- output.puts(" GlobalExpectCount = 0;")
175
- output.puts(" GlobalVerifyOrder = 0;")
176
- output.puts(" GlobalOrderError = NULL;")
177
- end
178
- mocks.each do |mock|
179
- output.puts(" #{mock}_Init();")
180
- end
181
- output.puts("}\n")
182
-
183
- output.puts("static void CMock_Verify(void)")
184
- output.puts("{")
185
- mocks.each do |mock|
186
- output.puts(" #{mock}_Verify();")
187
- end
188
- output.puts("}\n")
189
-
190
- output.puts("static void CMock_Destroy(void)")
191
- output.puts("{")
192
- mocks.each do |mock|
193
- output.puts(" #{mock}_Destroy();")
194
- end
195
- output.puts("}\n")
196
- end
197
- end
198
-
199
- def create_suite_setup_and_teardown(output)
200
- unless (@options[:suite_setup].nil?)
201
- output.puts("\n//=======Suite Setup=====")
202
- output.puts("static int suite_setup(void)")
203
- output.puts("{")
204
- output.puts(@options[:suite_setup])
205
- output.puts("}")
206
- end
207
- unless (@options[:suite_teardown].nil?)
208
- output.puts("\n//=======Suite Teardown=====")
209
- output.puts("static int suite_teardown(int num_failures)")
210
- output.puts("{")
211
- output.puts(@options[:suite_teardown])
212
- output.puts("}")
213
- end
214
- end
215
-
216
- def create_runtest(output, used_mocks)
217
- cexception = @options[:plugins].include? :cexception
218
- va_args1 = @options[:use_param_tests] ? ', ...' : ''
219
- va_args2 = @options[:use_param_tests] ? '__VA_ARGS__' : ''
220
- output.puts("\n//=======Test Runner Used To Run Each Test Below=====")
221
- output.puts("#define RUN_TEST_NO_ARGS") if @options[:use_param_tests]
222
- output.puts("#define RUN_TEST(TestFunc, TestLineNum#{va_args1}) \\")
223
- output.puts("{ \\")
224
- output.puts(" Unity.CurrentTestName = #TestFunc#{va_args2.empty? ? '' : " \"(\" ##{va_args2} \")\""}; \\")
225
- output.puts(" Unity.CurrentTestLineNumber = TestLineNum; \\")
226
- output.puts(" Unity.NumberOfTests++; \\")
227
- output.puts(" if (TEST_PROTECT()) \\")
228
- output.puts(" { \\")
229
- output.puts(" CEXCEPTION_T e; \\") if cexception
230
- output.puts(" Try { \\") if cexception
231
- output.puts(" CMock_Init(); \\") unless (used_mocks.empty?)
232
- output.puts(" setUp(); \\")
233
- output.puts(" TestFunc(#{va_args2}); \\")
234
- output.puts(" CMock_Verify(); \\") unless (used_mocks.empty?)
235
- output.puts(" } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, \"Unhandled Exception!\"); } \\") if cexception
236
- output.puts(" } \\")
237
- output.puts(" CMock_Destroy(); \\") unless (used_mocks.empty?)
238
- output.puts(" if (TEST_PROTECT() && !TEST_IS_IGNORED) \\")
239
- output.puts(" { \\")
240
- output.puts(" tearDown(); \\")
241
- output.puts(" } \\")
242
- output.puts(" UnityConcludeTest(); \\")
243
- output.puts("}\n")
244
- end
245
-
246
- def create_reset(output, used_mocks)
247
- output.puts("\n//=======Test Reset Option=====")
248
- output.puts("void resetTest()")
249
- output.puts("{")
250
- output.puts(" CMock_Verify();") unless (used_mocks.empty?)
251
- output.puts(" CMock_Destroy();") unless (used_mocks.empty?)
252
- output.puts(" tearDown();")
253
- output.puts(" CMock_Init();") unless (used_mocks.empty?)
254
- output.puts(" setUp();")
255
- output.puts("}")
256
- end
257
-
258
- def create_main(output, filename, tests)
259
- output.puts("\n\n//=======MAIN=====")
260
- output.puts("int main(void)")
261
- output.puts("{")
262
- output.puts(" suite_setup();") unless @options[:suite_setup].nil?
263
- output.puts(" Unity.TestFile = \"#{filename}\";")
264
- output.puts(" UnityBegin();")
265
- if (@options[:use_param_tests])
266
- tests.each do |test|
267
- if ((test[:args].nil?) or (test[:args].empty?))
268
- output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, RUN_TEST_NO_ARGS);")
269
- else
270
- test[:args].each {|args| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, #{args});")}
271
- end
272
- end
273
- else
274
- tests.each { |test| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]});") }
275
- end
276
- output.puts()
277
- output.puts(" return #{@options[:suite_teardown].nil? ? "" : "suite_teardown"}(UnityEnd());")
278
- output.puts("}")
279
- end
280
- end
281
-
282
-
283
- if ($0 == __FILE__)
284
- options = { :includes => [] }
285
- yaml_file = nil
286
-
287
- #parse out all the options first
288
- ARGV.reject! do |arg|
289
- case(arg)
290
- when '-cexception'
291
- options[:plugins] = [:cexception]; true
292
- when /\.*\.yml/
293
- options = UnityTestRunnerGenerator.grab_config(arg); true
294
- else false
295
- end
296
- end
297
-
298
- #make sure there is at least one parameter left (the input file)
299
- if !ARGV[0]
300
- puts ["usage: ruby #{__FILE__} (yaml) (options) input_test_file output_test_runner (includes)",
301
- " blah.yml - will use config options in the yml file (see docs)",
302
- " -cexception - include cexception support"].join("\n")
303
- exit 1
304
- end
305
-
306
- #create the default test runner name if not specified
307
- ARGV[1] = ARGV[0].gsub(".c","_Runner.c") if (!ARGV[1])
308
-
309
- #everything else is an include file
310
- options[:includes] ||= (ARGV.slice(2..-1).flatten.compact) if (ARGV.size > 2)
311
-
312
- UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1])
313
- end