ceedling 0.25.0 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (434) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/project_as_gem.yml +13 -0
  4. data/assets/project_with_guts.yml +13 -0
  5. data/bin/ceedling +91 -67
  6. data/docs/CeedlingPacket.md +61 -23
  7. data/docs/CeedlingPacket.odt +0 -0
  8. data/docs/CeedlingPacket.pdf +0 -0
  9. data/docs/ThrowTheSwitchCodingStandard.md +207 -0
  10. data/examples/temp_sensor/test/TestTemperatureCalculator.c +4 -1
  11. data/lib/ceedling/configurator.rb +14 -1
  12. data/lib/ceedling/configurator_builder.rb +2 -1
  13. data/lib/ceedling/configurator_validator.rb +12 -3
  14. data/lib/ceedling/constants.rb +3 -1
  15. data/lib/ceedling/defaults.rb +12 -1
  16. data/lib/ceedling/file_finder.rb +3 -0
  17. data/lib/ceedling/file_path_utils.rb +1 -1
  18. data/lib/ceedling/file_wrapper.rb +4 -4
  19. data/lib/ceedling/generator.rb +12 -3
  20. data/lib/ceedling/preprocessinator_helper.rb +5 -5
  21. data/lib/ceedling/preprocessinator_includes_handler.rb +10 -1
  22. data/lib/ceedling/project_config_manager.rb +1 -2
  23. data/lib/ceedling/project_file_loader.rb +27 -9
  24. data/lib/ceedling/rakefile.rb +6 -6
  25. data/lib/ceedling/release_invoker.rb +21 -6
  26. data/lib/ceedling/rules_release.rake +9 -5
  27. data/lib/ceedling/rules_tests.rake +6 -1
  28. data/lib/ceedling/setupinator.rb +1 -0
  29. data/lib/ceedling/tasks_base.rake +3 -0
  30. data/lib/ceedling/tasks_filesystem.rake +10 -7
  31. data/lib/ceedling/tasks_release.rake +3 -1
  32. data/lib/ceedling/test_includes_extractor.rb +16 -12
  33. data/lib/ceedling/test_invoker.rb +40 -0
  34. data/lib/ceedling/version.rb +3 -3
  35. data/lib/ceedling/version.rb.erb +1 -1
  36. data/plugins/command_hooks/lib/command_hooks.rb +1 -1
  37. data/plugins/fake_function_framework/examples/fff_example/src/bar.h +1 -0
  38. data/plugins/fake_function_framework/examples/fff_example/src/event_processor.c +1 -0
  39. data/plugins/fake_function_framework/lib/fff_mock_generator.rb +4 -0
  40. data/plugins/fake_function_framework/spec/{fff_mock_generator_spec.rb → fff_mock_header_generator_spec.rb} +34 -194
  41. data/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb +149 -0
  42. data/plugins/fake_function_framework/spec/header_generator.rb +51 -0
  43. data/plugins/junit_tests_report/lib/junit_tests_report.rb +115 -0
  44. data/plugins/subprojects/README.md +63 -0
  45. data/plugins/subprojects/config/defaults.yml +33 -0
  46. data/plugins/subprojects/lib/subprojects.rb +92 -0
  47. data/plugins/subprojects/subprojects.rake +78 -0
  48. data/spec/preprocessinator_includes_handler_spec.rb +15 -5
  49. data/spec/spec_helper.rb +2 -2
  50. data/spec/spec_system_helper.rb +49 -1
  51. data/spec/system/deployment_spec.rb +29 -0
  52. data/vendor/c_exception/README.md +8 -2
  53. data/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
  54. data/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  55. data/vendor/c_exception/vendor/unity/README.md +19 -10
  56. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
  57. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
  58. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
  59. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
  60. data/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
  61. data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
  62. data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
  63. data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
  64. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
  65. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
  66. data/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  67. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  68. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  69. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  70. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  71. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  72. data/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
  73. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  74. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  75. data/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
  76. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
  77. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  78. data/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
  79. data/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
  80. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
  81. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  82. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  83. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  84. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  85. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  86. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  87. data/vendor/c_exception/vendor/unity/src/unity.c +396 -330
  88. data/vendor/c_exception/vendor/unity/src/unity.h +50 -4
  89. data/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
  90. data/vendor/c_exception/vendor/unity/test/Makefile +17 -17
  91. data/vendor/c_exception/vendor/unity/test/rakefile +63 -3
  92. data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
  93. data/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  94. data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
  95. data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
  96. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  97. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  98. data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  99. data/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
  100. data/vendor/cmock/README.md +10 -1
  101. data/vendor/cmock/config/test_environment.rb +7 -7
  102. data/vendor/cmock/docs/CMock_Summary.md +325 -128
  103. data/vendor/cmock/docs/ThrowTheSwitchCodingStandard.md +207 -0
  104. data/vendor/cmock/examples/make_example/Makefile +2 -2
  105. data/vendor/cmock/examples/temp_sensor/gcc.yml +5 -4
  106. data/vendor/cmock/examples/temp_sensor/iar_v4.yml +5 -4
  107. data/vendor/cmock/examples/temp_sensor/iar_v5.yml +5 -4
  108. data/vendor/cmock/examples/temp_sensor/rakefile.rb +11 -1
  109. data/vendor/cmock/examples/temp_sensor/rakefile_helper.rb +12 -10
  110. data/vendor/cmock/lib/cmock.rb +0 -3
  111. data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +6 -2
  112. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -1
  113. data/vendor/cmock/lib/cmock_header_parser.rb +5 -6
  114. data/vendor/cmock/release/version.info +1 -1
  115. data/vendor/cmock/scripts/create_makefile.rb +4 -2
  116. data/vendor/cmock/scripts/test_summary.rb +17 -9
  117. data/vendor/cmock/src/cmock.c +1 -0
  118. data/vendor/cmock/src/cmock.h +1 -1
  119. data/vendor/cmock/src/cmock_internals.h +14 -1
  120. data/vendor/cmock/test/c/TestCMockC.yml +4 -4
  121. data/vendor/cmock/test/c/TestCMockCDynamic.yml +4 -4
  122. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_FLASH.mac +0 -0
  123. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_RAM.mac +0 -0
  124. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_SIM.mac +0 -0
  125. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_FLASH.xcl +0 -0
  126. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_RAM.xcl +0 -0
  127. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/ioat91sam7x256.ddf +0 -0
  128. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.dep +0 -0
  129. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewd +0 -0
  130. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewp +0 -0
  131. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.eww +0 -0
  132. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X-EK.h +0 -0
  133. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.inc +0 -0
  134. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.rdf +0 -0
  135. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.tcl +0 -0
  136. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256_inc.h +0 -0
  137. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/ioat91sam7x256.h +0 -0
  138. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/lib_AT91SAM7X256.h +0 -0
  139. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.cspy.bat +0 -0
  140. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dbgdt +0 -0
  141. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dni +0 -0
  142. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.wsdt +0 -0
  143. data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup.s79 +0 -0
  144. data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup_SAM7.c +0 -0
  145. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_FLASH.mac +0 -0
  146. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_RAM.mac +0 -0
  147. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_SIM.mac +0 -0
  148. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_FLASH.icf +0 -0
  149. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_RAM.icf +0 -0
  150. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.dep +0 -0
  151. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewd +0 -0
  152. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewp +0 -0
  153. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.eww +0 -0
  154. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X-EK.h +0 -0
  155. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X256_inc.h +0 -0
  156. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/lib_AT91SAM7X256.h +0 -0
  157. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/project.h +0 -0
  158. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +0 -0
  159. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt +0 -0
  160. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dni +0 -0
  161. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.wsdt +0 -0
  162. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +0 -0
  163. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.cspy.bat +0 -0
  164. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dbgdt +0 -0
  165. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dni +0 -0
  166. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.wsdt +0 -0
  167. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_Binary.jlink +0 -0
  168. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +0 -0
  169. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_RAM_Debug.jlink +0 -0
  170. data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup.s +0 -0
  171. data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup_SAM7.c +0 -0
  172. data/vendor/cmock/{Rakefile → test/rakefile} +9 -9
  173. data/vendor/cmock/{rakefile_helper.rb → test/rakefile_helper.rb} +13 -13
  174. data/vendor/cmock/test/system/test_compilation/config.yml +4 -4
  175. data/vendor/cmock/test/system/test_interactions/parsing_challenges.yml +2 -0
  176. data/vendor/cmock/{targets → test/targets}/clang_strict.yml +11 -11
  177. data/vendor/cmock/{targets → test/targets}/gcc.yml +9 -9
  178. data/vendor/cmock/{targets → test/targets}/gcc_64.yml +9 -9
  179. data/vendor/cmock/{targets → test/targets}/gcc_tiny.yml +9 -9
  180. data/vendor/cmock/{targets → test/targets}/iar_arm_v4.yml +9 -9
  181. data/vendor/cmock/{targets → test/targets}/iar_arm_v5.yml +10 -10
  182. data/vendor/cmock/test/test_helper.rb +4 -8
  183. data/vendor/cmock/test/unit/cmock_config_test.rb +1 -1
  184. data/vendor/cmock/test/unit/cmock_file_writer_test.rb +1 -1
  185. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +1 -1
  186. data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +1 -1
  187. data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +3 -1
  188. data/vendor/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +1 -1
  189. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +1 -1
  190. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +1 -1
  191. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +1 -1
  192. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +1 -1
  193. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +1 -1
  194. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +1 -1
  195. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +1 -1
  196. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +15 -2
  197. data/vendor/cmock/test/unit/cmock_plugin_manager_test.rb +6 -10
  198. data/vendor/cmock/test/unit/cmock_unityhelper_parser_test.rb +1 -1
  199. data/vendor/cmock/vendor/c_exception/README.md +8 -2
  200. data/vendor/cmock/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
  201. data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  202. data/vendor/cmock/vendor/c_exception/vendor/unity/README.md +19 -10
  203. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
  204. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
  205. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
  206. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
  207. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
  208. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
  209. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
  210. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
  211. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
  212. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
  213. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  214. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  215. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  216. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  217. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  218. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  219. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
  220. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  221. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  222. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
  223. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
  224. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  225. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
  226. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
  227. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
  228. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  229. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  230. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  231. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  232. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  233. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  234. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +396 -330
  235. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +50 -4
  236. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
  237. data/vendor/cmock/vendor/c_exception/vendor/unity/test/Makefile +17 -17
  238. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile +63 -3
  239. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
  240. data/vendor/cmock/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  241. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
  242. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
  243. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  244. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  245. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  246. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
  247. data/vendor/cmock/vendor/unity/README.md +19 -10
  248. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +67 -64
  249. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +20 -20
  250. data/vendor/cmock/vendor/unity/auto/generate_module.rb +149 -142
  251. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +234 -232
  252. data/vendor/cmock/vendor/unity/auto/parse_output.rb +220 -0
  253. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +108 -120
  254. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +11 -9
  255. data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +1 -3
  256. data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +6 -2
  257. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +45 -57
  258. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  259. data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  260. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  261. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  262. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  263. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  264. data/vendor/cmock/vendor/unity/examples/example_1/makefile +22 -17
  265. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  266. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  267. data/vendor/cmock/vendor/unity/examples/example_2/makefile +16 -17
  268. data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +15 -15
  269. data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  270. data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +4 -10
  271. data/vendor/cmock/vendor/unity/examples/unity_config.h +14 -26
  272. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +12 -12
  273. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  274. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  275. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  276. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  277. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  278. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  279. data/vendor/cmock/vendor/unity/release/version.info +1 -1
  280. data/vendor/cmock/vendor/unity/src/unity.c +396 -330
  281. data/vendor/cmock/vendor/unity/src/unity.h +50 -4
  282. data/vendor/cmock/vendor/unity/src/unity_internals.h +119 -84
  283. data/vendor/cmock/vendor/unity/test/Makefile +17 -17
  284. data/vendor/cmock/vendor/unity/test/rakefile +63 -3
  285. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +108 -105
  286. data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  287. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -6
  288. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +1 -9
  289. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  290. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  291. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  292. data/vendor/cmock/vendor/unity/test/tests/testunity.c +1338 -151
  293. data/vendor/deep_merge/Rakefile +1 -1
  294. data/vendor/unity/README.md +19 -10
  295. data/vendor/unity/auto/colour_prompt.rb +67 -64
  296. data/vendor/unity/auto/colour_reporter.rb +20 -20
  297. data/vendor/unity/auto/generate_module.rb +149 -142
  298. data/vendor/unity/auto/generate_test_runner.rb +234 -232
  299. data/vendor/unity/auto/parse_output.rb +220 -0
  300. data/vendor/unity/auto/stylize_as_junit.rb +108 -120
  301. data/vendor/unity/auto/test_file_filter.rb +11 -9
  302. data/vendor/unity/auto/type_sanitizer.rb +1 -3
  303. data/vendor/unity/auto/unity_test_summary.py +6 -2
  304. data/vendor/unity/auto/unity_test_summary.rb +45 -57
  305. data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  306. data/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  307. data/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  308. data/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  309. data/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  310. data/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  311. data/vendor/unity/examples/example_1/makefile +22 -17
  312. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  313. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  314. data/vendor/unity/examples/example_2/makefile +16 -17
  315. data/vendor/unity/examples/example_3/rakefile.rb +15 -15
  316. data/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  317. data/vendor/unity/examples/example_3/readme.txt +4 -10
  318. data/vendor/unity/examples/unity_config.h +14 -26
  319. data/vendor/unity/extras/fixture/rakefile.rb +12 -12
  320. data/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  321. data/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  322. data/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  323. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  324. data/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  325. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  326. data/vendor/unity/release/version.info +1 -1
  327. data/vendor/unity/src/unity.c +396 -330
  328. data/vendor/unity/src/unity.h +50 -4
  329. data/vendor/unity/src/unity_internals.h +119 -84
  330. data/vendor/unity/test/Makefile +17 -17
  331. data/vendor/unity/test/rakefile +63 -3
  332. data/vendor/unity/test/rakefile_helper.rb +108 -105
  333. data/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  334. data/vendor/unity/test/targets/clang_file.yml +0 -6
  335. data/vendor/unity/test/targets/clang_strict.yml +1 -9
  336. data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  337. data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  338. data/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  339. data/vendor/unity/test/tests/testunity.c +1338 -151
  340. metadata +102 -157
  341. data/test_graveyard/integration/paths.yml +0 -17
  342. data/test_graveyard/integration/paths_test.rb +0 -80
  343. data/test_graveyard/integration/rake_rules_aux_dependencies_test.rb +0 -75
  344. data/test_graveyard/integration/rake_rules_cmock_test.rb +0 -74
  345. data/test_graveyard/integration/rake_rules_preprocess_test.rb +0 -178
  346. data/test_graveyard/integration/rake_rules_test.rb +0 -268
  347. data/test_graveyard/integration/rake_tasks_test.rb +0 -103
  348. data/test_graveyard/integration_test_helper.rb +0 -34
  349. data/test_graveyard/rakefile_rules.rb +0 -10
  350. data/test_graveyard/rakefile_rules_aux_dependencies.rb +0 -10
  351. data/test_graveyard/rakefile_rules_cmock.rb +0 -10
  352. data/test_graveyard/rakefile_rules_preprocess.rb +0 -10
  353. data/test_graveyard/rakefile_tasks.rb +0 -10
  354. data/test_graveyard/system/file_system_dependencies.yml +0 -20
  355. data/test_graveyard/system/file_system_kitchen_sink.yml +0 -20
  356. data/test_graveyard/system/file_system_mocks.yml +0 -20
  357. data/test_graveyard/system/file_system_preprocess.yml +0 -20
  358. data/test_graveyard/system/file_system_simple.yml +0 -20
  359. data/test_graveyard/system/file_system_test.rb +0 -78
  360. data/test_graveyard/system/mocks/include/a_file.h +0 -2
  361. data/test_graveyard/system/mocks/include/other_stuff.h +0 -2
  362. data/test_graveyard/system/mocks/include/stuff.h +0 -3
  363. data/test_graveyard/system/mocks/source/a_file.c +0 -9
  364. data/test_graveyard/system/mocks/test/test_a_file.c +0 -41
  365. data/test_graveyard/system/mocks/test/test_no_file.c +0 -14
  366. data/test_graveyard/system/project_mocks.yml +0 -43
  367. data/test_graveyard/system/project_mocks_test.rb +0 -38
  368. data/test_graveyard/system/project_simple.yml +0 -36
  369. data/test_graveyard/system/project_simple_test.rb +0 -39
  370. data/test_graveyard/system/rule_mocks_test.rb +0 -44
  371. data/test_graveyard/system/rule_runners_test.rb +0 -44
  372. data/test_graveyard/system/simple/include/other_stuff.h +0 -2
  373. data/test_graveyard/system/simple/include/stuff.h +0 -3
  374. data/test_graveyard/system/simple/source/other_stuff.c +0 -6
  375. data/test_graveyard/system/simple/source/stuff.c +0 -7
  376. data/test_graveyard/system/simple/test/test_other_stuff.c +0 -30
  377. data/test_graveyard/system/simple/test/test_stuff.c +0 -51
  378. data/test_graveyard/system_test_helper.rb +0 -73
  379. data/test_graveyard/test_helper.rb +0 -93
  380. data/test_graveyard/unit/busted/configurator_builder_test.rb +0 -569
  381. data/test_graveyard/unit/busted/configurator_helper_test.rb +0 -234
  382. data/test_graveyard/unit/busted/configurator_test.rb +0 -232
  383. data/test_graveyard/unit/busted/configurator_validator_test.rb +0 -169
  384. data/test_graveyard/unit/busted/deep_merge_fix_test.rb +0 -55
  385. data/test_graveyard/unit/busted/dependinator_test.rb +0 -129
  386. data/test_graveyard/unit/busted/file_finder_helper_test.rb +0 -45
  387. data/test_graveyard/unit/busted/file_finder_test.rb +0 -114
  388. data/test_graveyard/unit/busted/file_path_utils_test.rb +0 -97
  389. data/test_graveyard/unit/busted/file_system_utils_test.rb +0 -21
  390. data/test_graveyard/unit/busted/generator_test.rb +0 -187
  391. data/test_graveyard/unit/busted/generator_test_results_test.rb +0 -129
  392. data/test_graveyard/unit/busted/generator_test_runner_test.rb +0 -475
  393. data/test_graveyard/unit/busted/preprocessinator_file_handler_test.rb +0 -39
  394. data/test_graveyard/unit/busted/preprocessinator_helper_test.rb +0 -156
  395. data/test_graveyard/unit/busted/preprocessinator_includes_handler_test.rb +0 -93
  396. data/test_graveyard/unit/busted/preprocessinator_test.rb +0 -57
  397. data/test_graveyard/unit/busted/project_file_loader_test.rb +0 -142
  398. data/test_graveyard/unit/busted/setupinator_test.rb +0 -45
  399. data/test_graveyard/unit/busted/streaminator_test.rb +0 -49
  400. data/test_graveyard/unit/busted/task_invoker_test.rb +0 -69
  401. data/test_graveyard/unit/busted/test_includes_extractor_test.rb +0 -111
  402. data/test_graveyard/unit/busted/test_invoker_helper_test.rb +0 -62
  403. data/test_graveyard/unit/busted/test_invoker_test.rb +0 -47
  404. data/test_graveyard/unit/busted/tool_executor_helper_test.rb +0 -100
  405. data/test_graveyard/unit/busted/tool_executor_test.rb +0 -351
  406. data/test_graveyard/unit/busted/verbosinator_test.rb +0 -65
  407. data/test_graveyard/unit/preprocessinator_extractor_test.rb +0 -731
  408. data/test_graveyard/unit_test_helper.rb +0 -16
  409. data/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  410. data/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  411. data/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
  412. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  413. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  414. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  415. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  416. data/vendor/cmock/docs/CMock Summary.odt +0 -0
  417. data/vendor/cmock/docs/CMock Summary.pdf +0 -0
  418. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  419. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  420. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
  421. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  422. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  423. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  424. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  425. data/vendor/cmock/vendor/unity/auto/parseOutput.rb +0 -191
  426. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  427. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  428. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  429. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  430. data/vendor/unity/auto/parseOutput.rb +0 -191
  431. data/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  432. data/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  433. data/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  434. data/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
