ceedling 0.28.1 → 0.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (467) hide show
  1. checksums.yaml +4 -4
  2. data/bin/ceedling +3 -2
  3. data/docs/CeedlingPacket.md +4 -0
  4. data/lib/ceedling/configurator_builder.rb +26 -0
  5. data/lib/ceedling/configurator_setup.rb +1 -0
  6. data/lib/ceedling/file_finder.rb +7 -1
  7. data/lib/ceedling/flaginator.rb +28 -8
  8. data/lib/ceedling/rules_release.rake +3 -3
  9. data/lib/ceedling/rules_release_deep_dependencies.rake +1 -1
  10. data/lib/ceedling/version.rb +3 -3
  11. data/plugins/gcov/config/defaults.yml +4 -3
  12. data/plugins/module_generator/lib/module_generator.rb +1 -1
  13. data/plugins/subprojects/README.md +63 -63
  14. data/plugins/subprojects/config/defaults.yml +33 -33
  15. data/plugins/subprojects/lib/subprojects.rb +92 -92
  16. data/plugins/subprojects/subprojects.rake +78 -78
  17. data/vendor/cmock/docs/CMock_Summary.md +75 -60
  18. data/vendor/cmock/lib/cmock_config.rb +1 -0
  19. data/vendor/cmock/lib/cmock_generator.rb +13 -1
  20. data/vendor/cmock/lib/cmock_generator_plugin_expect.rb +1 -1
  21. data/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb +0 -14
  22. data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +4 -0
  23. data/vendor/cmock/lib/cmock_generator_utils.rb +4 -5
  24. data/vendor/cmock/lib/cmock_header_parser.rb +26 -28
  25. data/vendor/cmock/lib/cmock_plugin_manager.rb +27 -12
  26. data/vendor/cmock/scripts/create_makefile.rb +5 -4
  27. data/vendor/cmock/scripts/test_summary.rb +1 -1
  28. data/vendor/cmock/test/system/test_interactions/ignore_and_return.yml +167 -0
  29. data/vendor/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml +37 -0
  30. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +14 -1
  31. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +25 -24
  32. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +101 -3
  33. data/vendor/unity/README.md +11 -0
  34. data/vendor/unity/auto/generate_module.rb +3 -3
  35. data/vendor/unity/auto/stylize_as_junit.rb +0 -0
  36. data/vendor/unity/docs/UnityAssertionsReference.md +54 -0
  37. data/vendor/unity/examples/unity_config.h +6 -4
  38. data/vendor/unity/extras/fixture/rakefile_helper.rb +1 -1
  39. data/vendor/unity/extras/fixture/test/Makefile +1 -0
  40. data/vendor/unity/src/unity.c +121 -73
  41. data/vendor/unity/src/unity.h +60 -0
  42. data/vendor/unity/src/unity_internals.h +47 -7
  43. data/vendor/unity/test/Makefile +1 -0
  44. data/vendor/unity/test/rakefile_helper.rb +1 -1
  45. data/vendor/unity/test/tests/testunity.c +508 -164
  46. metadata +3 -423
  47. data/out.fail +0 -21
  48. data/plugins/fake_function_framework/vendor/fff/LICENSE +0 -25
  49. data/plugins/fake_function_framework/vendor/fff/Makefile +0 -10
  50. data/plugins/fake_function_framework/vendor/fff/README.md +0 -454
  51. data/plugins/fake_function_framework/vendor/fff/buildandtest +0 -15
  52. data/plugins/fake_function_framework/vendor/fff/examples/Makefile +0 -7
  53. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/Makefile +0 -64
  54. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.c +0 -24
  55. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.h +0 -11
  56. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.test.cpp +0 -50
  57. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.test.fff.cpp +0 -62
  58. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/hardware_abstraction.h +0 -15
  59. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/registers.h +0 -13
  60. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/DISPLAY.h +0 -17
  61. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/Kata.txt +0 -25
  62. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/Makefile +0 -67
  63. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/SYSTEM.h +0 -21
  64. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI.c +0 -48
  65. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI.h +0 -12
  66. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI_test_ansic.c +0 -183
  67. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI_test_cpp.cpp +0 -136
  68. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/test_suite_template.c +0 -34
  69. data/plugins/fake_function_framework/vendor/fff/fakegen.rb +0 -420
  70. data/plugins/fake_function_framework/vendor/fff/fff.h +0 -5112
  71. data/plugins/fake_function_framework/vendor/fff/gtest/Makefile +0 -22
  72. data/plugins/fake_function_framework/vendor/fff/gtest/gtest-all.cc +0 -9118
  73. data/plugins/fake_function_framework/vendor/fff/gtest/gtest-main.cc +0 -6
  74. data/plugins/fake_function_framework/vendor/fff/gtest/gtest.h +0 -19537
  75. data/plugins/fake_function_framework/vendor/fff/test/Makefile +0 -81
  76. data/plugins/fake_function_framework/vendor/fff/test/c_test_framework.h +0 -15
  77. data/plugins/fake_function_framework/vendor/fff/test/fff_test_c.c +0 -108
  78. data/plugins/fake_function_framework/vendor/fff/test/fff_test_cpp.cpp +0 -45
  79. data/plugins/fake_function_framework/vendor/fff/test/fff_test_global_c.c +0 -76
  80. data/plugins/fake_function_framework/vendor/fff/test/fff_test_global_cpp.cpp +0 -23
  81. data/plugins/fake_function_framework/vendor/fff/test/global_fakes.c +0 -13
  82. data/plugins/fake_function_framework/vendor/fff/test/global_fakes.h +0 -37
  83. data/plugins/fake_function_framework/vendor/fff/test/test_cases.include +0 -276
  84. data/vendor/c_exception/vendor/unity/README.md +0 -220
  85. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +0 -118
  86. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +0 -39
  87. data/vendor/c_exception/vendor/unity/auto/generate_config.yml +0 -36
  88. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +0 -308
  89. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +0 -437
  90. data/vendor/c_exception/vendor/unity/auto/parse_output.rb +0 -220
  91. data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +0 -252
  92. data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +0 -25
  93. data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +0 -6
  94. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +0 -139
  95. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +0 -136
  96. data/vendor/c_exception/vendor/unity/auto/unity_to_junit.py +0 -146
  97. data/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +0 -207
  98. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  99. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +0 -716
  100. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +0 -398
  101. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +0 -191
  102. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +0 -242
  103. data/vendor/c_exception/vendor/unity/docs/license.txt +0 -21
  104. data/vendor/c_exception/vendor/unity/examples/example_1/makefile +0 -71
  105. data/vendor/c_exception/vendor/unity/examples/example_1/readme.txt +0 -5
  106. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.c +0 -24
  107. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.h +0 -3
  108. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.c +0 -11
  109. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.h +0 -2
  110. data/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode.c +0 -62
  111. data/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode2.c +0 -31
  112. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +0 -53
  113. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +0 -57
  114. data/vendor/c_exception/vendor/unity/examples/example_2/makefile +0 -70
  115. data/vendor/c_exception/vendor/unity/examples/example_2/readme.txt +0 -5
  116. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode.c +0 -24
  117. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode.h +0 -3
  118. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.c +0 -11
  119. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.h +0 -2
  120. data/vendor/c_exception/vendor/unity/examples/example_2/test/TestProductionCode.c +0 -64
  121. data/vendor/c_exception/vendor/unity/examples/example_2/test/TestProductionCode2.c +0 -33
  122. data/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +0 -9
  123. data/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +0 -11
  124. data/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/all_tests.c +0 -12
  125. data/vendor/c_exception/vendor/unity/examples/example_3/helper/UnityHelper.c +0 -10
  126. data/vendor/c_exception/vendor/unity/examples/example_3/helper/UnityHelper.h +0 -12
  127. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +0 -43
  128. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +0 -249
  129. data/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +0 -13
  130. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode.c +0 -24
  131. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode.h +0 -3
  132. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.c +0 -11
  133. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.h +0 -2
  134. data/vendor/c_exception/vendor/unity/examples/example_3/target_gcc_32.yml +0 -46
  135. data/vendor/c_exception/vendor/unity/examples/example_3/test/TestProductionCode.c +0 -62
  136. data/vendor/c_exception/vendor/unity/examples/example_3/test/TestProductionCode2.c +0 -31
  137. data/vendor/c_exception/vendor/unity/examples/unity_config.h +0 -237
  138. data/vendor/c_exception/vendor/unity/extras/eclipse/error_parsers.txt +0 -26
  139. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +0 -48
  140. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
  141. data/vendor/c_exception/vendor/unity/extras/fixture/readme.txt +0 -9
  142. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +0 -432
  143. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +0 -83
  144. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -51
  145. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -47
  146. data/vendor/c_exception/vendor/unity/extras/fixture/test/Makefile +0 -74
  147. data/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +0 -22
  148. data/vendor/c_exception/vendor/unity/extras/fixture/test/template_fixture_tests.c +0 -39
  149. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -543
  150. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -57
  151. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -57
  152. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
  153. data/vendor/c_exception/vendor/unity/release/build.info +0 -2
  154. data/vendor/c_exception/vendor/unity/release/version.info +0 -2
  155. data/vendor/c_exception/vendor/unity/src/unity.c +0 -1517
  156. data/vendor/c_exception/vendor/unity/src/unity.h +0 -339
  157. data/vendor/c_exception/vendor/unity/src/unity_internals.h +0 -784
  158. data/vendor/c_exception/vendor/unity/test/Makefile +0 -63
  159. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +0 -61
  160. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +0 -57
  161. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.c +0 -55
  162. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.h +0 -15
  163. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -80
  164. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +0 -76
  165. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.c +0 -75
  166. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.h +0 -13
  167. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -89
  168. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -89
  169. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +0 -77
  170. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -89
  171. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -89
  172. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -90
  173. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +0 -67
  174. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +0 -70
  175. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +0 -58
  176. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +0 -67
  177. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +0 -70
  178. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +0 -71
  179. data/vendor/c_exception/vendor/unity/test/rakefile +0 -125
  180. data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +0 -260
  181. data/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +0 -158
  182. data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -78
  183. data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +0 -78
  184. data/vendor/c_exception/vendor/unity/test/targets/gcc_32.yml +0 -49
  185. data/vendor/c_exception/vendor/unity/test/targets/gcc_64.yml +0 -50
  186. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_limits.yml +0 -47
  187. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_stdint.yml +0 -59
  188. data/vendor/c_exception/vendor/unity/test/targets/gcc_manual_math.yml +0 -47
  189. data/vendor/c_exception/vendor/unity/test/targets/hitech_picc18.yml +0 -101
  190. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v4.yml +0 -90
  191. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5.yml +0 -80
  192. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5_3.yml +0 -80
  193. data/vendor/c_exception/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -94
  194. data/vendor/c_exception/vendor/unity/test/targets/iar_cortexm3_v5.yml +0 -84
  195. data/vendor/c_exception/vendor/unity/test/targets/iar_msp430.yml +0 -95
  196. data/vendor/c_exception/vendor/unity/test/targets/iar_sh2a_v6.yml +0 -86
  197. data/vendor/c_exception/vendor/unity/test/testdata/CException.h +0 -11
  198. data/vendor/c_exception/vendor/unity/test/testdata/Defs.h +0 -8
  199. data/vendor/c_exception/vendor/unity/test/testdata/cmock.h +0 -14
  200. data/vendor/c_exception/vendor/unity/test/testdata/mockMock.h +0 -13
  201. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGenerator.c +0 -183
  202. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +0 -67
  203. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +0 -192
  204. data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +0 -1252
  205. data/vendor/c_exception/vendor/unity/test/tests/testparameterized.c +0 -110
  206. data/vendor/c_exception/vendor/unity/test/tests/testunity.c +0 -4993
  207. data/vendor/cmock/vendor/c_exception/Gemfile +0 -4
  208. data/vendor/cmock/vendor/c_exception/Gemfile.lock +0 -12
  209. data/vendor/cmock/vendor/c_exception/LICENSE.txt +0 -30
  210. data/vendor/cmock/vendor/c_exception/README.md +0 -162
  211. data/vendor/cmock/vendor/c_exception/Rakefile +0 -42
  212. data/vendor/cmock/vendor/c_exception/docs/CException.md +0 -292
  213. data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +0 -207
  214. data/vendor/cmock/vendor/c_exception/lib/CException.c +0 -46
  215. data/vendor/cmock/vendor/c_exception/lib/CException.h +0 -110
  216. data/vendor/cmock/vendor/c_exception/makefile +0 -24
  217. data/vendor/cmock/vendor/c_exception/release/build.info +0 -2
  218. data/vendor/cmock/vendor/c_exception/release/version.info +0 -2
  219. data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +0 -46
  220. data/vendor/cmock/vendor/c_exception/test/TestException.c +0 -391
  221. data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +0 -67
  222. data/vendor/cmock/vendor/c_exception/vendor/unity/README.md +0 -220
  223. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +0 -118
  224. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +0 -39
  225. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_config.yml +0 -36
  226. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +0 -308
  227. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +0 -437
  228. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parse_output.rb +0 -220
  229. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +0 -252
  230. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +0 -25
  231. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +0 -6
  232. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +0 -139
  233. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +0 -136
  234. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_to_junit.py +0 -146
  235. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +0 -207
  236. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  237. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +0 -716
  238. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +0 -398
  239. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +0 -191
  240. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +0 -242
  241. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/license.txt +0 -21
  242. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +0 -71
  243. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/readme.txt +0 -5
  244. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.c +0 -24
  245. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.h +0 -3
  246. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.c +0 -11
  247. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.h +0 -2
  248. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode.c +0 -62
  249. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode2.c +0 -31
  250. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +0 -53
  251. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +0 -57
  252. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/makefile +0 -70
  253. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/readme.txt +0 -5
  254. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode.c +0 -24
  255. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode.h +0 -3
  256. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.c +0 -11
  257. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.h +0 -2
  258. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/test/TestProductionCode.c +0 -64
  259. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/test/TestProductionCode2.c +0 -33
  260. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +0 -9
  261. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +0 -11
  262. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/all_tests.c +0 -12
  263. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/helper/UnityHelper.c +0 -10
  264. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/helper/UnityHelper.h +0 -12
  265. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +0 -43
  266. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +0 -249
  267. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +0 -13
  268. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode.c +0 -24
  269. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode.h +0 -3
  270. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.c +0 -11
  271. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.h +0 -2
  272. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/target_gcc_32.yml +0 -46
  273. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/test/TestProductionCode.c +0 -62
  274. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/test/TestProductionCode2.c +0 -31
  275. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/unity_config.h +0 -237
  276. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/eclipse/error_parsers.txt +0 -26
  277. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +0 -48
  278. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
  279. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/readme.txt +0 -9
  280. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +0 -432
  281. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +0 -83
  282. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -51
  283. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -47
  284. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/Makefile +0 -74
  285. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +0 -22
  286. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/template_fixture_tests.c +0 -39
  287. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -543
  288. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -57
  289. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -57
  290. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
  291. data/vendor/cmock/vendor/c_exception/vendor/unity/release/build.info +0 -2
  292. data/vendor/cmock/vendor/c_exception/vendor/unity/release/version.info +0 -2
  293. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +0 -1517
  294. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +0 -339
  295. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +0 -784
  296. data/vendor/cmock/vendor/c_exception/vendor/unity/test/Makefile +0 -63
  297. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +0 -61
  298. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +0 -57
  299. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.c +0 -55
  300. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.h +0 -15
  301. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -80
  302. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +0 -76
  303. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.c +0 -75
  304. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.h +0 -13
  305. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -89
  306. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -89
  307. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +0 -77
  308. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -89
  309. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -89
  310. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -90
  311. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +0 -67
  312. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +0 -70
  313. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +0 -58
  314. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +0 -67
  315. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +0 -70
  316. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +0 -71
  317. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile +0 -125
  318. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +0 -260
  319. data/vendor/cmock/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +0 -158
  320. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -78
  321. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +0 -78
  322. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_32.yml +0 -49
  323. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_64.yml +0 -50
  324. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_auto_limits.yml +0 -47
  325. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_auto_stdint.yml +0 -59
  326. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_manual_math.yml +0 -47
  327. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/hitech_picc18.yml +0 -101
  328. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_arm_v4.yml +0 -90
  329. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5.yml +0 -80
  330. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5_3.yml +0 -80
  331. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -94
  332. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_cortexm3_v5.yml +0 -84
  333. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_msp430.yml +0 -95
  334. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_sh2a_v6.yml +0 -86
  335. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/CException.h +0 -11
  336. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/Defs.h +0 -8
  337. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/cmock.h +0 -14
  338. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/mockMock.h +0 -13
  339. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGenerator.c +0 -183
  340. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +0 -67
  341. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +0 -192
  342. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +0 -1252
  343. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testparameterized.c +0 -110
  344. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +0 -4993
  345. data/vendor/cmock/vendor/unity/README.md +0 -220
  346. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +0 -118
  347. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +0 -39
  348. data/vendor/cmock/vendor/unity/auto/generate_config.yml +0 -36
  349. data/vendor/cmock/vendor/unity/auto/generate_module.rb +0 -308
  350. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +0 -437
  351. data/vendor/cmock/vendor/unity/auto/parse_output.rb +0 -220
  352. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +0 -252
  353. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +0 -25
  354. data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +0 -6
  355. data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +0 -139
  356. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +0 -136
  357. data/vendor/cmock/vendor/unity/auto/unity_to_junit.py +0 -146
  358. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +0 -207
  359. data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  360. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +0 -716
  361. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +0 -398
  362. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +0 -191
  363. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +0 -242
  364. data/vendor/cmock/vendor/unity/docs/license.txt +0 -21
  365. data/vendor/cmock/vendor/unity/examples/example_1/makefile +0 -71
  366. data/vendor/cmock/vendor/unity/examples/example_1/readme.txt +0 -5
  367. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +0 -24
  368. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +0 -3
  369. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +0 -11
  370. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +0 -2
  371. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +0 -62
  372. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +0 -31
  373. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +0 -53
  374. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +0 -57
  375. data/vendor/cmock/vendor/unity/examples/example_2/makefile +0 -70
  376. data/vendor/cmock/vendor/unity/examples/example_2/readme.txt +0 -5
  377. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +0 -24
  378. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +0 -3
  379. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +0 -11
  380. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +0 -2
  381. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +0 -64
  382. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +0 -33
  383. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +0 -9
  384. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +0 -11
  385. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +0 -12
  386. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +0 -10
  387. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +0 -12
  388. data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +0 -43
  389. data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +0 -249
  390. data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +0 -13
  391. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +0 -24
  392. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +0 -3
  393. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +0 -11
  394. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +0 -2
  395. data/vendor/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +0 -46
  396. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +0 -62
  397. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +0 -31
  398. data/vendor/cmock/vendor/unity/examples/unity_config.h +0 -237
  399. data/vendor/cmock/vendor/unity/extras/eclipse/error_parsers.txt +0 -26
  400. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +0 -48
  401. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +0 -178
  402. data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +0 -9
  403. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +0 -432
  404. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +0 -83
  405. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +0 -51
  406. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +0 -47
  407. data/vendor/cmock/vendor/unity/extras/fixture/test/Makefile +0 -74
  408. data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +0 -22
  409. data/vendor/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +0 -39
  410. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +0 -543
  411. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +0 -57
  412. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +0 -57
  413. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +0 -17
  414. data/vendor/cmock/vendor/unity/release/build.info +0 -2
  415. data/vendor/cmock/vendor/unity/release/version.info +0 -2
  416. data/vendor/cmock/vendor/unity/src/unity.c +0 -1517
  417. data/vendor/cmock/vendor/unity/src/unity.h +0 -339
  418. data/vendor/cmock/vendor/unity/src/unity_internals.h +0 -784
  419. data/vendor/cmock/vendor/unity/test/Makefile +0 -63
  420. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +0 -61
  421. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +0 -57
  422. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +0 -55
  423. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.h +0 -15
  424. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +0 -80
  425. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +0 -76
  426. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +0 -75
  427. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +0 -13
  428. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +0 -89
  429. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +0 -89
  430. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +0 -77
  431. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +0 -89
  432. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +0 -89
  433. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +0 -90
  434. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +0 -67
  435. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +0 -70
  436. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +0 -58
  437. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +0 -67
  438. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +0 -70
  439. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +0 -71
  440. data/vendor/cmock/vendor/unity/test/rakefile +0 -125
  441. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +0 -260
  442. data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +0 -158
  443. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -78
  444. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +0 -78
  445. data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +0 -49
  446. data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +0 -50
  447. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +0 -47
  448. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +0 -59
  449. data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +0 -47
  450. data/vendor/cmock/vendor/unity/test/targets/hitech_picc18.yml +0 -101
  451. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +0 -90
  452. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +0 -80
  453. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +0 -80
  454. data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +0 -94
  455. data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +0 -84
  456. data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +0 -95
  457. data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +0 -86
  458. data/vendor/cmock/vendor/unity/test/testdata/CException.h +0 -11
  459. data/vendor/cmock/vendor/unity/test/testdata/Defs.h +0 -8
  460. data/vendor/cmock/vendor/unity/test/testdata/cmock.h +0 -14
  461. data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +0 -13
  462. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +0 -183
  463. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +0 -67
  464. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +0 -192
  465. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +0 -1252
  466. data/vendor/cmock/vendor/unity/test/tests/testparameterized.c +0 -110
  467. data/vendor/cmock/vendor/unity/test/tests/testunity.c +0 -4993
