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
@@ -25,12 +25,17 @@ end
25
25
 
26
26
 
27
27
  rule(/#{PROJECT_TEST_BUILD_OUTPUT_PATH}\/#{'.+\\'+EXTENSION_EXECUTABLE}$/) do |bin_file|
28
+
29
+ lib_args = ((defined? LIBRARIES_SYSTEM) ? LIBRARIES_SYSTEM : [])
30
+ lib_args.map! {|v| LIBRARIES_FLAG.gsub(/\$\{1\}/, v) } if (defined? LIBRARIES_FLAG)
31
+
28
32
  @ceedling[:generator].generate_executable_file(
29
33
  TOOLS_TEST_LINKER,
30
34
  TEST_SYM,
31
35
  bin_file.prerequisites,
32
36
  bin_file.name,
33
- @ceedling[:file_path_utils].form_test_build_map_filepath( bin_file.name ) )
37
+ @ceedling[:file_path_utils].form_test_build_map_filepath( bin_file.name ),
38
+ lib_args )
34
39
  end
35
40
 
36
41
 
@@ -24,6 +24,7 @@ class Setupinator
24
24
  @ceedling[:configurator].populate_unity_defaults( config_hash )
25
25
  @ceedling[:configurator].populate_cmock_defaults( config_hash )
26
26
  @ceedling[:configurator].find_and_merge_plugins( config_hash )
27
+ @ceedling[:configurator].merge_imports( config_hash )
27
28
  @ceedling[:configurator].tools_setup( config_hash )
28
29
  @ceedling[:configurator].eval_environment_variables( config_hash )
29
30
  @ceedling[:configurator].eval_paths( config_hash )
@@ -92,6 +92,9 @@ namespace :options do
92
92
  # @ceedling[:setupinator].reset_defaults( @ceedling[:setupinator].config_hash )
93
93
  hash = @ceedling[:project_config_manager].merge_options( @ceedling[:setupinator].config_hash, option_path )
94
94
  @ceedling[:setupinator].do_setup( hash )
95
+ if @ceedling[:configurator].project_release_build
96
+ load(File.join(CEEDLING_LIB, 'ceedling', 'rules_release.rake'))
97
+ end
95
98
  end
96
99
  end
97
100
 
@@ -18,6 +18,9 @@ CLOBBER.include(File.join(PROJECT_BUILD_RELEASE_ROOT, '**/*'))
18
18
  CLOBBER.include(File.join(PROJECT_LOG_PATH, '**/*'))
19
19
  CLOBBER.include(File.join(PROJECT_TEMP_PATH, '**/*'))
20
20
 
21
+ # just in case they're using git, let's make sure we allow them to preserved the build directory if desired.
22
+ CLOBBER.exclude(File.join(TESTS_BASE_PATH), '**/.gitkeep')
23
+
21
24
  # because of cmock config, mock path can optionally exist apart from standard test build paths
22
25
  CLOBBER.include(File.join(CMOCK_MOCK_PATH, '*'))
23
26
 