@@ -1,97 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'ceedling/file_path_utils'
3
-
4
-
5
- class FilePathUtilsTest < Test::Unit::TestCase
6
-
7
- def setup
8
- objects = create_mocks(:configurator, :file_wrapper)
9
- @utils = FilePathUtils.new(objects)
10
- end
11
-
12
- def teardown
13
- end
14
-
15
-
16
- should "standardize paths with forward slash file separators and prepend with ./" do
17
- assert_equal('files/dir/dir', FilePathUtils::standardize("files\\dir\\dir/"))
18
- assert_equal('root/subdir/dir', FilePathUtils::standardize("root\\subdir\\dir\\"))
19
- assert_equal('files/modules/tests', FilePathUtils::standardize("files/modules/tests"))
20
- assert_equal('source/modules', FilePathUtils::standardize("source\\modules"))
21
- assert_equal('source/modules', FilePathUtils::standardize("./source\\modules"))
22
- assert_equal('source/modules', FilePathUtils::standardize(".\\source\\modules"))
23
- assert_equal('', FilePathUtils::standardize("./"))
24
- assert_equal('.', FilePathUtils::standardize("."))
25
- end
26
-
27
-
28
- should "find base directory up to glob notation or filename" do
29
- assert_equal('/files/stuff', FilePathUtils::dirname('/files/stuff/'))
30
- assert_equal('/files/stuff', FilePathUtils::dirname('/files/stuff'))
31
- assert_equal('.', FilePathUtils::dirname('.'))
32
-
33
- assert_equal('.', FilePathUtils::dirname('./*'))
34
- assert_equal('/files/stuff', FilePathUtils::dirname('/files/stuff/**'))
35
- assert_equal('/files/stuff', FilePathUtils::dirname('/files/stuff/*'))
36
- assert_equal('/files/stuff', FilePathUtils::dirname('/files/stuff/**/more*'))
37
- assert_equal('files/tests', FilePathUtils::dirname('files/tests/*test/**/thing*/**'))
38
- assert_equal('files', FilePathUtils::dirname('files/test*'))
39
-
40
- assert_equal('files/tests', FilePathUtils::dirname('files/tests/???src'))
41
- assert_equal('project/files', FilePathUtils::dirname('project/files/test?'))
42
-
43
- assert_equal('project/files', FilePathUtils::dirname('project/files/test[123]'))
44
-
45
- assert_equal('project/files', FilePathUtils::dirname('project/files/test{ing,s}'))
46
-
47
- assert_equal('project/files', FilePathUtils::dirname('project/files/**/**'))
48
- end
49
-
50
-
51
- should "form valid subdirectory recursing globs from path convention" do
52
- assert_equal('/files/stuff/', FilePathUtils::reform_glob('/files/stuff/'))
53
- assert_equal('/files/stuff', FilePathUtils::reform_glob('/files/stuff'))
54
- assert_equal('.', FilePathUtils::reform_glob('.'))
55
-
56
- assert_equal('./*', FilePathUtils::reform_glob('./*'))
57
- assert_equal('/files/stuff/**/**', FilePathUtils::reform_glob('/files/stuff/**'))
58
- assert_equal('/files/stuff/*', FilePathUtils::reform_glob('/files/stuff/*'))
59
- assert_equal('/files/stuff/**/more*', FilePathUtils::reform_glob('/files/stuff/**/more*'))
60
- assert_equal('files/tests/*test/**/thing*/**/**', FilePathUtils::reform_glob('files/tests/*test/**/thing*/**'))
61
-
62
- assert_equal('files/tests/???src', FilePathUtils::reform_glob('files/tests/???src'))
63
- assert_equal('project/files/test?', FilePathUtils::reform_glob('project/files/test?'))
64
-
65
- assert_equal('project/files/test[123]', FilePathUtils::reform_glob('project/files/test[123]'))
66
-
67
- assert_equal('project/files/test{ing,s}', FilePathUtils::reform_glob('project/files/test{ing,s}'))
68
- end
69
-
70
-
71
- should "form runner object file path from configuration and file name" do
72
- @configurator.expects.project_test_build_output_path.returns('project/build/output')
73
- @configurator.expects.extension_object.returns('.obj')
74
- @configurator.expects.extension_object.returns('.obj')
75
- @configurator.expects.test_runner_file_suffix.returns('_runner')
76
-
77
- assert_equal('project/build/output/test_stuff_runner.obj', @utils.form_runner_object_filepath_from_test('files/junk/test_stuff.c'))
78
- end
79
-
80
-
81
- should "form runner object file path from configuration and file name" do
82
- @configurator.expects.project_test_build_output_path.returns('project/build/output')
83
- @configurator.expects.extension_object.returns('.o')
84
-
85
- assert_equal('project/build/output/stuff.o', @utils.form_object_filepath('files/junk/stuff.c'))
86
- end
87
-
88
-
89
- should "form executable file path from configuration and file name" do
90
- @configurator.expects.project_test_build_output_path.returns('project/build/output')
91
- @configurator.expects.extension_executable.returns('.out')
92
-
93
- assert_equal('project/build/output/test_stuff.out', @utils.form_executable_filepath('files/tests/test_stuff.c'))
94
- end
95
-
96
- end
97
-
@@ -1,21 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'ceedling/file_system_utils'
3
-
4
-
5
- class FileSystemUtilsTest < Test::Unit::TestCase
6
-
7
- def setup
8
- objects = create_mocks(:file_wrapper)
9
- utils = FileSystemUtils.new(objects)
10
- end
11
-
12
- def teardown
13
- end
14
-
15
-
16
- should "" do
17
- # dummy placeholder test; all tests are system tests (system/paths_test) for this guy
18
- end
19
-
20
- end
21
-
@@ -1,187 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'ceedling/generator'
3
-
4
-
5
- class GeneratorTest < Test::Unit::TestCase
6
-
7
- def setup
8
- objects = create_mocks(:configurator, :preprocessinator, :cmock_factory, :generator_test_runner, :generator_test_results, :test_includes_extractor, :tool_executor, :file_finder, :file_path_utils, :streaminator, :plugin_manager, :file_wrapper)
9
- create_mocks(:cmock, :file)
10
- @generator = Generator.new(objects)
11
- end
12
-
13
- def teardown
14
- end
15
-
16
- ################### includes preprocessing ####################
17
-
18
- should "generate shallow includes list file" do
19
- @preprocessinator.expects.preprocess_shallow_includes('project/tests/test_file.c')
20
-
21
- @generator.generate_shallow_includes_list('project/tests/test_file.c')
22
- end
23
-
24
- ################### file preprocessing ####################
25
-
26
- should "generate preprocessed version of file" do
27
- @streaminator.expects.stdout_puts("Preprocessing test_icle.c...", Verbosity::NORMAL)
28
-
29
- @preprocessinator.expects.preprocess_file('project/tests/test_icle.c')
30
-
31
- @generator.generate_preprocessed_file('project/tests/test_icle.c')
32
- end
33
-
34
- ################### auxiliary dependencies ####################
35
-
36
- should "generate auxiliary dependencies file" do
37
- @streaminator.expects.stdout_puts("Generating dependencies for file.c...", Verbosity::NORMAL)
38
-
39
- @configurator.expects.tools_dependencies_generator.returns('gcc -depgen')
40
- @file_path_utils.expects.form_object_filepath('project/files/src/file.c').returns('project/build/file.o')
41
-
42
- @tool_executor.expects.build_command_line('gcc -depgen', 'project/files/src/file.c', ['types.h', 'helper.h'], 'project/build/file.o').returns('dep cmd line')
43
-
44
- @tool_executor.expects.exec('dep cmd line')
45
-
46
- @generator.generate_dependencies_file('project/files/src/file.c', ['types.h', 'helper.h'])
47
- end
48
-
49
- ################### cmock ####################
50
-
51
- should "manufacture cmock object if not already in existence and verify that cmock gets called" do
52
- test_source_header1 = 'files/source/mockable1.h'
53
- test_preprocessed_header1 = 'files/preprocessed/mockable1.h'
54
- test_source_header2 = 'files/source/mockable2.h'
55
- test_preprocessed_header2 = 'files/preprocessed/mockable2.h'
56
-
57
- # instantiate cmock as it doesn't exist and then call against to create mock
58
- @configurator.expects.cmock_config_hash.returns({:cmock => []})
59
- @cmock_factory.expects.manufacture({:cmock => []}).returns(@cmock)
60
- @preprocessinator.expects.form_file_path(test_source_header1).returns(test_preprocessed_header1)
61
- @cmock.expects.setup_mocks(test_preprocessed_header1)
62
- @generator.generate_mock(test_source_header1)
63
-
64
- # don't instantiate cmock as it already exists and then against it to create mock
65
- @preprocessinator.expects.form_file_path(test_source_header2).returns(test_preprocessed_header2)
66
- @cmock.expects.setup_mocks(test_preprocessed_header2)
67
- @generator.generate_mock(test_source_header2)
68
- end
69
-
70
- ################### test runner ####################
71
-
72
- should "generate test runner" do
73
- test_source = 'tests/test_count_chocula.c'
74
- preprocessed_source = 'preprocessed/test_count_chocula.c'
75
- test_runner = 'build/runners/test_count_chocula_runner.c'
76
- test_cases = ['test_how_much_goodness', 'test_chocolatey_milk']
77
- mock_list = ['mock_marshmallows.h', 'mock_cereal_bits.h']
78
-
79
- @preprocessinator.expects.form_file_path(test_source).returns(preprocessed_source)
80
-
81
- @generator_test_runner.expects.find_test_cases(preprocessed_source).returns(test_cases)
82
- @test_includes_extractor.expects.lookup_raw_mock_list(preprocessed_source).returns(mock_list)
83
-
84
- @streaminator.expects.stdout_puts("Creating test runner for test_count_chocula.c...", Verbosity::NORMAL)
85
-
86
- @file_wrapper.expects.open(test_runner, 'w').yields(@file)
87
-
88
- @generator_test_runner.expects.create_header(@file, mock_list)
89
- @generator_test_runner.expects.create_externs(@file, test_cases)
90
- @generator_test_runner.expects.create_mock_management(@file, mock_list)
91
- @generator_test_runner.expects.create_runtest(@file, mock_list, test_cases)
92
- @generator_test_runner.expects.create_main(@file, 'test_count_chocula.c', test_cases)
93
-
94
- @generator.generate_test_runner(test_source, test_runner)
95
- end
96
-
97
- ################### compilation ####################
98
-
99
- should "compile object file" do
100
- tool_config = {:tools_test_compiler => {}}
101
-
102
- @streaminator.expects.stdout_puts("Compiling compile_me.c...", Verbosity::NORMAL)
103
-
104
- @configurator.expects.tools_test_compiler.returns(tool_config)
105
-
106
- @tool_executor.expects.build_command_line(tool_config, 'files/modules/compile_me.c', 'build/out/compile_me.o').returns('compiler.exe input output')
107
- @tool_executor.expects.exec('compiler.exe input output').returns('ignore this')
108
-
109
- @generator.generate_object_file('files/modules/compile_me.c', 'build/out/compile_me.o')
110
- end
111
-
112
- ################### linking ####################
113
-
114
- should "link executable file" do
115
- tool_config = {:tools_test_linker => {}}
116
-
117
- @streaminator.expects.stdout_puts("Linking link_me.out...", Verbosity::NORMAL)
118
-
119
- @configurator.expects.tools_test_linker.returns(tool_config)
120
-
121
- @tool_executor.expects.build_command_line(tool_config, ['build/out/compile_me.o', 'build/out/compile_me_too.o'], 'build/out/link_me.out').returns('linker.exe input output')
122
- @tool_executor.expects.exec('linker.exe input output').returns('ignore this')
123
-
124
- @generator.generate_executable_file(['build/out/compile_me.o', 'build/out/compile_me_too.o'], 'build/out/link_me.out')
125
- end
126
-
127
- ################### test execution ####################
128
-
129
- should "execute test and process results to file" do
130
- tool_config = {:tools_test_runner => {}}
131
- arg_hash = {:executable => 'build/out/test.out', :result => 'build/results/test.pass'}
132
-
133
- @plugin_manager.expects.pre_test_fixture_execute(arg_hash)
134
-
135
- @streaminator.expects.stdout_puts("Running test.out...", Verbosity::NORMAL)
136
-
137
- @configurator.expects.tools_test_fixture.returns(tool_config)
138
-
139
- @tool_executor.expects.build_command_line(tool_config, arg_hash[:executable]).returns('simulator.exe test.out')
140
- @tool_executor.expects.exec('simulator.exe test.out').returns('test results')
141
-
142
- @file_finder.expects.find_test_from_file_path(arg_hash[:executable]).returns('tests/test.c')
143
-
144
- @generator_test_results.expects.process_and_write_results('test results', arg_hash[:result], 'tests/test.c')
145
-
146
- @plugin_manager.expects.post_test_fixture_execute(arg_hash)
147
-
148
- @generator.generate_test_results(arg_hash[:executable], arg_hash[:result])
149
- end
150
-
151
- should "raise if test execution yields nil results" do
152
- tool_config = {:tools_test_runner => {}}
153
- arg_hash = {:executable => 'build/out/test.out', :result => 'build/results/test.pass'}
154
-
155
- @plugin_manager.expects.pre_test_fixture_execute(arg_hash)
156
-
157
- @streaminator.expects.stdout_puts("Running test.out...", Verbosity::NORMAL)
158
-
159
- @configurator.expects.tools_test_fixture.returns(tool_config)
160
-
161
- @tool_executor.expects.build_command_line(tool_config, arg_hash[:executable]).returns('simulator.exe test.out')
162
- @tool_executor.expects.exec('simulator.exe test.out').returns(nil)
163
-
164
- @streaminator.expects.stderr_puts("ERROR: Test executable \"test.out\" did not produce any results.", Verbosity::ERRORS)
165
-
166
- assert_raise(RuntimeError) { @generator.generate_test_results(arg_hash[:executable], arg_hash[:result]) }
167
- end
168
-
169
- should "raise if test execution yields a string with no parseable results" do
170
- tool_config = {:tools_test_runner => {}}
171
- arg_hash = {:executable => 'build/out/test.out', :result => 'build/results/test.pass'}
172
-
173
- @plugin_manager.expects.pre_test_fixture_execute(arg_hash)
174
-
175
- @streaminator.expects.stdout_puts("Running test.out...", Verbosity::NORMAL)
176
-
177
- @configurator.expects.tools_test_fixture.returns(tool_config)
178
-
179
- @tool_executor.expects.build_command_line(tool_config, arg_hash[:executable]).returns('simulator.exe test.out')
180
- @tool_executor.expects.exec('simulator.exe test.out').returns('')
181
-
182
- @streaminator.expects.stderr_puts("ERROR: Test executable \"test.out\" did not produce any results.", Verbosity::ERRORS)
183
-
184
- assert_raise(RuntimeError) { @generator.generate_test_results('build/out/test.out', 'build/results/test.pass') }
185
- end
186
-
187
- end
@@ -1,129 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'ceedling/generator_test_results'
3
-
4
-
5
- class GeneratorTestResultsTest < Test::Unit::TestCase
6
-
7
- def setup
8
- objects = create_mocks(:configurator, :yaml_wrapper, :streaminator)
9
- @utils = GeneratorTestResults.new(objects)
10
- end
11
-
12
- def teardown
13
- end
14
-
15
-
16
- should "complain if output from test fixture includes messed up statistics" do
17
-
18
- # no ignore count
19
- raw_unity_output1 = %Q[
20
- 13 Tests 0 Failures
21
- ].left_margin(0)
22
-
23
- @configurator.expects.extension_executable.returns('.exe')
24
- @streaminator.expects.stderr_puts("ERROR: Results from test fixture 'TestIng.exe' are missing or are malformed.", Verbosity::ERRORS)
25
-
26
- assert_raise(RuntimeError){ @utils.process_and_write_results(raw_unity_output1, 'project/build/results/TestIng.pass', 'files/tests/TestIng.c') }
27
-
28
- # 'Test' not pluralized
29
- raw_unity_output2 = %Q[
30
- 13 Test 0 Failures 3 Ignored
31
- ].left_margin(0)
32
-
33
- @configurator.expects.extension_executable.returns('.out')
34
- @streaminator.expects.stderr_puts("ERROR: Results from test fixture 'TestIcular.out' are missing or are malformed.", Verbosity::ERRORS)
35
-
36
- assert_raise(RuntimeError){ @utils.process_and_write_results(raw_unity_output2, 'project/build/results/TestIcular.pass', 'files/tests/TestIcular.c') }
37
- end
38
-
39
-
40
- should "write a mixture of test results to a .fail file" do
41
-
42
- # test fixture output with blank lines and junk past the statistics line
43
- raw_unity_output = %Q[
44
-
45
- test_a_file.c:13:test_a_single_thing:IGNORE:pay no attention to the test behind the curtain
46
- test_a_file.c:18:test_another_thing:IGNORE:pay no attention to the:stray colon
47
- test_a_file.c:35:test_your_knowledge:FAIL:Expected TRUE was FALSE
48
- test_a_file.c:42:test_a_success_case:PASS
49
-
50
- test_a_file.c:47:test_another_thing:FAIL
51
- test_a_file.c:53:test_some_non_void_param_stuff:IGNORE:pay no attention to the test behind the curtain
52
- test_a_file.c:60:test_some_multiline_test_case_action:IGNORE:pay no attention to the test behind the curtain
53
-
54
- test_a_file.c:65:test_another_success_case:PASS
55
- test_a_file.c:78:test_yet_another_success_case:PASS
56
- test_a_file.c:92:test_a_final_thing:FAIL:BOOM!
57
- 10 Tests 3 Failures 4 Ignored
58
- FAIL
59
- // a random comment to be ignored
60
- ].left_margin(0)
61
-
62
- expected_hash = {
63
- :counts => {:total => 10, :failed => 3, :ignored => 4, :passed => 3},
64
- :source => {:path => 'files/tests', :file => 'test_a_file.c'},
65
- :failures => [
66
- {:test => 'test_your_knowledge', :line => 35, :message => 'Expected TRUE was FALSE'},
67
- {:test => 'test_another_thing', :line => 47, :message => ''},
68
- {:test => 'test_a_final_thing', :line => 92, :message => 'BOOM!'},
69
- ],
70
- :ignores => [
71
- {:test => 'test_a_single_thing', :line => 13, :message => 'pay no attention to the test behind the curtain'},
72
- {:test => 'test_another_thing', :line => 18, :message => 'pay no attention to the:stray colon'},
73
- {:test => 'test_some_non_void_param_stuff', :line => 53, :message => 'pay no attention to the test behind the curtain'},
74
- {:test => 'test_some_multiline_test_case_action', :line => 60, :message => 'pay no attention to the test behind the curtain'},
75
- ],
76
- :successes => [
77
- {:test => 'test_a_success_case', :line => 42, :message => ''},
78
- {:test => 'test_another_success_case', :line => 65, :message => ''},
79
- {:test => 'test_yet_another_success_case', :line => 78, :message => ''},
80
- ]
81
- }
82
-
83
- @configurator.expects.extension_testfail.returns('.fail')
84
-
85
- @yaml_wrapper.expects.dump('project/build/results/test_a_file.fail', expected_hash)
86
-
87
- @utils.process_and_write_results(raw_unity_output, 'project/build/results/test_a_file.pass', 'files/tests/test_a_file.c')
88
-
89
- end
90
-
91
-
92
- should "write a mixture of test results to a .pass file" do
93
-
94
- # clean test fixture output
95
- raw_unity_output = %Q[
96
- test_eez.c:13:test_a_single_thing:IGNORE:pay no attention to the test behind the curtain
97
- test_eez.c:18:test_another_thing:IGNORE:pay no attention to the test behind the curtain
98
- test_eez.c:30:test_a_success_case:PASS
99
- test_eez.c:60:test_some_multiline_test_case_action:IGNORE:pay no attention to the stray:colon
100
- test_eez.c:73:test_another_success_case:PASS
101
- test_eez.c:83:test_yet_another_success_case:PASS
102
- 6 Tests 0 Failures 3 Ignored
103
- OK
104
- ].left_margin(0)
105
-
106
- expected_hash = {
107
- :counts => {:total => 6, :failed => 0, :ignored => 3, :passed => 3},
108
- :source => {:path => 'files/tests', :file => 'test_eez.c'},
109
- :failures => [],
110
- :ignores => [
111
- {:test => 'test_a_single_thing', :line => 13, :message => 'pay no attention to the test behind the curtain'},
112
- {:test => 'test_another_thing', :line => 18, :message => 'pay no attention to the test behind the curtain'},
113
- {:test => 'test_some_multiline_test_case_action', :line => 60, :message => 'pay no attention to the stray:colon'},
114
- ],
115
- :successes => [
116
- {:test => 'test_a_success_case', :line => 30, :message => ''},
117
- {:test => 'test_another_success_case', :line => 73, :message => ''},
118
- {:test => 'test_yet_another_success_case', :line => 83, :message => ''},
119
- ]
120
- }
121
-
122
- @yaml_wrapper.expects.dump('project/build/results/test_eez.pass', expected_hash)
123
-
124
- @utils.process_and_write_results(raw_unity_output, 'project/build/results/test_eez.pass', 'files/tests/test_eez.c')
125
-
126
- end
127
-
128
- end
129
-
@@ -1,475 +0,0 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'ceedling/generator_test_runner'
3
-
4
-
5
- # redefine split for convenience of file content comparison in tests.
6
- # this is needed because we're using the '<<' operator on real files in source but substituting
7
- # an array for file writes in the tests; the '<<' operator tacks on new lines when used with a file,
8
- # but, of course, does not do this when inserting into an array.
9
- class String
10
- def newline_split(pattern=/\n/, limit=nil)
11
- return (split(pattern, limit)).map{|elem| elem + "\n"} if !limit.nil?
12
- return (split(pattern) ).map{|elem| elem + "\n"}
13
- end
14
- end
15
-
16
-
17
- #NOTE: When using newline_split() & left_margin() to manage test code strings,
18
- # white space to the left of newlines in otherwise blank lines is important.
19
- # That is, *every* line in a test code block must be spaced over.
20
-
21
-
22
- class GeneratorTestRunnerTest < Test::Unit::TestCase
23
-
24
- def setup
25
- objects = create_mocks(:configurator, :file_wrapper)
26
- @runner_utils = GeneratorTestRunner.new(objects)
27
- end
28
-
29
- def teardown
30
- end
31
-
32
-
33
- ######### find test cases #########
34
-
35
- should "find test case functions in preprocessed test file" do
36
- test_file = 'tests/test_me.c'
37
-
38
- test_me_c = %Q[
39
- #include "unity.h"
40
- #include "Oscar.h"
41
- #include "mock_abilly.h"
42
- #include "mock_and_roll.h "
43
-
44
- void test_some_stuff(void)
45
- {
46
- TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
47
- }
48
-
49
- void test_some_more_stuff ( void )
50
- {
51
- TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
52
- }
53
-
54
- void test_some_non_void_param_stuff()
55
- {
56
- TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
57
- }
58
-
59
- void
60
- test_some_multiline_test_case_action
61
- (void)
62
- {
63
- TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
64
- }
65
-
66
- ].left_margin(0)
67
-
68
- @configurator.expects.project_use_preprocessor.returns(true)
69
-
70
- @file_wrapper.expects.read(test_file).returns(test_me_c)
71
-
72
- assert_equal(
73
- ['test_some_stuff',
74
- 'test_some_more_stuff',
75
- 'test_some_non_void_param_stuff',
76
- 'test_some_multiline_test_case_action'
77
- ],
78
- @runner_utils.find_test_cases(test_file))
79
- end
80
-
81
- should "find test case functions in non-preprocessed test file (do some basic pre-processing with regex)" do
82
- test_file = 'tests/test_me.c'
83
-
84
- test_me_c = %Q[
85
- #include "unity.h"
86
- #include "Oscar.h"
87
- #include "mock_abilly.h"
88
- #include "mock_and_roll.h "
89
-
90
- #ifdef SOMETHING
91
- extern void test_a_thing_to_throw_off_scanning(void);
92
- #end
93
-
94
- //void test_some_stuff(void)
95
- //{
96
- // TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
97
- //}
98
-
99
- /*
100
- void test_some_more_stuff ( void )
101
- {
102
- TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
103
- }*/
104
-
105
- void test_some_non_void_param_stuff()
106
- {
107
- TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
108
- }
109
-
110
- void
111
- test_some_multiline_test_case_action
112
- (void)
113
- {
114
- TEST_ASSERT_IGNORE("pay no attention to the test behind the curtain");
115
- }
116
-
117
- ].left_margin(0)
118
-
119
- @configurator.expects.project_use_preprocessor.returns(false)
120
-
121
- @file_wrapper.expects.read(test_file).returns(test_me_c)
122
-
123
- assert_equal(
124
- ['test_some_non_void_param_stuff',
125
- 'test_some_multiline_test_case_action'
126
- ],
127
- @runner_utils.find_test_cases(test_file))
128
- end
129
-
130
-
131
- ######### header block #########
132
-
133
- should "create header block of include statements and internal variables for exception handling, mocks, and strict ordering" do
134
- file = []
135
-
136
- expected_output = %Q[
137
- /* AUTOGENERATED FILE. DO NOT EDIT. */
138
- #include "unity.h"
139
- #include "extra_thing1.h"
140
- #include "extra_thing2.h"
141
- #include <setjmp.h>
142
- #include <stdio.h>
143
- #include "CException.h"
144
- #include "mock_abc.h"
145
- #include "mock_123.h"
146
-
147
- int GlobalExpectCount;
148
- int GlobalVerifyOrder;
149
- char* GlobalOrderError;
150
-
151
- char MessageBuffer[50];
152
- ].left_margin(0)
153
-
154
- @configurator.expects.test_runner_includes.returns(['extra_thing1.h', 'extra_thing2.h'])
155
- @configurator.expects.project_use_exceptions.returns(true)
156
- @configurator.expects.extension_header.returns('.h')
157
- @configurator.expects.cmock_enforce_strict_ordering.returns(true)
158
-
159
- @runner_utils.create_header(file, ['mock_abc', 'mock_123'])
160
-
161
- assert_equal(expected_output.newline_split[1..-1], file)
162
- end
163
-
164
- should "create header block of include statements and internal variables for exception handling & mocks but without strict ordering" do
165
- file = []
166
-
167
- expected_output = %Q[
168
- /* AUTOGENERATED FILE. DO NOT EDIT. */
169
- #include "unity.h"
170
- #include "extra_thing1.h"
171
- #include "extra_thing2.h"
172
- #include <setjmp.h>
173
- #include <stdio.h>
174
- #include "CException.h"
175
- #include "mock_abc.H"
176
- #include "mock_123.H"
177
-
178
- char MessageBuffer[50];
179
- ].left_margin(0)
180
-
181
- @configurator.expects.test_runner_includes.returns(['extra_thing1.h', 'extra_thing2.h'])
182
- @configurator.expects.project_use_exceptions.returns(true)
183
- @configurator.expects.extension_header.returns('.H')
184
- @configurator.expects.cmock_enforce_strict_ordering.returns(false)
185
-
186
- @runner_utils.create_header(file, ['mock_abc', 'mock_123'])
187
-
188
- assert_equal(expected_output.newline_split[1..-1], file)
189
- end
190
-
191
- should "create header block of include statements and internal variables for no extra header files, exception handling, or mocks" do
192
- file = []
193
-
194
- expected_output = %Q[
195
- /* AUTOGENERATED FILE. DO NOT EDIT. */
196
- #include "unity.h"
197
- #include <setjmp.h>
198
- #include <stdio.h>
199
-
200
- char MessageBuffer[50];
201
- ].left_margin(0)
202
-
203
- @configurator.expects.test_runner_includes.returns([])
204
- @configurator.expects.project_use_exceptions.returns(false)
205
-
206
- @runner_utils.create_header(file, [])
207
-
208
- assert_equal(expected_output.newline_split[1..-1], file)
209
- end
210
-
211
-
212
- ######### extern block #########
213
-
214
- should "create extern block of setup, teardown, and test cases" do
215
- file = []
216
-
217
- expected_output = %Q[
218
- extern void setUp(void);
219
- extern void tearDown(void);
220
-
221
- extern void test_case1(void);
222
- extern void test_case2(void);
223
- extern void test_case3(void);
224
- ].left_margin(0)
225
-
226
- @runner_utils.create_externs(file, ['test_case1', 'test_case2', 'test_case3'])
227
-
228
- assert_equal(expected_output.newline_split, file)
229
- end
230
-
231
-
232
- should "create extern block of setup, teardown, and no test cases" do
233
- file = []
234
-
235
- expected_output = %Q[
236
- extern void setUp(void);
237
- extern void tearDown(void);
238
- ].left_margin(0)
239
-
240
- @runner_utils.create_externs(file, [])
241
-
242
- assert_equal(expected_output.newline_split, file)
243
- end
244
-
245
-
246
- ######### mock management #########
247
-
248
- should "create mock management block for given mock list with strict ordering" do
249
- file = []
250
-
251
- expected_output = %Q[
252
- static void CMock_Init(void)
253
- {
254
- GlobalExpectCount = 0;
255
- GlobalVerifyOrder = 0;
256
- GlobalOrderError = NULL;
257
- mock_thinger_Init();
258
- mock_stinger_Init();
259
- mock_zinger_Init();
260
- }
261
-
262
- static void CMock_Verify(void)
263
- {
264
- mock_thinger_Verify();
265
- mock_stinger_Verify();
266
- mock_zinger_Verify();
267
- }
268
-
269
- static void CMock_Destroy(void)
270
- {
271
- mock_thinger_Destroy();
272
- mock_stinger_Destroy();
273
- mock_zinger_Destroy();
274
- }
275
-
276
- void CMock_VerifyAndReset(void)
277
- {
278
- CMock_Verify();
279
- CMock_Destroy();
280
- CMock_Init();
281
- }
282
- ].left_margin(0)
283
-
284
- @configurator.expects.extension_header.returns('.h')
285
- @configurator.expects.cmock_enforce_strict_ordering.returns(true)
286
-
287
- @runner_utils.create_mock_management(file, ['mock_thinger.h', 'mock_stinger.h', 'mock_zinger.h'])
288
-
289
- assert_equal(expected_output.newline_split + ["\n"], file) # add newline array element that split won't do
290
- end
291
-
292
- should "create mock management block for given mock list without strict ordering" do
293
- file = []
294
-
295
- expected_output = %Q[
296
- static void CMock_Init(void)
297
- {
298
- mock_thinger_Init();
299
- mock_stinger_Init();
300
- mock_zinger_Init();
301
- }
302
-
303
- static void CMock_Verify(void)
304
- {
305
- mock_thinger_Verify();
306
- mock_stinger_Verify();
307
- mock_zinger_Verify();
308
- }
309
-
310
- static void CMock_Destroy(void)
311
- {
312
- mock_thinger_Destroy();
313
- mock_stinger_Destroy();
314
- mock_zinger_Destroy();
315
- }
316
-
317
- void CMock_VerifyAndReset(void)
318
- {
319
- CMock_Verify();
320
- CMock_Destroy();
321
- CMock_Init();
322
- }
323
- ].left_margin(0)
324
-
325
- @configurator.expects.extension_header.returns('.h')
326
- @configurator.expects.cmock_enforce_strict_ordering.returns(false)
327
-
328
- @runner_utils.create_mock_management(file, ['mock_thinger.h', 'mock_stinger.h', 'mock_zinger.h'])
329
-
330
- assert_equal(expected_output.newline_split + ["\n"], file) # add newline array element that split won't do
331
- end
332
-
333
- should "create empty mock management block for empty mock list" do
334
- file = []
335
-
336
- @runner_utils.create_mock_management(file, [])
337
-
338
- assert_equal([], file)
339
- end
340
-
341
-
342
- ######### runTest() #########
343
-
344
- should "create no runTest function if there's no test cases (to prevent unused function compilation warnings)" do
345
- file = []
346
- @runner_utils.create_runtest(file, [], [])
347
- assert_equal([], file)
348
- end
349
-
350
- should "create runTest function including mock and exception handling" do
351
- file = []
352
-
353
- expected_output = %Q[
354
- static void runTest(UnityTestFunction test)
355
- {
356
- if (TEST_PROTECT())
357
- {
358
- CEXCEPTION_T e;
359
- Try {
360
- CMock_Init();
361
- setUp();
362
- test();
363
- CMock_Verify();
364
- } Catch(e) { TEST_FAIL("Unhandled Exception!"); }
365
- }
366
- CMock_Destroy();
367
- if (TEST_PROTECT())
368
- {
369
- tearDown();
370
- }
371
- }
372
- ].left_margin(0)
373
-
374
- @configurator.expects.project_use_exceptions.returns(true)
375
-
376
- @runner_utils.create_runtest(file, ['mock_zinger.h'], ['test_icle.c', 'test_ing.c'])
377
- assert_equal(expected_output.newline_split, file)
378
- end
379
-
380
- should "create runTest function including mock handling but no exception handling" do
381
- file = []
382
-
383
- expected_output = %Q[
384
- static void runTest(UnityTestFunction test)
385
- {
386
- if (TEST_PROTECT())
387
- {
388
- CMock_Init();
389
- setUp();
390
- test();
391
- CMock_Verify();
392
- }
393
- CMock_Destroy();
394
- if (TEST_PROTECT())
395
- {
396
- tearDown();
397
- }
398
- }
399
- ].left_margin(0)
400
-
401
- @configurator.expects.project_use_exceptions.returns(false)
402
-
403
- @runner_utils.create_runtest(file, ['mock_zinger.h'], ['test_icle.c', 'test_ing.c'])
404
- assert_equal(expected_output.newline_split, file)
405
- end
406
-
407
- should "create runTest function including no mock handling but including exception handling" do
408
- file = []
409
-
410
- expected_output = %Q[
411
- static void runTest(UnityTestFunction test)
412
- {
413
- if (TEST_PROTECT())
414
- {
415
- CEXCEPTION_T e;
416
- Try {
417
- setUp();
418
- test();
419
- } Catch(e) { TEST_FAIL("Unhandled Exception!"); }
420
- }
421
- if (TEST_PROTECT())
422
- {
423
- tearDown();
424
- }
425
- }
426
- ].left_margin(0)
427
-
428
- @configurator.expects.project_use_exceptions.returns(true)
429
-
430
- @runner_utils.create_runtest(file, [], ['test_icle.c', 'test_ing.c'])
431
- assert_equal(expected_output.newline_split, file)
432
- end
433
-
434
- ######### main() #########
435
-
436
- should "create main function with test cases" do
437
- file = []
438
-
439
- expected_output = %Q[
440
- int main(void)
441
- {
442
- UnityBegin("TestMe.c");
443
-
444
- // RUN_TEST calls runTest
445
- RUN_TEST(test_a_little_test);
446
- RUN_TEST(test_a_wee_test);
447
- RUN_TEST(test_a_teeny_test);
448
-
449
- UnityEnd();
450
- return 0;
451
- }
452
- ].left_margin(0)
453
-
454
- @runner_utils.create_main(file, 'TestMe.c', ['test_a_little_test', 'test_a_wee_test', 'test_a_teeny_test'])
455
- assert_equal(expected_output.newline_split + ["\n"], file) # add newline array element that split won't do
456
- end
457
-
458
- should "create main function with no test cases" do
459
- file = []
460
-
461
- expected_output = %Q[
462
- int main(void)
463
- {
464
- UnityBegin("TestIfy.c");
465
-
466
- UnityEnd();
467
- return 0;
468
- }
469
- ].left_margin(0)
470
-
471
- @runner_utils.create_main(file, 'TestIfy.c', [])
472
- assert_equal(expected_output.newline_split + ["\n"], file) # add newline array element that split won't do
473
- end
474
-
475
- end