@@ -1,308 +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
- require 'pathname'
14
-
15
- # TEMPLATE_TST
16
- TEMPLATE_TST ||= '#include "unity.h"
17
- %2$s#include "%1$s.h"
18
-
19
- void setUp(void)
20
- {
21
- }
22
-
23
- void tearDown(void)
24
- {
25
- }
26
-
27
- void test_%1$s_NeedToImplement(void)
28
- {
29
- TEST_IGNORE_MESSAGE("Need to Implement %1$s");
30
- }
31
- '.freeze
32
-
33
- # TEMPLATE_SRC
34
- TEMPLATE_SRC ||= '%2$s#include "%1$s.h"
35
- '.freeze
36
-
37
- # TEMPLATE_INC
38
- TEMPLATE_INC ||= '#ifndef _%3$s_H
39
- #define _%3$s_H
40
- %2$s
41
-
42
- #endif // _%3$s_H
43
- '.freeze
44
-
45
- class UnityModuleGenerator
46
- ############################
47
- def initialize(options = nil)
48
- here = File.expand_path(File.dirname(__FILE__)) + '/'
49
-
50
- @options = UnityModuleGenerator.default_options
51
- case options
52
- when NilClass then @options
53
- when String then @options.merge!(UnityModuleGenerator.grab_config(options))
54
- when Hash then @options.merge!(options)
55
- else raise 'If you specify arguments, it should be a filename or a hash of options'
56
- end
57
-
58
- # Create default file paths if none were provided
59
- @options[:path_src] = here + '../src/' if @options[:path_src].nil?
60
- @options[:path_inc] = @options[:path_src] if @options[:path_inc].nil?
61
- @options[:path_tst] = here + '../test/' if @options[:path_tst].nil?
62
- @options[:path_src] += '/' unless @options[:path_src][-1] == 47
63
- @options[:path_inc] += '/' unless @options[:path_inc][-1] == 47
64
- @options[:path_tst] += '/' unless @options[:path_tst][-1] == 47
65
-
66
- # Built in patterns
67
- @patterns = {
68
- 'src' => {
69
- '' => { inc: [] }
70
- },
71
- 'test' => {
72
- '' => { inc: [] }
73
- },
74
- 'dh' => {
75
- 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h')] },
76
- 'Hardware' => { inc: [] }
77
- },
78
- 'dih' => {
79
- 'Driver' => { inc: [create_filename('%1$s', 'Hardware.h'), create_filename('%1$s', 'Interrupt.h')] },
80
- 'Interrupt' => { inc: [create_filename('%1$s', 'Hardware.h')] },
81
- 'Hardware' => { inc: [] }
82
- },
83
- 'mch' => {
84
- 'Model' => { inc: [] },
85
- 'Conductor' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'Hardware.h')] },
86
- 'Hardware' => { inc: [] }
87
- },
88
- 'mvp' => {
89
- 'Model' => { inc: [] },
90
- 'Presenter' => { inc: [create_filename('%1$s', 'Model.h'), create_filename('%1$s', 'View.h')] },
91
- 'View' => { inc: [] }
92
- }
93
- }
94
- end
95
-
96
- ############################
97
- def self.default_options
98
- {
99
- pattern: 'src',
100
- includes: {
101
- src: [],
102
- inc: [],
103
- tst: []
104
- },
105
- update_svn: false,
106
- boilerplates: {},
107
- test_prefix: 'Test',
108
- mock_prefix: 'Mock'
109
- }
110
- end
111
-
112
- ############################
113
- def self.grab_config(config_file)
114
- options = default_options
115
- unless config_file.nil? || config_file.empty?
116
- require 'yaml'
117
- yaml_guts = YAML.load_file(config_file)
118
- options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
119
- raise "No :unity or :cmock section found in #{config_file}" unless options
120
- end
121
- options
122
- end
123
-
124
- ############################
125
- def files_to_operate_on(module_name, pattern = nil)
126
- # strip any leading path information from the module name and save for later
127
- subfolder = File.dirname(module_name)
128
- module_name = File.basename(module_name)
129
-
130
- # create triad definition
131
- prefix = @options[:test_prefix] || 'Test'
132
- triad = [{ ext: '.c', path: @options[:path_src], prefix: '', template: TEMPLATE_SRC, inc: :src, boilerplate: @options[:boilerplates][:src] },
133
- { ext: '.h', path: @options[:path_inc], prefix: '', template: TEMPLATE_INC, inc: :inc, boilerplate: @options[:boilerplates][:inc] },
134
- { ext: '.c', path: @options[:path_tst], prefix: prefix, template: TEMPLATE_TST, inc: :tst, boilerplate: @options[:boilerplates][:tst] }]
135
-
136
- # prepare the pattern for use
137
- pattern = (pattern || @options[:pattern] || 'src').downcase
138
- patterns = @patterns[pattern]
139
- raise "ERROR: The design pattern '#{pattern}' specified isn't one that I recognize!" if patterns.nil?
140
-
141
- # single file patterns (currently just 'test') can reject the other parts of the triad
142
- triad.select! { |v| v[:inc] == :tst } if pattern == 'test'
143
-
144
- # Assemble the path/names of the files we need to work with.
145
- files = []
146
- triad.each do |cfg|
147
- patterns.each_pair do |pattern_file, pattern_traits|
148
- submodule_name = create_filename(module_name, pattern_file)
149
- filename = cfg[:prefix] + submodule_name + cfg[:ext]
150
- files << {
151
- path: (Pathname.new("#{cfg[:path]}#{subfolder}") + filename).cleanpath,
152
- name: submodule_name,
153
- template: cfg[:template],
154
- boilerplate: cfg[:boilerplate],
155
- includes: case (cfg[:inc])
156
- when :src then (@options[:includes][:src] || []) | (pattern_traits[:inc].map { |f| format(f, module_name) })
157
- when :inc then (@options[:includes][:inc] || [])
158
- when :tst then (@options[:includes][:tst] || []) | (pattern_traits[:inc].map { |f| format("#{@options[:mock_prefix]}#{f}", module_name) })
159
- end
160
- }
161
- end
162
- end
163
-
164
- files
165
- end
166
-
167
- ############################
168
- def create_filename(part1, part2 = '')
169
- if part2.empty?
170
- case (@options[:naming])
171
- when 'bumpy' then part1
172
- when 'camel' then part1
173
- when 'snake' then part1.downcase
174
- when 'caps' then part1.upcase
175
- else part1.downcase
176
- end
177
- else
178
- case (@options[:naming])
179
- when 'bumpy' then part1 + part2
180
- when 'camel' then part1 + part2
181
- when 'snake' then part1.downcase + '_' + part2.downcase
182
- when 'caps' then part1.upcase + '_' + part2.upcase
183
- else part1.downcase + '_' + part2.downcase
184
- end
185
- end
186
- end
187
-
188
- ############################
189
- def generate(module_name, pattern = nil)
190
- files = files_to_operate_on(module_name, pattern)
191
-
192
- # Abort if all of the module files already exist
193
- all_files_exist = true
194
- files.each do |file|
195
- all_files_exist = false unless File.exist?(file[:path])
196
- end
197
- raise "ERROR: File #{files[0][:name]} already exists. Exiting." if all_files_exist
198
-
199
- # Create Source Modules
200
- files.each_with_index do |file, _i|
201
- # If this file already exists, don't overwrite it.
202
- if File.exist?(file[:path])
203
- puts "File #{file[:path]} already exists!"
204
- next
205
- end
206
- # Create the path first if necessary.
207
- FileUtils.mkdir_p(File.dirname(file[:path]), verbose: false)
208
- File.open(file[:path], 'w') do |f|
209
- f.write("#{file[:boilerplate]}\n" % [file[:name]]) unless file[:boilerplate].nil?
210
- f.write(file[:template] % [file[:name],
211
- file[:includes].map { |ff| "#include \"#{ff}\"\n" }.join,
212
- file[:name].upcase])
213
- end
214
- if @options[:update_svn]
215
- `svn add \"#{file[:path]}\"`
216
- if $!.exitstatus.zero?
217
- puts "File #{file[:path]} created and added to source control"
218
- else
219
- puts "File #{file[:path]} created but FAILED adding to source control!"
220
- end
221
- else
222
- puts "File #{file[:path]} created"
223
- end
224
- end
225
- puts 'Generate Complete'
226
- end
227
-
228
- ############################
229
- def destroy(module_name, pattern = nil)
230
- files_to_operate_on(module_name, pattern).each do |filespec|
231
- file = filespec[:path]
232
- if File.exist?(file)
233
- if @options[:update_svn]
234
- `svn delete \"#{file}\" --force`
235
- puts "File #{file} deleted and removed from source control"
236
- else
237
- FileUtils.remove(file)
238
- puts "File #{file} deleted"
239
- end
240
- else
241
- puts "File #{file} does not exist so cannot be removed."
242
- end
243
- end
244
- puts 'Destroy Complete'
245
- end
246
- end
247
-
248
- ############################
249
- # Handle As Command Line If Called That Way
250
- if $0 == __FILE__
251
- destroy = false
252
- options = {}
253
- module_name = nil
254
-
255
- # Parse the command line parameters.
256
- ARGV.each do |arg|
257
- case arg
258
- when /^-d/ then destroy = true
259
- when /^-u/ then options[:update_svn] = true
260
- when /^-p\"?(\w+)\"?/ then options[:pattern] = Regexp.last_match(1)
261
- when /^-s\"?(.+)\"?/ then options[:path_src] = Regexp.last_match(1)
262
- when /^-i\"?(.+)\"?/ then options[:path_inc] = Regexp.last_match(1)
263
- when /^-t\"?(.+)\"?/ then options[:path_tst] = Regexp.last_match(1)
264
- when /^-n\"?(.+)\"?/ then options[:naming] = Regexp.last_match(1)
265
- when /^-y\"?(.+)\"?/ then options = UnityModuleGenerator.grab_config(Regexp.last_match(1))
266
- when /^(\w+)/
267
- raise "ERROR: You can't have more than one Module name specified!" unless module_name.nil?
268
- module_name = arg
269
- when /^-(h|-help)/
270
- ARGV = [].freeze
271
- else
272
- raise "ERROR: Unknown option specified '#{arg}'"
273
- end
274
- end
275
-
276
- unless ARGV[0]
277
- puts ["\nGENERATE MODULE\n-------- ------",
278
- "\nUsage: ruby generate_module [options] module_name",
279
- " -i\"include\" sets the path to output headers to 'include' (DEFAULT ../src)",
280
- " -s\"../src\" sets the path to output source to '../src' (DEFAULT ../src)",
281
- " -t\"C:/test\" sets the path to output source to 'C:/test' (DEFAULT ../test)",
282
- ' -p"MCH" sets the output pattern to MCH.',
283
- ' dh - driver hardware.',
284
- ' dih - driver interrupt hardware.',
285
- ' mch - model conductor hardware.',
286
- ' mvp - model view presenter.',
287
- ' src - just a source module, header and test. (DEFAULT)',
288
- ' test - just a test file.',
289
- ' -d destroy module instead of creating it.',
290
- ' -n"camel" sets the file naming convention.',
291
- ' bumpy - BumpyCaseFilenames.',
292
- ' camel - camelCaseFilenames.',
293
- ' snake - snake_case_filenames. (DEFAULT)',
294
- ' caps - CAPS_CASE_FILENAMES.',
295
- ' -u update subversion too (requires subversion command line)',
296
- ' -y"my.yml" selects a different yaml config file for module generation',
297
- ''].join("\n")
298
- exit
299
- end
300
-
301
- raise 'ERROR: You must have a Module name specified! (use option -h for help)' if module_name.nil?
302
- if destroy
303
- UnityModuleGenerator.new(options).destroy(module_name)
304
- else
305
- UnityModuleGenerator.new(options).generate(module_name)
306
- end
307
-
308
- end
@@ -1,437 +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
- def initialize(options = nil)
11
- @options = UnityTestRunnerGenerator.default_options
12
- case options
13
- when NilClass then @options
14
- when String then @options.merge!(UnityTestRunnerGenerator.grab_config(options))
15
- when Hash then @options.merge!(options)
16
- else raise 'If you specify arguments, it should be a filename or a hash of options'
17
- end
18
- require "#{File.expand_path(File.dirname(__FILE__))}/type_sanitizer"
19
- end
20
-
21
- def self.default_options
22
- {
23
- includes: [],
24
- defines: [],
25
- plugins: [],
26
- framework: :unity,
27
- test_prefix: 'test|spec|should',
28
- mock_prefix: 'Mock',
29
- setup_name: 'setUp',
30
- teardown_name: 'tearDown',
31
- main_name: 'main', # set to :auto to automatically generate each time
32
- main_export_decl: '',
33
- cmdline_args: false,
34
- use_param_tests: false
35
- }
36
- end
37
-
38
- def self.grab_config(config_file)
39
- options = default_options
40
- unless config_file.nil? || config_file.empty?
41
- require 'yaml'
42
- yaml_guts = YAML.load_file(config_file)
43
- options.merge!(yaml_guts[:unity] || yaml_guts[:cmock])
44
- raise "No :unity or :cmock section found in #{config_file}" unless options
45
- end
46
- options
47
- end
48
-
49
- def run(input_file, output_file, options = nil)
50
- @options.merge!(options) unless options.nil?
51
-
52
- # pull required data from source file
53
- source = File.read(input_file)
54
- source = source.force_encoding('ISO-8859-1').encode('utf-8', replace: nil)
55
- tests = find_tests(source)
56
- headers = find_includes(source)
57
- testfile_includes = (headers[:local] + headers[:system])
58
- used_mocks = find_mocks(testfile_includes)
59
- testfile_includes = (testfile_includes - used_mocks)
60
- testfile_includes.delete_if { |inc| inc =~ /(unity|cmock)/ }
61
-
62
- # build runner file
63
- generate(input_file, output_file, tests, used_mocks, testfile_includes)
64
-
65
- # determine which files were used to return them
66
- all_files_used = [input_file, output_file]
67
- all_files_used += testfile_includes.map { |filename| filename + '.c' } unless testfile_includes.empty?
68
- all_files_used += @options[:includes] unless @options[:includes].empty?
69
- all_files_used += headers[:linkonly] unless headers[:linkonly].empty?
70
- all_files_used.uniq
71
- end
72
-
73
- def generate(input_file, output_file, tests, used_mocks, testfile_includes)
74
- File.open(output_file, 'w') do |output|
75
- create_header(output, used_mocks, testfile_includes)
76
- create_externs(output, tests, used_mocks)
77
- create_mock_management(output, used_mocks)
78
- create_suite_setup(output)
79
- create_suite_teardown(output)
80
- create_reset(output, used_mocks)
81
- create_main(output, input_file, tests, used_mocks)
82
- end
83
-
84
- return unless @options[:header_file] && !@options[:header_file].empty?
85
-
86
- File.open(@options[:header_file], 'w') do |output|
87
- create_h_file(output, @options[:header_file], tests, testfile_includes, used_mocks)
88
- end
89
- end
90
-
91
- def find_tests(source)
92
- tests_and_line_numbers = []
93
-
94
- source_scrubbed = source.clone
95
- source_scrubbed = source_scrubbed.gsub(/"[^"\n]*"/, '') # remove things in strings
96
- source_scrubbed = source_scrubbed.gsub(/\/\/.*$/, '') # remove line comments
97
- source_scrubbed = source_scrubbed.gsub(/\/\*.*?\*\//m, '') # remove block comments
98
- lines = source_scrubbed.split(/(^\s*\#.*$) # Treat preprocessor directives as a logical line
99
- | (;|\{|\}) /x) # Match ;, {, and } as end of lines
100
-
101
- lines.each_with_index do |line, _index|
102
- # find tests
103
- next unless line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+((?:#{@options[:test_prefix]}).*)\s*\(\s*(.*)\s*\)/
104
- arguments = Regexp.last_match(1)
105
- name = Regexp.last_match(2)
106
- call = Regexp.last_match(3)
107
- params = Regexp.last_match(4)
108
- args = nil
109
- if @options[:use_param_tests] && !arguments.empty?
110
- args = []
111
- arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) { |a| args << a[0] }
112
- end
113
- tests_and_line_numbers << { test: name, args: args, call: call, params: params, line_number: 0 }
114
- end
115
- tests_and_line_numbers.uniq! { |v| v[:test] }
116
-
117
- # determine line numbers and create tests to run
118
- source_lines = source.split("\n")
119
- source_index = 0
120
- tests_and_line_numbers.size.times do |i|
121
- source_lines[source_index..-1].each_with_index do |line, index|
122
- next unless line =~ /#{tests_and_line_numbers[i][:test]}/
123
- source_index += index
124
- tests_and_line_numbers[i][:line_number] = source_index + 1
125
- break
126
- end
127
- end
128
-
129
- tests_and_line_numbers
130
- end
131
-
132
- def find_includes(source)
133
- # remove comments (block and line, in three steps to ensure correct precedence)
134
- source.gsub!(/\/\/(?:.+\/\*|\*(?:$|[^\/])).*$/, '') # remove line comments that comment out the start of blocks
135
- source.gsub!(/\/\*.*?\*\//m, '') # remove block comments
136
- source.gsub!(/\/\/.*$/, '') # remove line comments (all that remain)
137
-
138
- # parse out includes
139
- includes = {
140
- local: source.scan(/^\s*#include\s+\"\s*(.+)\.[hH]\s*\"/).flatten,
141
- system: source.scan(/^\s*#include\s+<\s*(.+)\s*>/).flatten.map { |inc| "<#{inc}>" },
142
- linkonly: source.scan(/^TEST_FILE\(\s*\"\s*(.+)\.[cC]\w*\s*\"/).flatten
143
- }
144
- includes
145
- end
146
-
147
- def find_mocks(includes)
148
- mock_headers = []
149
- includes.each do |include_path|
150
- include_file = File.basename(include_path)
151
- mock_headers << include_path if include_file =~ /^#{@options[:mock_prefix]}/i
152
- end
153
- mock_headers
154
- end
155
-
156
- def create_header(output, mocks, testfile_includes = [])
157
- output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
158
- create_runtest(output, mocks)
159
- output.puts("\n/*=======Automagically Detected Files To Include=====*/")
160
- output.puts("#include \"#{@options[:framework]}.h\"")
161
- output.puts('#include "cmock.h"') unless mocks.empty?
162
- output.puts('#include <setjmp.h>')
163
- output.puts('#include <stdio.h>')
164
- if @options[:defines] && !@options[:defines].empty?
165
- @options[:defines].each { |d| output.puts("#define #{d}") }
166
- end
167
- if @options[:header_file] && !@options[:header_file].empty?
168
- output.puts("#include \"#{File.basename(@options[:header_file])}\"")
169
- else
170
- @options[:includes].flatten.uniq.compact.each do |inc|
171
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
172
- end
173
- testfile_includes.each do |inc|
174
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
175
- end
176
- end
177
- mocks.each do |mock|
178
- output.puts("#include \"#{mock.gsub('.h', '')}.h\"")
179
- end
180
- output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
181
-
182
- return unless @options[:enforce_strict_ordering]
183
-
184
- output.puts('')
185
- output.puts('int GlobalExpectCount;')
186
- output.puts('int GlobalVerifyOrder;')
187
- output.puts('char* GlobalOrderError;')
188
- end
189
-
190
- def create_externs(output, tests, _mocks)
191
- output.puts("\n/*=======External Functions This Runner Calls=====*/")
192
- output.puts("extern void #{@options[:setup_name]}(void);")
193
- output.puts("extern void #{@options[:teardown_name]}(void);")
194
- tests.each do |test|
195
- output.puts("extern void #{test[:test]}(#{test[:call] || 'void'});")
196
- end
197
- output.puts('')
198
- end
199
-
200
- def create_mock_management(output, mock_headers)
201
- return if mock_headers.empty?
202
-
203
- output.puts("\n/*=======Mock Management=====*/")
204
- output.puts('static void CMock_Init(void)')
205
- output.puts('{')
206
-
207
- if @options[:enforce_strict_ordering]
208
- output.puts(' GlobalExpectCount = 0;')
209
- output.puts(' GlobalVerifyOrder = 0;')
210
- output.puts(' GlobalOrderError = NULL;')
211
- end
212
-
213
- mocks = mock_headers.map { |mock| File.basename(mock) }
214
- mocks.each do |mock|
215
- mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
216
- output.puts(" #{mock_clean}_Init();")
217
- end
218
- output.puts("}\n")
219
-
220
- output.puts('static void CMock_Verify(void)')
221
- output.puts('{')
222
- mocks.each do |mock|
223
- mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
224
- output.puts(" #{mock_clean}_Verify();")
225
- end
226
- output.puts("}\n")
227
-
228
- output.puts('static void CMock_Destroy(void)')
229
- output.puts('{')
230
- mocks.each do |mock|
231
- mock_clean = TypeSanitizer.sanitize_c_identifier(mock)
232
- output.puts(" #{mock_clean}_Destroy();")
233
- end
234
- output.puts("}\n")
235
- end
236
-
237
- def create_suite_setup(output)
238
- return if @options[:suite_setup].nil?
239
-
240
- output.puts("\n/*=======Suite Setup=====*/")
241
- output.puts('static void suite_setup(void)')
242
- output.puts('{')
243
- output.puts(@options[:suite_setup])
244
- output.puts('}')
245
- end
246
-
247
- def create_suite_teardown(output)
248
- return if @options[:suite_teardown].nil?
249
-
250
- output.puts("\n/*=======Suite Teardown=====*/")
251
- output.puts('static int suite_teardown(int num_failures)')
252
- output.puts('{')
253
- output.puts(@options[:suite_teardown])
254
- output.puts('}')
255
- end
256
-
257
- def create_runtest(output, used_mocks)
258
- cexception = @options[:plugins].include? :cexception
259
- va_args1 = @options[:use_param_tests] ? ', ...' : ''
260
- va_args2 = @options[:use_param_tests] ? '__VA_ARGS__' : ''
261
- output.puts("\n/*=======Test Runner Used To Run Each Test Below=====*/")
262
- output.puts('#define RUN_TEST_NO_ARGS') if @options[:use_param_tests]
263
- output.puts("#define RUN_TEST(TestFunc, TestLineNum#{va_args1}) \\")
264
- output.puts('{ \\')
265
- output.puts(" Unity.CurrentTestName = #TestFunc#{va_args2.empty? ? '' : " \"(\" ##{va_args2} \")\""}; \\")
266
- output.puts(' Unity.CurrentTestLineNumber = TestLineNum; \\')
267
- output.puts(' if (UnityTestMatches()) { \\') if @options[:cmdline_args]
268
- output.puts(' Unity.NumberOfTests++; \\')
269
- output.puts(' CMock_Init(); \\') unless used_mocks.empty?
270
- output.puts(' UNITY_CLR_DETAILS(); \\') unless used_mocks.empty?
271
- output.puts(' if (TEST_PROTECT()) \\')
272
- output.puts(' { \\')
273
- output.puts(' CEXCEPTION_T e; \\') if cexception
274
- output.puts(' Try { \\') if cexception
275
- output.puts(" #{@options[:setup_name]}(); \\")
276
- output.puts(" TestFunc(#{va_args2}); \\")
277
- output.puts(' } Catch(e) { TEST_ASSERT_EQUAL_HEX32_MESSAGE(CEXCEPTION_NONE, e, "Unhandled Exception!"); } \\') if cexception
278
- output.puts(' } \\')
279
- output.puts(' if (TEST_PROTECT()) \\')
280
- output.puts(' { \\')
281
- output.puts(" #{@options[:teardown_name]}(); \\")
282
- output.puts(' CMock_Verify(); \\') unless used_mocks.empty?
283
- output.puts(' } \\')
284
- output.puts(' CMock_Destroy(); \\') unless used_mocks.empty?
285
- output.puts(' UnityConcludeTest(); \\')
286
- output.puts(' } \\') if @options[:cmdline_args]
287
- output.puts("}\n")
288
- end
289
-
290
- def create_reset(output, used_mocks)
291
- output.puts("\n/*=======Test Reset Option=====*/")
292
- output.puts('void resetTest(void);')
293
- output.puts('void resetTest(void)')
294
- output.puts('{')
295
- output.puts(' CMock_Verify();') unless used_mocks.empty?
296
- output.puts(' CMock_Destroy();') unless used_mocks.empty?
297
- output.puts(" #{@options[:teardown_name]}();")
298
- output.puts(' CMock_Init();') unless used_mocks.empty?
299
- output.puts(" #{@options[:setup_name]}();")
300
- output.puts('}')
301
- end
302
-
303
- def create_main(output, filename, tests, used_mocks)
304
- output.puts("\n\n/*=======MAIN=====*/")
305
- main_name = @options[:main_name].to_sym == :auto ? "main_#{filename.gsub('.c', '')}" : (@options[:main_name]).to_s
306
- if @options[:cmdline_args]
307
- if main_name != 'main'
308
- output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv);")
309
- end
310
- output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)")
311
- output.puts('{')
312
- output.puts(' int parse_status = UnityParseOptions(argc, argv);')
313
- output.puts(' if (parse_status != 0)')
314
- output.puts(' {')
315
- output.puts(' if (parse_status < 0)')
316
- output.puts(' {')
317
- output.puts(" UnityPrint(\"#{filename.gsub('.c', '')}.\");")
318
- output.puts(' UNITY_PRINT_EOL();')
319
- if @options[:use_param_tests]
320
- tests.each do |test|
321
- if test[:args].nil? || test[:args].empty?
322
- output.puts(" UnityPrint(\" #{test[:test]}(RUN_TEST_NO_ARGS)\");")
323
- output.puts(' UNITY_PRINT_EOL();')
324
- else
325
- test[:args].each do |args|
326
- output.puts(" UnityPrint(\" #{test[:test]}(#{args})\");")
327
- output.puts(' UNITY_PRINT_EOL();')
328
- end
329
- end
330
- end
331
- else
332
- tests.each { |test| output.puts(" UnityPrint(\" #{test[:test]}\");\n UNITY_PRINT_EOL();") }
333
- end
334
- output.puts(' return 0;')
335
- output.puts(' }')
336
- output.puts(' return parse_status;')
337
- output.puts(' }')
338
- else
339
- if main_name != 'main'
340
- output.puts("#{@options[:main_export_decl]} int #{main_name}(void);")
341
- end
342
- output.puts("int #{main_name}(void)")
343
- output.puts('{')
344
- end
345
- output.puts(' suite_setup();') unless @options[:suite_setup].nil?
346
- output.puts(" UnityBegin(\"#{filename.gsub(/\\/, '\\\\\\')}\");")
347
- if @options[:use_param_tests]
348
- tests.each do |test|
349
- if test[:args].nil? || test[:args].empty?
350
- output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, RUN_TEST_NO_ARGS);")
351
- else
352
- test[:args].each { |args| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]}, #{args});") }
353
- end
354
- end
355
- else
356
- tests.each { |test| output.puts(" RUN_TEST(#{test[:test]}, #{test[:line_number]});") }
357
- end
358
- output.puts
359
- output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty?
360
- output.puts(" return #{@options[:suite_teardown].nil? ? '' : 'suite_teardown'}(UnityEnd());")
361
- output.puts('}')
362
- end
363
-
364
- def create_h_file(output, filename, tests, testfile_includes, used_mocks)
365
- filename = File.basename(filename).gsub(/[-\/\\\.\,\s]/, '_').upcase
366
- output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
367
- output.puts("#ifndef _#{filename}")
368
- output.puts("#define _#{filename}\n\n")
369
- output.puts("#include \"#{@options[:framework]}.h\"")
370
- output.puts('#include "cmock.h"') unless used_mocks.empty?
371
- @options[:includes].flatten.uniq.compact.each do |inc|
372
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
373
- end
374
- testfile_includes.each do |inc|
375
- output.puts("#include #{inc.include?('<') ? inc : "\"#{inc.gsub('.h', '')}.h\""}")
376
- end
377
- output.puts "\n"
378
- tests.each do |test|
379
- if test[:params].nil? || test[:params].empty?
380
- output.puts("void #{test[:test]}(void);")
381
- else
382
- output.puts("void #{test[:test]}(#{test[:params]});")
383
- end
384
- end
385
- output.puts("#endif\n\n")
386
- end
387
- end
388
-
389
- if $0 == __FILE__
390
- options = { includes: [] }
391
-
392
- # parse out all the options first (these will all be removed as we go)
393
- ARGV.reject! do |arg|
394
- case arg
395
- when '-cexception'
396
- options[:plugins] = [:cexception]
397
- true
398
- when /\.*\.ya?ml/
399
- options = UnityTestRunnerGenerator.grab_config(arg)
400
- true
401
- when /--(\w+)=\"?(.*)\"?/
402
- options[Regexp.last_match(1).to_sym] = Regexp.last_match(2)
403
- true
404
- when /\.*\.h/
405
- options[:includes] << arg
406
- true
407
- else false
408
- end
409
- end
410
-
411
- # make sure there is at least one parameter left (the input file)
412
- unless ARGV[0]
413
- puts ["\nusage: ruby #{__FILE__} (files) (options) input_test_file (output)",
414
- "\n input_test_file - this is the C file you want to create a runner for",
415
- ' output - this is the name of the runner file to generate',
416
- ' defaults to (input_test_file)_Runner',
417
- ' files:',
418
- ' *.yml / *.yaml - loads configuration from here in :unity or :cmock',
419
- ' *.h - header files are added as #includes in runner',
420
- ' options:',
421
- ' -cexception - include cexception support',
422
- ' --setup_name="" - redefine setUp func name to something else',
423
- ' --teardown_name="" - redefine tearDown func name to something else',
424
- ' --main_name="" - redefine main func name to something else',
425
- ' --test_prefix="" - redefine test prefix from default test|spec|should',
426
- ' --suite_setup="" - code to execute for setup of entire suite',
427
- ' --suite_teardown="" - code to execute for teardown of entire suite',
428
- ' --use_param_tests=1 - enable parameterized tests (disabled by default)',
429
- ' --header_file="" - path/name of test header file to generate too'].join("\n")
430
- exit 1
431
- end
432
-
433
- # create the default test runner name if not specified
434
- ARGV[1] = ARGV[0].gsub('.c', '_Runner.c') unless ARGV[1]
435
-
436
- UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1])
437
- end