@@ -49,35 +52,35 @@ task(:directories => PROJECT_BUILD_PATHS) { @ceedling[:dependinator].touch_force
49
52
 
50
53
  # list paths discovered at load time
51
54
  namespace :paths do
52
-
55
+
53
56
  paths = @ceedling[:setupinator].config_hash[:paths]
54
57
  paths.each_key do |section|
55
58
  name = section.to_s.downcase
56
59
  path_list = Object.const_get("COLLECTION_PATHS_#{name.upcase}")
57
-
60
+
58
61
  if (path_list.size != 0)
59
62
  desc "List all collected #{name} paths."
60
63
  task(name.to_sym) { puts "#{name} paths:"; path_list.sort.each {|path| puts " - #{path}" } }
61
64
  end
62
65
  end
63
-
66
+
64
67
  end
65
68
 
66
69
 
67
70
  # list files & file counts discovered at load time
68
71
  namespace :files do
69
-
72
+
70
73
  categories = [
71
74
  ['test', COLLECTION_ALL_TESTS],
72
75
  ['source', COLLECTION_ALL_SOURCE],
73
76
  ['header', COLLECTION_ALL_HEADERS]
74
77
  ]
75
78
  categories << ['assembly', COLLECTION_ALL_ASSEMBLY] if (RELEASE_BUILD_USE_ASSEMBLY)
76
-
79
+
77
80
  categories.each do |category|
78
81
  name = category[0]
79
82
  collection = category[1]
80
-
83
+
81
84
  desc "List all collected #{name} files."
82
85
  task(name.to_sym) do
83
86
  puts "#{name} files:"
@@ -85,7 +88,7 @@ namespace :files do
85
88
  puts "file count: #{collection.size}"
86
89
  end
87
90
  end
88
-
91
+
89
92
  end
90
93
 
91
94
 
@@ -19,7 +19,9 @@ task RELEASE_SYM => [:directories] do
19
19
  # if assembler use isn't enabled, COLLECTION_ALL_ASSEMBLY is empty array & nothing happens
20
20
  core_objects.concat( @ceedling[:release_invoker].setup_and_invoke_asm_objects( COLLECTION_ALL_ASSEMBLY ) )
21
21
 
22
- file( PROJECT_RELEASE_BUILD_TARGET => (core_objects + extra_objects) )
22
+ # if we're using libraries, we need to add those to our collection as well
23
+ library_objects = (defined? LIBRARIES_RELEASE && !LIBRARIES_RELEASE.empty?) ? LIBRARIES_RELEASE.flatten.compact : []
24
+ file( PROJECT_RELEASE_BUILD_TARGET => (core_objects + extra_objects + library_objects) )
23
25
  Rake::Task[PROJECT_RELEASE_BUILD_TARGET].invoke
24
26
  ensure
25
27
  @ceedling[:plugin_manager].post_release
@@ -3,7 +3,6 @@ class TestIncludesExtractor
3
3
 
4
4
  constructor :configurator, :yaml_wrapper, :file_wrapper
5
5
 
6
-
7
6
  def setup
8
7
  @includes = {}
9
8
  @mocks = {}
@@ -26,16 +25,16 @@ class TestIncludesExtractor
26
25
  return [] if @mocks[file_key].nil?
27
26
  return @mocks[file_key]
28
27
  end
29
-
28
+
30
29
  # includes with file extension
31
30
  def lookup_includes_list(file)
32
31
  file_key = form_file_key(file)
33
32
  return [] if (@includes[file_key]).nil?
34
33
  return @includes[file_key]
35
34
  end
36
-
35
+
37
36
  private #################################
38
-
37
+
39
38
  def form_file_key(filepath)
40
39
  return File.basename(filepath).to_sym
41
40
  end
@@ -43,21 +42,26 @@ class TestIncludesExtractor
43
42
  def extract_from_file(file)
44
43
  includes = []
45
44
  header_extension = @configurator.extension_header
46
-
45
+
47
46
  contents = @file_wrapper.read(file)
48
47
 
49
48
  # remove line comments
50
49
  contents = contents.gsub(/\/\/.*$/, '')
51
50
  # remove block comments
52
51
  contents = contents.gsub(/\/\*.*?\*\//m, '')
53
-
52
+
54
53
  contents.split("\n").each do |line|
55
54
  # look for include statement
56
55
  scan_results = line.scan(/#include\s+\"\s*(.+#{'\\'+header_extension})\s*\"/)
57
-
56
+
57
+ includes << scan_results[0][0] if (scan_results.size > 0)
58
+
59
+ # look for TEST_FILE statement
60
+ scan_results = line.scan(/TEST_FILE\(\s*\"\s*(.+\.\w+)\s*\"\s*\)/)
61
+
58
62
  includes << scan_results[0][0] if (scan_results.size > 0)
59
63
  end
60
-
64
+
61
65
  return includes.uniq
62
66
  end
63
67
 
@@ -66,16 +70,16 @@ class TestIncludesExtractor
66
70
  header_extension = @configurator.extension_header
67
71
  file_key = form_file_key(file)
68
72
  @mocks[file_key] = []
69
-
73
+
70
74
  # add includes to lookup hash
71
75
  @includes[file_key] = includes
72
-
73
- includes.each do |include_file|
76
+
77
+ includes.each do |include_file|
74
78
  # check if include is a mock
75
79
  scan_results = include_file.scan(/(#{mock_prefix}.+)#{'\\'+header_extension}/)
76
80
  # add mock to lookup hash
77
81
  @mocks[file_key] << scan_results[0][0] if (scan_results.size > 0)
78
82
  end
79
83
  end
80
-
84
+
81
85
  end
@@ -23,6 +23,37 @@ class TestInvoker
23
23
  @mocks = []
24
24
  end
25
25
 
26
+ def get_test_definition_str(test)
27
+ return "-D" + File.basename(test, File.extname(test)).upcase.sub(/@.*$/, "")
28
+ end
29
+
30
+ def get_tools_compilers
31
+ tools_compilers = Hash.new
32
+ tools_compilers["for unit test"] = TOOLS_TEST_COMPILER if defined? TOOLS_TEST_COMPILER
33
+ tools_compilers["for gcov"] = TOOLS_GCOV_COMPILER if defined? TOOLS_GCOV_COMPILER
34
+ return tools_compilers
35
+ end
36
+
37
+ def add_test_definition(test)
38
+ test_definition_str = get_test_definition_str(test)
39
+ get_tools_compilers.each do |tools_compiler_key, tools_compiler_value|
40
+ tools_compiler_value[:arguments].push("-D#{File.basename(test, ".*").strip.upcase.sub(/@.*$/, "")}")
41
+ @streaminator.stdout_puts("Add the definition value in the build option #{tools_compiler_value[:arguments][-1]} #{tools_compiler_key}", Verbosity::OBNOXIOUS)
42
+ end
43
+ end
44
+
45
+ def delete_test_definition(test)
46
+ test_definition_str = get_test_definition_str(test)
47
+ get_tools_compilers.each do |tools_compiler_key, tools_compiler_value|
48
+ num_options = tools_compiler_value[:arguments].size
49
+ @streaminator.stdout_puts("Delete the definition value in the build option #{tools_compiler_value[:arguments][-1]} #{tools_compiler_key}", Verbosity::OBNOXIOUS)
50
+ tools_compiler_value[:arguments].delete_if{|i| i == test_definition_str}
51
+ if num_options > tools_compiler_value[:arguments].size + 1
52
+ @streaminator.stderr_puts("WARNING: duplicated test definition.")
53
+ end
54
+ end
55
+ end
56
+
26
57
  def setup_and_invoke(tests, context=TEST_SYM, options={:force_run => true})
27
58
 
28
59
  @tests = tests
@@ -47,6 +78,11 @@ class TestInvoker
47
78
  results_pass = @file_path_utils.form_pass_results_filepath( test )
48
79
  results_fail = @file_path_utils.form_fail_results_filepath( test )
49
80
 
81
+ # add the definition value in the build option for the unit test
82
+ if @configurator.defines_use_test_definition
83
+ add_test_definition(test)
84
+ end
85
+
50
86
  # clean results files so we have a missing file with which to kick off rake's dependency rules
51
87
  @test_invoker_helper.clean_results( {:pass => results_pass, :fail => results_fail}, options )
52
88
 
@@ -69,6 +105,10 @@ class TestInvoker
69
105
  rescue => e
70
106
  @build_invoker_utils.process_exception( e, context )
71
107
  ensure
108
+ # delete the definition value in the build option for the unit test
109
+ if @configurator.defines_use_test_definition
110
+ delete_test_definition(test)
111
+ end
72
112
  @plugin_manager.post_test( test )
73
113
  end
74
114
 
@@ -2,14 +2,14 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.25.0"
5
+ GEM = "0.27.0"
6
6
  # @private
7
7
  CEEDLING = GEM
8
8
  # @private
9
9
  CEXCEPTION = "1.3.1"
10
10
  # @private
11
- CMOCK = "2.4.3"
11
+ CMOCK = "2.4.4"
12
12
  # @private
13
- UNITY = "2.4.0"
13
+ UNITY = "2.4.1"
14
14
  end
15
15
  end
@@ -2,7 +2,7 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.24.0"
5
+ GEM = "0.27.0"
6
6
  # @private
7
7
  CEEDLING = "<%= versions["CEEDLING"] %>"
8
8
  # @private
@@ -46,7 +46,7 @@ class CommandHooks < Plugin
46
46
 
47
47
  private
48
48
 
49
- def run_hook_step(hook, name)
49
+ def run_hook_step(hook, name="")
50
50
  if (hook[:executable])
51
51
  cmd = @ceedling[:tool_executor].build_command_line( hook, [], name )
52
52
  shell_result = @ceedling[:tool_executor].exec( cmd[:line], cmd[:options] )
@@ -9,5 +9,6 @@ void bar_print_message_formatted(const char * format, ...);
9
9
  void bar_numbers(int one, int two, char three);
10
10
  void bar_const_test(const char * a, char * const b, const int c);
11
11
  custom_t bar_needs_custom_type(void);
12
+ const char * bar_return_const_ptr(int one);
12
13
 
13
14
  #endif // bar_H
@@ -5,6 +5,7 @@
5
5
  */
6
6
 
7
7
  #include <stdio.h>
8
+ #include <string.h>
8
9
  #include "event_processor.h"
9
10
  #include "display.h"
10
11
 
@@ -119,6 +119,10 @@ class FffMockGenerator
119
119
  parsed_header[:functions].each do |function|
120
120
  name = function[:name]
121
121
  return_type = function[:return][:type]
122
+ if function.has_key? :modifier
123
+ # Prepend any modifier. If there isn't one, trim any leading whitespace.
124
+ return_type = "#{function[:modifier]} #{return_type}".lstrip
125
+ end
122
126
  arg_count = function[:args].size
123
127
 
124
128
  # Check for variable arguments.
@@ -1,6 +1,8 @@
1
1
  require 'stringio'
2
2
  require 'fff_mock_generator.rb'
3
+ require 'header_generator.rb'
3
4
 
5
+ # Test the contents of the .h file created for the mock.
4
6
  describe "FffMockGenerator.create_mock_header" do
5
7
 
6
8
  context "when there is nothing to mock," do
@@ -235,230 +237,68 @@ describe "FffMockGenerator.create_mock_header" do
235
237
  end
236
238
  end
237
239
 
238
- context "when there are pre-includes" do
239
- let(:mock_header) {
240
- parsed_header = {}
241
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header,
242
- [%{"another_header.h"}])
243
- }
244
- it "then they are included before the other files" do
245
- expect(mock_header).to include(
246
- %{#include "another_header.h"\n} +
247
- %{#include "fff.h"}
248
- )
249
- end
250
- end
251
-
252
- context "when there are post-includes" do
253
- let(:mock_header) {
254
- parsed_header = {}
255
- FffMockGenerator.create_mock_header("display", "mock_display", parsed_header,
256
- nil, [%{"another_header.h"}])
257
- }
258
- it "then they are included after the other files" do
259
- expect(mock_header).to include(
260
- %{#include "display.h"\n} +
261
- %{#include "another_header.h"\n}
262
- )
263
- end
264
- end
265
-
266
- end
267
-
268
- describe "FffMockGenerator.create_mock_source" do
269
-
270
- context "when there is nothing to mock," do
271
- let(:mock_source) {
272
- parsed_header = {}
273
- FffMockGenerator.create_mock_source("mock_my_module", parsed_header)
274
- }
275
- it "then the generated file includes the fff header" do
276
- expect(mock_source).to include(
277
- # fff.h also requires including string.h
278
- %{#include <string.h>\n} +
279
- %{#include "fff.h"}
280
- )
281
- end
282
- it "then the generated file includes the mock header" do
283
- expect(mock_source).to include(
284
- %{#include "mock_my_module.h"\n}
285
- )
286
- end
287
- it "then the generated file defines the init function" do
288
- expect(mock_source).to include(
289
- "void mock_my_module_Init(void)\n" +
290
- "{\n" +
291
- " FFF_RESET_HISTORY();\n" +
292
- "}"
293
- )
294
- end
295
- it "then the generated file defines the verify function" do
296
- expect(mock_source).to include(
297
- "void mock_my_module_Verify(void)\n" +
298
- "{\n" +
299
- "}"
300
- )
301
- end
302
- it "then the generated file defines the destroy function" do
303
- expect(mock_source).to include(
304
- "void mock_my_module_Destroy(void)\n" +
305
- "{\n" +
306
- "}"
307
- )
308
- end
309
- end
310
-
311
- context "when there are multiple functions," do
312
- let(:mock_source) {
313
- parsed_header = create_cmock_style_parsed_header(
314
- [ {:name => 'a_function', :return_type => 'int', :args => ['char *']},
315
- {:name => 'another_function', :return_type => 'void'},
316
- {:name => 'three', :return_type => 'bool', :args => ['float', 'int']}
317
- ])
318
- FffMockGenerator.create_mock_source("mock_display", parsed_header)
319
- }
320
- it "then the generated file contains the first fake function definition" do
321
- expect(mock_source).to include(
322
- "DEFINE_FAKE_VALUE_FUNC1(int, a_function, char *);"
323
- )
324
- end
325
- it "then the generated file contains the second fake function definition" do
326
- expect(mock_source).to include(
327
- "DEFINE_FAKE_VOID_FUNC0(another_function);"
328
- )
329
- end
330
- it "then the generated file contains the third fake function definition" do
331
- expect(mock_source).to include(
332
- "DEFINE_FAKE_VALUE_FUNC2(bool, three, float, int);"
333
- )
334
- end
335
- it "then the init function resets all of the fakes" do
336
- expect(mock_source).to include(
337
- "void mock_display_Init(void)\n" +
338
- "{\n" +
339
- " FFF_RESET_HISTORY();\n" +
340
- " RESET_FAKE(a_function)\n" +
341
- " RESET_FAKE(another_function)\n" +
342
- " RESET_FAKE(three)\n" +
343
- "}"
344
- )
345
- end
346
- end
347
-
348
- context "when there is a void function with variable arguments and " +
349
- "additional arguments" do
350
- let(:mock_source){
240
+ context "when there is a function that returns a const pointer" do
241
+ let(:mock_header){
351
242
  parsed_header = {}
352
243
  parsed_header[:functions] = [{
353
- :name => "function_with_var_args",
354
- :return => {:type => "void"},
355
- :var_arg => "...",
356
- :args => [{:type => 'char *'}, {:type => 'int'}]
244
+ :name => "return_const_pointer_test_function",
245
+ :modifier => "const",
246
+ :return => {:type => "char *" },
247
+ :args => [{:type => "int", :name => "a"}]
357
248
  }]
358
- FffMockGenerator.create_mock_source("mock_display", parsed_header)
249
+ FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
359
250
  }
360
- it "then the generated file contains the vararg definition" do
361
- expect(mock_source).to include(
362
- "DEFINE_FAKE_VOID_FUNC3_VARARG(function_with_var_args, char *, int, ...)"
251
+ it "then the generated file contains the correct const return value in the declaration" do
252
+ expect(mock_header).to include(
253
+ "DECLARE_FAKE_VALUE_FUNC1(const char *, return_const_pointer_test_function, int)"
363
254
  )
364
255
  end
365
256
  end
366
-
367
- context "when there is a function with a pointer to a const value" do
368
- let(:mock_source){
257
+
258
+ context "when there is a function that returns a const int" do
259
+ let(:mock_header){
369
260
  parsed_header = {}
370
261
  parsed_header[:functions] = [{
371
- :name => "const_test_function",
372
- :return => {:type => "void"},
373
- :args => [{:type => "char *", :name => "a", :ptr? => false, :const? => true},
374
- {:type => "char *", :name => "b", :ptr? => false, :const? => false}]
262
+ :name => "return_const_int_test_function",
263
+ :modifier => "const",
264
+ :return => {:type => "int" },
265
+ :args => []
375
266
  }]
376
- FffMockGenerator.create_mock_source("mock_display", parsed_header)
267
+ FffMockGenerator.create_mock_header("display", "mock_display", parsed_header)
377
268
  }
378
- it "then the generated file contains the correct const argument in the declaration" do
379
- expect(mock_source).to include(
380
- "DEFINE_FAKE_VOID_FUNC2(const_test_function, const char *, char *)"
269
+ it "then the generated file contains the correct const return value in the declaration" do
270
+ expect(mock_header).to include(
271
+ "DECLARE_FAKE_VALUE_FUNC0(const int, return_const_int_test_function)"
381
272
  )
382
273
  end
383
274
  end
384
275
 
385
276
  context "when there are pre-includes" do
386
- let(:mock_source) {
387
- parsed_source = {}
388
- FffMockGenerator.create_mock_source("mock_display", parsed_source,
277
+ let(:mock_header) {
278
+ parsed_header = {}
279
+ FffMockGenerator.create_mock_header("display", "mock_display", parsed_header,
389
280
  [%{"another_header.h"}])
390
281
  }
391
282
  it "then they are included before the other files" do
392
- expect(mock_source).to include(
283
+ expect(mock_header).to include(
393
284
  %{#include "another_header.h"\n} +
394
- %{#include <string.h>}
285
+ %{#include "fff.h"}
395
286
  )
396
287
  end
397
288
  end
398
289
 
399
290
  context "when there are post-includes" do
400
- let(:mock_source) {
401
- parsed_source = {}
402
- FffMockGenerator.create_mock_source("mock_display", parsed_source,
291
+ let(:mock_header) {
292
+ parsed_header = {}
293
+ FffMockGenerator.create_mock_header("display", "mock_display", parsed_header,
403
294
  nil, [%{"another_header.h"}])
404
295
  }
405
- it "then they are included before the other files" do
406
- expect(mock_source).to include(
407
- %{#include "mock_display.h"\n} +
296
+ it "then they are included after the other files" do
297
+ expect(mock_header).to include(
298
+ %{#include "display.h"\n} +
408
299
  %{#include "another_header.h"\n}
409
300
  )
410
301
  end
411
302
  end
412
- end
413
-
414
- # Create a CMock-style parsed header hash. This the type of hash created by
415
- # CMock when parsing header files for automock generation. It contains all of
416
- # includes, typedefs and functions (with return types and arguments) parsed from
417
- # the header file.
418
- def create_cmock_style_parsed_header(functions, typedefs = nil)
419
- parsed_header = {
420
- :includes => nil,
421
- :functions => [],
422
- :typedefs => []
423
- }
424
303
 
425
- # Add the typedefs.
426
- if typedefs
427
- typedefs.each do |typedef|
428
- parsed_header[:typedefs] << typedef
429
- end
430
- end
431
-
432
- # Add the functions.
433
- if functions
434
- functions.each do |function|
435
- # Build the array of arguments.
436
- args = []
437
- if function.key?(:args)
438
- function[:args].each do |arg|
439
- args << {
440
- :type => arg
441
- }
442
- end
443
- end
444
- parsed_header[:functions] << {
445
- :name => function[:name],
446
- :modifier => "",
447
- :return => {
448
- :type => function[:return_type],
449
- :name => "cmock_to_return",
450
- :ptr? => false,
451
- :const? => false,
452
- :str => "void cmock_to_return",
453
- :void? => true
454
- },
455
- :var_arg => nil,
456
- :args_string => "void",
457
- :args => args,
458
- :args_call => "",
459
- :contains_ptr? => false
460
- }
461
- end
462
- end
463
- parsed_header
464
304
  end