ceedling 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -0,0 +1,149 @@
1
+ require 'stringio'
2
+ require 'fff_mock_generator.rb'
3
+
4
+ # Test the contents of the .c file created for the mock.
5
+ describe "FffMockGenerator.create_mock_source" do
6
+
7
+ context "when there is nothing to mock," do
8
+ let(:mock_source) {
9
+ parsed_header = {}
10
+ FffMockGenerator.create_mock_source("mock_my_module", parsed_header)
11
+ }
12
+ it "then the generated file includes the fff header" do
13
+ expect(mock_source).to include(
14
+ # fff.h also requires including string.h
15
+ %{#include <string.h>\n} +
16
+ %{#include "fff.h"}
17
+ )
18
+ end
19
+ it "then the generated file includes the mock header" do
20
+ expect(mock_source).to include(
21
+ %{#include "mock_my_module.h"\n}
22
+ )
23
+ end
24
+ it "then the generated file defines the init function" do
25
+ expect(mock_source).to include(
26
+ "void mock_my_module_Init(void)\n" +
27
+ "{\n" +
28
+ " FFF_RESET_HISTORY();\n" +
29
+ "}"
30
+ )
31
+ end
32
+ it "then the generated file defines the verify function" do
33
+ expect(mock_source).to include(
34
+ "void mock_my_module_Verify(void)\n" +
35
+ "{\n" +
36
+ "}"
37
+ )
38
+ end
39
+ it "then the generated file defines the destroy function" do
40
+ expect(mock_source).to include(
41
+ "void mock_my_module_Destroy(void)\n" +
42
+ "{\n" +
43
+ "}"
44
+ )
45
+ end
46
+ end
47
+
48
+ context "when there are multiple functions," do
49
+ let(:mock_source) {
50
+ parsed_header = create_cmock_style_parsed_header(
51
+ [ {:name => 'a_function', :return_type => 'int', :args => ['char *']},
52
+ {:name => 'another_function', :return_type => 'void'},
53
+ {:name => 'three', :return_type => 'bool', :args => ['float', 'int']}
54
+ ])
55
+ FffMockGenerator.create_mock_source("mock_display", parsed_header)
56
+ }
57
+ it "then the generated file contains the first fake function definition" do
58
+ expect(mock_source).to include(
59
+ "DEFINE_FAKE_VALUE_FUNC1(int, a_function, char *);"
60
+ )
61
+ end
62
+ it "then the generated file contains the second fake function definition" do
63
+ expect(mock_source).to include(
64
+ "DEFINE_FAKE_VOID_FUNC0(another_function);"
65
+ )
66
+ end
67
+ it "then the generated file contains the third fake function definition" do
68
+ expect(mock_source).to include(
69
+ "DEFINE_FAKE_VALUE_FUNC2(bool, three, float, int);"
70
+ )
71
+ end
72
+ it "then the init function resets all of the fakes" do
73
+ expect(mock_source).to include(
74
+ "void mock_display_Init(void)\n" +
75
+ "{\n" +
76
+ " FFF_RESET_HISTORY();\n" +
77
+ " RESET_FAKE(a_function)\n" +
78
+ " RESET_FAKE(another_function)\n" +
79
+ " RESET_FAKE(three)\n" +
80
+ "}"
81
+ )
82
+ end
83
+ end
84
+
85
+ context "when there is a void function with variable arguments and " +
86
+ "additional arguments" do
87
+ let(:mock_source){
88
+ parsed_header = {}
89
+ parsed_header[:functions] = [{
90
+ :name => "function_with_var_args",
91
+ :return => {:type => "void"},
92
+ :var_arg => "...",
93
+ :args => [{:type => 'char *'}, {:type => 'int'}]
94
+ }]
95
+ FffMockGenerator.create_mock_source("mock_display", parsed_header)
96
+ }
97
+ it "then the generated file contains the vararg definition" do
98
+ expect(mock_source).to include(
99
+ "DEFINE_FAKE_VOID_FUNC3_VARARG(function_with_var_args, char *, int, ...)"
100
+ )
101
+ end
102
+ end
103
+
104
+ context "when there is a function with a pointer to a const value" do
105
+ let(:mock_source){
106
+ parsed_header = {}
107
+ parsed_header[:functions] = [{
108
+ :name => "const_test_function",
109
+ :return => {:type => "void"},
110
+ :args => [{:type => "char *", :name => "a", :ptr? => false, :const? => true},
111
+ {:type => "char *", :name => "b", :ptr? => false, :const? => false}]
112
+ }]
113
+ FffMockGenerator.create_mock_source("mock_display", parsed_header)
114
+ }
115
+ it "then the generated file contains the correct const argument in the declaration" do
116
+ expect(mock_source).to include(
117
+ "DEFINE_FAKE_VOID_FUNC2(const_test_function, const char *, char *)"
118
+ )
119
+ end
120
+ end
121
+
122
+ context "when there are pre-includes" do
123
+ let(:mock_source) {
124
+ parsed_source = {}
125
+ FffMockGenerator.create_mock_source("mock_display", parsed_source,
126
+ [%{"another_header.h"}])
127
+ }
128
+ it "then they are included before the other files" do
129
+ expect(mock_source).to include(
130
+ %{#include "another_header.h"\n} +
131
+ %{#include <string.h>}
132
+ )
133
+ end
134
+ end
135
+
136
+ context "when there are post-includes" do
137
+ let(:mock_source) {
138
+ parsed_source = {}
139
+ FffMockGenerator.create_mock_source("mock_display", parsed_source,
140
+ nil, [%{"another_header.h"}])
141
+ }
142
+ it "then they are included before the other files" do
143
+ expect(mock_source).to include(
144
+ %{#include "mock_display.h"\n} +
145
+ %{#include "another_header.h"\n}
146
+ )
147
+ end
148
+ end
149
+ end
@@ -0,0 +1,51 @@
1
+ # Create a CMock-style parsed header hash. This the type of hash created by
2
+ # CMock when parsing header files for automock generation. It contains all of
3
+ # includes, typedefs and functions (with return types and arguments) parsed from
4
+ # the header file.
5
+ def create_cmock_style_parsed_header(functions, typedefs = nil)
6
+ parsed_header = {
7
+ :includes => nil,
8
+ :functions => [],
9
+ :typedefs => []
10
+ }
11
+
12
+ # Add the typedefs.
13
+ if typedefs
14
+ typedefs.each do |typedef|
15
+ parsed_header[:typedefs] << typedef
16
+ end
17
+ end
18
+
19
+ # Add the functions.
20
+ if functions
21
+ functions.each do |function|
22
+ # Build the array of arguments.
23
+ args = []
24
+ if function.key?(:args)
25
+ function[:args].each do |arg|
26
+ args << {
27
+ :type => arg
28
+ }
29
+ end
30
+ end
31
+ parsed_header[:functions] << {
32
+ :name => function[:name],
33
+ :modifier => "",
34
+ :return => {
35
+ :type => function[:return_type],
36
+ :name => "cmock_to_return",
37
+ :ptr? => false,
38
+ :const? => false,
39
+ :str => "void cmock_to_return",
40
+ :void? => true
41
+ },
42
+ :var_arg => nil,
43
+ :args_string => "void",
44
+ :args => args,
45
+ :args_call => "",
46
+ :contains_ptr? => false
47
+ }
48
+ end
49
+ end
50
+ parsed_header
51
+ end
@@ -0,0 +1,115 @@
1
+ require 'ceedling/plugin'
2
+ require 'ceedling/constants'
3
+ require 'pp'
4
+
5
+ class JunitTestsReport < Plugin
6
+
7
+ def setup
8
+ @results_list = {}
9
+ @test_counter = 0
10
+ end
11
+
12
+ def post_test_fixture_execute(arg_hash)
13
+ context = arg_hash[:context]
14
+
15
+ @results_list[context] = [] if (@results_list[context].nil?)
16
+
17
+ @results_list[context] << arg_hash[:result_file]
18
+ end
19
+
20
+ def post_build
21
+ @results_list.each_key do |context|
22
+ results = @ceedling[:plugin_reportinator].assemble_test_results(@results_list[context])
23
+
24
+ file_path = File.join( PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s, 'report.xml' )
25
+
26
+ @ceedling[:file_wrapper].open( file_path, 'w' ) do |f|
27
+ @testsuite_counter = 0
28
+ @testcase_counter = 0
29
+ suites = reorganise_results( results )
30
+
31
+ write_header( results, f )
32
+ suites.each{|suite| write_suite( suite, f ) }
33
+ write_footer( f )
34
+ end
35
+ end
36
+ end
37
+
38
+ private
39
+
40
+ def write_header( results, stream )
41
+ stream.puts '<?xml version="1.0" encoding="utf-8" ?>'
42
+ stream.puts('<testsuites tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d">' % results[:counts])
43
+ end
44
+
45
+ def write_footer( stream )
46
+ stream.puts '</testsuites>'
47
+ end
48
+
49
+ def reorganise_results( results )
50
+ # Reorganise the output by test suite instead of by result
51
+ suites = Hash.new{ |h,k| h[k] = {collection: [], total: 0, success: 0, failed: 0, ignored: 0, stdout: []} }
52
+ results[:successes].each do |result|
53
+ source = result[:source]
54
+ name = source[:file].sub(/\..{1,4}$/, "")
55
+ suites[name][:collection] += result[:collection].map{|test| test.merge(result: :success)}
56
+ suites[name][:total] += result[:collection].length
57
+ suites[name][:success] += result[:collection].length
58
+ end
59
+ results[:failures].each do |result|
60
+ source = result[:source]
61
+ name = source[:file].sub(/\..{1,4}$/, "")
62
+ suites[name][:collection] += result[:collection].map{|test| test.merge(result: :failed)}
63
+ suites[name][:total] += result[:collection].length
64
+ suites[name][:failed] += result[:collection].length
65
+ end
66
+ results[:ignores].each do |result|
67
+ source = result[:source]
68
+ name = source[:file].sub(/\..{1,4}$/, "")
69
+ suites[name][:collection] += result[:collection].map{|test| test.merge(result: :ignored)}
70
+ suites[name][:total] += result[:collection].length
71
+ suites[name][:ignored] += result[:collection].length
72
+ end
73
+ results[:stdout].each do |result|
74
+ source = result[:source]
75
+ name = source[:file].sub(/\..{1,4}$/, "")
76
+ suites[name][:stdout] += result[:collection]
77
+ end
78
+ suites.map{|name, data| data.merge(name: name) }
79
+ end
80
+
81
+ def write_suite( suite, stream )
82
+ stream.puts(' <testsuite name="%<name>s" tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d">' % suite)
83
+
84
+ suite[:collection].each do |test|
85
+ write_test( test, stream )
86
+ end
87
+
88
+ unless suite[:stdout].empty?
89
+ stream.puts(' <system-out>')
90
+ suite[:stdout].each{|line| stream.puts line }
91
+ stream.puts(' </system-out>')
92
+ end
93
+
94
+ stream.puts(' </testsuite>')
95
+ end
96
+
97
+ def write_test( test, stream )
98
+ case test[:result]
99
+ when :success
100
+ stream.puts(' <testcase name="%<test>s" />' % test)
101
+ when :failed
102
+ stream.puts(' <testcase name="%<test>s">' % test)
103
+ if test[:message].empty?
104
+ stream.puts(' <failure />')
105
+ else
106
+ stream.puts(' <failure message="%s" />' % test[:message])
107
+ end
108
+ stream.puts(' </testcase>')
109
+ when :ignored
110
+ stream.puts(' <testcase name="%<test>s">' % test)
111
+ stream.puts(' <skipped />')
112
+ stream.puts(' </testcase>')
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,63 @@
1
+ ceedling-subprojects
2
+ ====================
3
+
4
+ Plugin for supporting subprojects that are built as static libraries. It continues to support
5
+ dependency tracking, without getting confused between your main project files and your
6
+ subproject files. It accepts different compiler flags and linker flags, allowing you to
7
+ optimize for your situation.
8
+
9
+ First, you're going to want to add the extension to your list of known extensions:
10
+
11
+ ```
12
+ :extension:
13
+ :subprojects: '.a'
14
+ ```
15
+
16
+ Define a new section called :subprojects. There, you can list as many subprojects
17
+ as you may need under the :paths key. For each, you specify a unique place to build
18
+ and a unique name.
19
+
20
+ ```
21
+ :subprojects:
22
+ :paths:
23
+ - :name: libprojectA
24
+ :source:
25
+ - ./subprojectA/first/dir
26
+ - ./subprojectA/second/dir
27
+ :include:
28
+ - ./subprojectA/include/dir
29
+ :build_root: ./subprojectA/build/dir
30
+ :defines:
31
+ - DEFINE_JUST_FOR_THIS_FILE
32
+ - AND_ANOTHER
33
+ - :name: libprojectB
34
+ :source:
35
+ - ./subprojectB/only/dir
36
+ :include:
37
+ - ./subprojectB/first/include/dir
38
+ - ./subprojectB/second/include/dir
39
+ :build_root: ./subprojectB/build/dir
40
+ :defines: [] #none for this one
41
+ ```
42
+
43
+ You can specify the compiler and linker, just as you would a release build:
44
+
45
+ ```
46
+ :tools:
47
+ :subprojects_compiler:
48
+ :executable: gcc
49
+ :arguments:
50
+ - -g
51
+ - -I"$": COLLECTION_PATHS_SUBPROJECTS
52
+ - -D$: COLLECTION_DEFINES_SUBPROJECTS
53
+ - -c "${1}"
54
+ - -o "${2}"
55
+ :subprojects_linker:
56
+ :executable: ar
57
+ :arguments:
58
+ - rcs
59
+ - ${2}
60
+ - ${1}
61
+ ```
62
+
63
+ That's all there is to it! Happy Hacking!
@@ -0,0 +1,33 @@
1
+ ---
2
+ #:extension:
3
+ # :subprojects: '.a'
4
+
5
+ :subprojects:
6
+ :paths: []
7
+ # - :name: subprojectA
8
+ # :source:
9
+ # - ./first/subproject/dir
10
+ # - ./second/subproject/dir
11
+ # :include:
12
+ # - ./first/include/dir
13
+ # :build_root: ./subproject/build/dir
14
+ # :defines:
15
+ # - FIRST_DEFINE
16
+
17
+ :tools:
18
+ :subprojects_compiler:
19
+ :executable: gcc
20
+ :arguments:
21
+ - -g
22
+ - -I"$": COLLECTION_PATHS_SUBPROJECTS
23
+ - -D$: COLLECTION_DEFINES_SUBPROJECTS
24
+ - -c "${1}"
25
+ - -o "${2}"
26
+ :subprojects_linker:
27
+ :executable: ar
28
+ :arguments:
29
+ - rcs
30
+ - ${2}
31
+ - ${1}
32
+
33
+ ...
@@ -0,0 +1,92 @@
1
+ require 'ceedling/plugin'
2
+ require 'ceedling/constants'
3
+
4
+ SUBPROJECTS_ROOT_NAME = 'subprojects'
5
+ SUBPROJECTS_TASK_ROOT = SUBPROJECTS_ROOT_NAME + ':'
6
+ SUBPROJECTS_SYM = SUBPROJECTS_ROOT_NAME.to_sym
7
+
8
+ class Subprojects < Plugin
9
+
10
+ def setup
11
+ @plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
12
+
13
+ # Add to the test paths
14
+ SUBPROJECTS_PATHS.each do |subproj|
15
+ subproj[:source].each do |path|
16
+ COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << path
17
+ end
18
+ subproj[:include].each do |path|
19
+ COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR << path
20
+ end
21
+ end
22
+
23
+ #gather information about the subprojects
24
+ @subprojects = {}
25
+ @subproject_lookup_by_path = {}
26
+ SUBPROJECTS_PATHS.each do |subproj|
27
+ @subprojects[ subproj[:name] ] = subproj.clone
28
+ @subprojects[ subproj[:name] ][:c] = []
29
+ @subprojects[ subproj[:name] ][:asm] = []
30
+ subproj[:source].each do |path|
31
+ search_path = "#{path[-1].match(/\\|\//) ? path : "#{path}/"}*#{EXTENSION_SOURCE}"
32
+ @subprojects[ subproj[:name] ][:c] += Dir[search_path]
33
+ if (EXTENSION_ASSEMBLY && !EXTENSION_ASSEMBLY.empty?)
34
+ search_path = "#{path[-1].match(/\\|\//) ? path : "#{path}/"}*#{EXTENSION_ASSEMBLY}"
35
+ @subprojects[ subproj[:name] ][:asm] += Dir[search_path]
36
+ end
37
+ end
38
+ @subproject_lookup_by_path[ subproj[:build_root] ] = subproj[:name]
39
+ end
40
+ end
41
+
42
+ def find_my_project( c_file, file_type = :c )
43
+ @subprojects.each_pair do |subprojname, subproj|
44
+ return subprojname if (subproj[file_type].include?(c_file))
45
+ end
46
+ end
47
+
48
+ def find_my_paths( c_file, file_type = :c )
49
+ @subprojects.each_pair do |subprojname, subproj|
50
+ return (subproj[:source] + (subproj[:include] || [])) if (subproj[file_type].include?(c_file))
51
+ end
52
+ return []
53
+ end
54
+
55
+ def find_my_defines( c_file, file_type = :c )
56
+ @subprojects.each_pair do |subprojname, subproj|
57
+ return (subproj[:defines] || []) if (subproj[file_type].include?(c_file))
58
+ end
59
+ return []
60
+ end
61
+
62
+ def list_all_object_files_for_subproject( lib_name )
63
+ subproj = File.basename(lib_name, EXTENSION_SUBPROJECTS)
64
+ objpath = "#{@subprojects[subproj][:build_root]}/out/c"
65
+ bbb = @subprojects[subproj][:c].map{|f| "#{objpath}/#{File.basename(f,EXTENSION_SOURCE)}#{EXTENSION_OBJECT}" }
66
+ bbb
67
+ end
68
+
69
+ def find_library_source_file_for_object( obj_name )
70
+ cname = "#{File.basename(obj_name, EXTENSION_OBJECT)}#{EXTENSION_SOURCE}"
71
+ dname = File.dirname(obj_name)[0..-7]
72
+ pname = @subproject_lookup_by_path[dname]
73
+ return @ceedling[:file_finder].find_file_from_list(cname, @subprojects[pname][:c], :error)
74
+ end
75
+
76
+ def find_library_assembly_file_for_object( obj_name )
77
+ cname = "#{File.basename(obj_name, EXTENSION_OBJECT)}#{EXTENSION_ASEMBLY}"
78
+ dname = File.dirname(obj_name)[0..-7]
79
+ pname = @subproject_lookup_by_path[dname]
80
+ return @ceedling[:file_finder].find_file_from_list(cname, @subprojects[pname][:asm], :error)
81
+ end
82
+
83
+ def replace_constant(constant, new_value)
84
+ Object.send(:remove_const, constant.to_sym) if (Object.const_defined? constant)
85
+ Object.const_set(constant, new_value)
86
+ end
87
+
88
+ end
89
+
90
+ # end blocks always executed following rake run
91
+ END {
92
+ }