ceedling 0.19.0 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (426) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +10 -10
  3. data/bin/ceedling +205 -92
  4. data/ceedling-0.19.0.gem +0 -0
  5. data/config/test_environment.rb +12 -12
  6. data/docs/CeedlingPacket.md +866 -853
  7. data/docs/CeedlingPacket.odt +0 -0
  8. data/docs/CeedlingPacket.pdf +0 -0
  9. data/examples/temp_sensor/rakefile.rb +4 -4
  10. data/examples/temp_sensor/src/AdcConductor.c +42 -42
  11. data/examples/temp_sensor/src/AdcConductor.h +13 -13
  12. data/examples/temp_sensor/src/AdcHardware.c +27 -27
  13. data/examples/temp_sensor/src/AdcHardware.h +11 -11
  14. data/examples/temp_sensor/src/AdcHardwareConfigurator.c +18 -18
  15. data/examples/temp_sensor/src/AdcHardwareConfigurator.h +10 -10
  16. data/examples/temp_sensor/src/AdcModel.c +33 -33
  17. data/examples/temp_sensor/src/AdcModel.h +13 -13
  18. data/examples/temp_sensor/src/AdcTemperatureSensor.c +51 -51
  19. data/examples/temp_sensor/src/AdcTemperatureSensor.h +10 -10
  20. data/examples/temp_sensor/src/Executor.c +25 -25
  21. data/examples/temp_sensor/src/Executor.h +9 -9
  22. data/examples/temp_sensor/src/IntrinsicsWrapper.c +18 -18
  23. data/examples/temp_sensor/src/IntrinsicsWrapper.h +7 -7
  24. data/examples/temp_sensor/src/Main.c +46 -46
  25. data/examples/temp_sensor/src/Main.h +7 -7
  26. data/examples/temp_sensor/src/Model.c +10 -10
  27. data/examples/temp_sensor/src/Model.h +8 -8
  28. data/examples/temp_sensor/src/ModelConfig.h +7 -7
  29. data/examples/temp_sensor/src/TaskScheduler.c +72 -72
  30. data/examples/temp_sensor/src/TaskScheduler.h +11 -11
  31. data/examples/temp_sensor/src/TemperatureCalculator.c +27 -27
  32. data/examples/temp_sensor/src/TemperatureCalculator.h +8 -8
  33. data/examples/temp_sensor/src/TemperatureFilter.c +38 -38
  34. data/examples/temp_sensor/src/TemperatureFilter.h +10 -10
  35. data/examples/temp_sensor/src/TimerConductor.c +15 -15
  36. data/examples/temp_sensor/src/TimerConductor.h +9 -9
  37. data/examples/temp_sensor/src/TimerConfigurator.c +51 -51
  38. data/examples/temp_sensor/src/TimerConfigurator.h +15 -15
  39. data/examples/temp_sensor/src/TimerHardware.c +15 -15
  40. data/examples/temp_sensor/src/TimerHardware.h +8 -8
  41. data/examples/temp_sensor/src/TimerInterruptConfigurator.c +55 -55
  42. data/examples/temp_sensor/src/TimerInterruptConfigurator.h +13 -13
  43. data/examples/temp_sensor/src/TimerInterruptHandler.c +25 -25
  44. data/examples/temp_sensor/src/TimerInterruptHandler.h +10 -10
  45. data/examples/temp_sensor/src/TimerModel.c +9 -9
  46. data/examples/temp_sensor/src/TimerModel.h +8 -8
  47. data/examples/temp_sensor/src/Types.h +90 -90
  48. data/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c +18 -18
  49. data/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h +8 -8
  50. data/examples/temp_sensor/src/UsartConductor.c +21 -21
  51. data/examples/temp_sensor/src/UsartConductor.h +7 -7
  52. data/examples/temp_sensor/src/UsartConfigurator.c +39 -39
  53. data/examples/temp_sensor/src/UsartConfigurator.h +13 -13
  54. data/examples/temp_sensor/src/UsartHardware.c +22 -22
  55. data/examples/temp_sensor/src/UsartHardware.h +9 -9
  56. data/examples/temp_sensor/src/UsartModel.c +34 -34
  57. data/examples/temp_sensor/src/UsartModel.h +10 -10
  58. data/examples/temp_sensor/src/UsartPutChar.c +16 -16
  59. data/examples/temp_sensor/src/UsartPutChar.h +8 -8
  60. data/examples/temp_sensor/src/UsartTransmitBufferStatus.c +7 -7
  61. data/examples/temp_sensor/src/UsartTransmitBufferStatus.h +8 -8
  62. data/examples/temp_sensor/test/TestAdcConductor.c +121 -121
  63. data/examples/temp_sensor/test/TestAdcHardware.c +44 -44
  64. data/examples/temp_sensor/test/TestAdcModel.c +33 -33
  65. data/examples/temp_sensor/test/TestExecutor.c +36 -36
  66. data/examples/temp_sensor/test/TestMain.c +24 -24
  67. data/examples/temp_sensor/test/TestModel.c +20 -20
  68. data/examples/temp_sensor/test/TestTaskScheduler.c +104 -104
  69. data/examples/temp_sensor/test/TestTemperatureCalculator.c +33 -33
  70. data/examples/temp_sensor/test/TestTemperatureFilter.c +79 -79
  71. data/examples/temp_sensor/test/TestTimerConductor.c +32 -32
  72. data/examples/temp_sensor/test/TestTimerHardware.c +26 -26
  73. data/examples/temp_sensor/test/TestTimerModel.c +18 -18
  74. data/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c +21 -21
  75. data/examples/temp_sensor/test/TestUsartConductor.c +40 -40
  76. data/examples/temp_sensor/test/TestUsartHardware.c +36 -36
  77. data/examples/temp_sensor/test/TestUsartModel.c +36 -36
  78. data/examples/temp_sensor/test/support/UnityHelper.c +12 -12
  79. data/examples/temp_sensor/test/support/UnityHelper.h +12 -12
  80. data/lib/ceedling/configurator_builder.rb +1 -1
  81. data/lib/ceedling/tasks_base.rake +10 -2
  82. data/lib/ceedling/tool_executor.rb +3 -0
  83. data/lib/ceedling/version.rb +3 -3
  84. data/license.txt +1 -1
  85. data/plugins/bullseye/bullseye.rake +162 -162
  86. data/plugins/gcov/gcov.rake +152 -152
  87. data/plugins/module_generator/lib/module_generator.rb +145 -145
  88. data/plugins/module_generator/module_generator.rake +14 -14
  89. data/plugins/stdout_gtestlike_tests_report/assets/template.erb +84 -0
  90. data/plugins/stdout_gtestlike_tests_report/assets/template.erb copy +59 -0
  91. data/plugins/stdout_gtestlike_tests_report/config/stdout_gtestlike_tests_report.yml +4 -0
  92. data/plugins/stdout_gtestlike_tests_report/lib/stdout_gtestlike_tests_report.rb +43 -0
  93. data/spec/system/deployment_spec.rb +0 -1
  94. data/test_graveyard/integration/paths_test.rb +80 -80
  95. data/test_graveyard/integration/rake_rules_aux_dependencies_test.rb +75 -75
  96. data/test_graveyard/integration/rake_rules_cmock_test.rb +74 -74
  97. data/test_graveyard/integration/rake_rules_preprocess_test.rb +178 -178
  98. data/test_graveyard/integration/rake_rules_test.rb +268 -268
  99. data/test_graveyard/integration/rake_tasks_test.rb +103 -103
  100. data/test_graveyard/integration_test_helper.rb +34 -34
  101. data/test_graveyard/rakefile_rules.rb +10 -10
  102. data/test_graveyard/rakefile_rules_aux_dependencies.rb +10 -10
  103. data/test_graveyard/rakefile_rules_cmock.rb +10 -10
  104. data/test_graveyard/rakefile_rules_preprocess.rb +10 -10
  105. data/test_graveyard/rakefile_tasks.rb +10 -10
  106. data/test_graveyard/system/file_system_test.rb +78 -78
  107. data/test_graveyard/system/project_mocks_test.rb +38 -38
  108. data/test_graveyard/system/project_simple_test.rb +39 -39
  109. data/test_graveyard/system/rule_mocks_test.rb +44 -44
  110. data/test_graveyard/system/rule_runners_test.rb +44 -44
  111. data/test_graveyard/system_test_helper.rb +73 -73
  112. data/test_graveyard/test_helper.rb +93 -93
  113. data/test_graveyard/unit/busted/configurator_builder_test.rb +569 -569
  114. data/test_graveyard/unit/busted/configurator_helper_test.rb +234 -234
  115. data/test_graveyard/unit/busted/configurator_test.rb +232 -232
  116. data/test_graveyard/unit/busted/configurator_validator_test.rb +169 -169
  117. data/test_graveyard/unit/busted/deep_merge_fix_test.rb +55 -55
  118. data/test_graveyard/unit/busted/dependinator_test.rb +129 -129
  119. data/test_graveyard/unit/busted/file_finder_helper_test.rb +45 -45
  120. data/test_graveyard/unit/busted/file_finder_test.rb +114 -114
  121. data/test_graveyard/unit/busted/file_path_utils_test.rb +97 -97
  122. data/test_graveyard/unit/busted/file_system_utils_test.rb +21 -21
  123. data/test_graveyard/unit/busted/generator_test.rb +187 -187
  124. data/test_graveyard/unit/busted/generator_test_results_test.rb +129 -129
  125. data/test_graveyard/unit/busted/generator_test_runner_test.rb +475 -475
  126. data/test_graveyard/unit/busted/preprocessinator_file_handler_test.rb +39 -39
  127. data/test_graveyard/unit/busted/preprocessinator_helper_test.rb +156 -156
  128. data/test_graveyard/unit/busted/preprocessinator_includes_handler_test.rb +93 -93
  129. data/test_graveyard/unit/busted/preprocessinator_test.rb +57 -57
  130. data/test_graveyard/unit/busted/project_file_loader_test.rb +142 -142
  131. data/test_graveyard/unit/busted/setupinator_test.rb +45 -45
  132. data/test_graveyard/unit/busted/streaminator_test.rb +49 -49
  133. data/test_graveyard/unit/busted/task_invoker_test.rb +69 -69
  134. data/test_graveyard/unit/busted/test_includes_extractor_test.rb +111 -111
  135. data/test_graveyard/unit/busted/test_invoker_helper_test.rb +62 -62
  136. data/test_graveyard/unit/busted/test_invoker_test.rb +47 -47
  137. data/test_graveyard/unit/busted/tool_executor_helper_test.rb +100 -100
  138. data/test_graveyard/unit/busted/tool_executor_test.rb +351 -351
  139. data/test_graveyard/unit/busted/verbosinator_test.rb +65 -65
  140. data/test_graveyard/unit/preprocessinator_extractor_test.rb +731 -731
  141. data/test_graveyard/unit_test_helper.rb +16 -16
  142. data/vendor/c_exception/LICENSE.txt +30 -30
  143. data/vendor/c_exception/README.md +11 -1
  144. data/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  145. data/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  146. data/vendor/c_exception/docs/readme.txt +261 -242
  147. data/vendor/c_exception/lib/CException.c +46 -46
  148. data/vendor/c_exception/lib/CException.h +110 -86
  149. data/vendor/c_exception/makefile +23 -23
  150. data/vendor/c_exception/test/CExceptionConfig.h +46 -46
  151. data/vendor/c_exception/test/TestException.c +391 -342
  152. data/vendor/c_exception/test/TestException_Runner.c +5 -12
  153. data/vendor/c_exception/vendor/unity/README.md +211 -0
  154. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +1 -1
  155. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +38 -38
  156. data/vendor/c_exception/vendor/unity/auto/generate_config.yml +36 -36
  157. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +202 -202
  158. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +391 -320
  159. data/vendor/c_exception/vendor/unity/auto/parseOutput.rb +2 -0
  160. data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +260 -0
  161. data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +8 -0
  162. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +135 -0
  163. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +148 -139
  164. data/vendor/c_exception/vendor/unity/docs/Unity Summary.odt +0 -0
  165. data/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf +0 -0
  166. data/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +224 -216
  167. data/vendor/c_exception/vendor/unity/docs/license.txt +21 -31
  168. data/vendor/c_exception/vendor/unity/examples/example_1/makefile +40 -15
  169. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.c +2 -0
  170. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +32 -25
  171. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +29 -22
  172. data/vendor/c_exception/vendor/unity/examples/example_2/makefile +40 -14
  173. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.c +2 -0
  174. data/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/all_tests.c +2 -2
  175. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +0 -1
  176. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.c +2 -0
  177. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +48 -37
  178. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +179 -179
  179. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +135 -94
  180. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +13 -17
  181. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +12 -18
  182. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +30 -0
  183. data/vendor/c_exception/vendor/unity/extras/fixture/test/Makefile +60 -0
  184. data/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +4 -3
  185. data/vendor/c_exception/vendor/unity/extras/fixture/test/{testunity_fixture.c → template_fixture_tests.c} +0 -0
  186. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +182 -27
  187. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +13 -0
  188. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +8 -6
  189. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +2 -2
  190. data/vendor/c_exception/vendor/unity/release/build.info +1 -1
  191. data/vendor/c_exception/vendor/unity/release/version.info +1 -1
  192. data/vendor/c_exception/vendor/unity/src/unity.c +1333 -1145
  193. data/vendor/c_exception/vendor/unity/src/unity.h +290 -307
  194. data/vendor/c_exception/vendor/unity/src/unity_internals.h +758 -620
  195. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +7 -3
  196. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +7 -3
  197. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.c +55 -0
  198. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.h +15 -0
  199. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +4 -3
  200. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +4 -3
  201. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -0
  202. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -0
  203. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +6 -5
  204. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +4 -3
  205. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +4 -3
  206. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +6 -5
  207. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +4 -3
  208. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +7 -6
  209. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +9 -5
  210. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +7 -3
  211. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +7 -3
  212. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +9 -5
  213. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +7 -3
  214. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +10 -6
  215. data/vendor/c_exception/vendor/unity/{rakefile.rb → test/rakefile} +60 -61
  216. data/vendor/c_exception/vendor/unity/{rakefile_helper.rb → test/rakefile_helper.rb} +255 -249
  217. data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +83 -0
  218. data/vendor/c_exception/vendor/unity/{targets → test/targets}/clang_strict.yml +83 -83
  219. data/vendor/c_exception/vendor/unity/test/targets/gcc_32.yml +49 -0
  220. data/vendor/c_exception/vendor/unity/test/targets/gcc_64.yml +50 -0
  221. data/vendor/c_exception/vendor/unity/{targets/gcc_64.yml → test/targets/gcc_auto_limits.yml} +46 -45
  222. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_sizeof.yml +47 -0
  223. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_stdint.yml +58 -0
  224. data/vendor/{cmock/vendor/c_exception/vendor/unity/targets/gcc_64.yml → c_exception/vendor/unity/test/targets/gcc_manual_math.yml} +46 -45
  225. data/vendor/{cmock/vendor/c_exception/vendor/unity → c_exception/vendor/unity/test}/targets/hitech_picc18.yml +101 -101
  226. data/vendor/{cmock/vendor/c_exception/vendor/unity → c_exception/vendor/unity/test}/targets/iar_arm_v4.yml +89 -89
  227. data/vendor/{cmock/vendor/c_exception/vendor/unity → c_exception/vendor/unity/test}/targets/iar_arm_v5.yml +79 -79
  228. data/vendor/c_exception/vendor/unity/{targets → test/targets}/iar_arm_v5_3.yml +79 -79
  229. data/vendor/{cmock/vendor/c_exception/vendor/unity → c_exception/vendor/unity/test}/targets/iar_armcortex_LM3S9B92_v5_4.yml +93 -93
  230. data/vendor/c_exception/vendor/unity/{targets → test/targets}/iar_cortexm3_v5.yml +83 -83
  231. data/vendor/{cmock/vendor/c_exception/vendor/unity → c_exception/vendor/unity/test}/targets/iar_msp430.yml +94 -94
  232. data/vendor/c_exception/vendor/unity/{targets → test/targets}/iar_sh2a_v6.yml +85 -85
  233. data/vendor/c_exception/vendor/unity/test/testdata/mocksample.c +51 -51
  234. data/vendor/c_exception/vendor/unity/test/testdata/sample.yml +8 -8
  235. data/vendor/c_exception/vendor/unity/test/testdata/testsample.c +68 -51
  236. data/vendor/{cmock/vendor/c_exception/vendor/unity/test → c_exception/vendor/unity/test/tests}/test_generate_test_runner.rb +102 -88
  237. data/vendor/{cmock/vendor/c_exception/vendor/unity/test → c_exception/vendor/unity/test/tests}/testparameterized.c +104 -101
  238. data/vendor/c_exception/vendor/unity/test/{testunity.c → tests/testunity.c} +3682 -3447
  239. data/vendor/cmock/docs/CMock_Summary.md +3 -0
  240. data/vendor/cmock/lib/cmock_config.rb +1 -0
  241. data/vendor/cmock/lib/cmock_file_writer.rb +7 -3
  242. data/vendor/cmock/lib/cmock_generator.rb +3 -2
  243. data/vendor/cmock/lib/cmock_header_parser.rb +12 -5
  244. data/vendor/cmock/release/version.info +1 -1
  245. data/vendor/cmock/test/system/test_compilation/parsing.h +3 -0
  246. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +7 -0
  247. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +57 -1
  248. data/vendor/cmock/vendor/c_exception/LICENSE.txt +30 -30
  249. data/vendor/cmock/vendor/c_exception/README.md +11 -1
  250. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  251. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  252. data/vendor/cmock/vendor/c_exception/docs/readme.txt +261 -242
  253. data/vendor/cmock/vendor/c_exception/lib/CException.c +46 -46
  254. data/vendor/cmock/vendor/c_exception/lib/CException.h +110 -86
  255. data/vendor/cmock/vendor/c_exception/makefile +23 -23
  256. data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +46 -46
  257. data/vendor/cmock/vendor/c_exception/test/TestException.c +391 -342
  258. data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +5 -12
  259. data/vendor/cmock/vendor/c_exception/vendor/unity/README.md +211 -0
  260. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +1 -1
  261. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +38 -38
  262. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_config.yml +36 -36
  263. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +202 -202
  264. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +391 -320
  265. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parseOutput.rb +2 -0
  266. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +260 -0
  267. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +8 -0
  268. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +135 -0
  269. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +148 -139
  270. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/Unity Summary.odt +0 -0
  271. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf +0 -0
  272. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +224 -216
  273. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/license.txt +21 -31
  274. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +40 -15
  275. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.c +2 -0
  276. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +32 -25
  277. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +29 -22
  278. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/makefile +40 -14
  279. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.c +2 -0
  280. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/all_tests.c +2 -2
  281. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +0 -1
  282. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.c +2 -0
  283. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +48 -37
  284. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +179 -179
  285. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +135 -94
  286. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +13 -17
  287. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +12 -18
  288. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +30 -0
  289. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/Makefile +60 -0
  290. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +4 -3
  291. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/{testunity_fixture.c → template_fixture_tests.c} +0 -0
  292. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +182 -27
  293. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +13 -0
  294. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +8 -6
  295. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +2 -2
  296. data/vendor/cmock/vendor/c_exception/vendor/unity/release/build.info +1 -1
  297. data/vendor/cmock/vendor/c_exception/vendor/unity/release/version.info +1 -1
  298. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +1333 -1145
  299. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +290 -307
  300. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +758 -620
  301. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +7 -3
  302. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +7 -3
  303. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.c +55 -0
  304. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.h +15 -0
  305. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +4 -3
  306. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +4 -3
  307. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -0
  308. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -0
  309. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +6 -5
  310. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +4 -3
  311. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +4 -3
  312. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +6 -5
  313. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +4 -3
  314. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +7 -6
  315. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +9 -5
  316. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +7 -3
  317. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +7 -3
  318. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +9 -5
  319. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +7 -3
  320. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +10 -6
  321. data/vendor/cmock/vendor/c_exception/vendor/unity/{rakefile.rb → test/rakefile} +60 -61
  322. data/vendor/cmock/vendor/c_exception/vendor/unity/{rakefile_helper.rb → test/rakefile_helper.rb} +255 -249
  323. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +83 -0
  324. data/vendor/cmock/vendor/c_exception/vendor/unity/{targets → test/targets}/clang_strict.yml +83 -83
  325. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_32.yml +49 -0
  326. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_64.yml +50 -0
  327. data/vendor/cmock/vendor/c_exception/vendor/unity/{targets/gcc_32.yml → test/targets/gcc_auto_limits.yml} +46 -44
  328. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_auto_sizeof.yml +47 -0
  329. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_auto_stdint.yml +58 -0
  330. data/vendor/{c_exception/vendor/unity/targets/gcc_32.yml → cmock/vendor/c_exception/vendor/unity/test/targets/gcc_manual_math.yml} +46 -44
  331. data/vendor/{c_exception/vendor/unity → cmock/vendor/c_exception/vendor/unity/test}/targets/hitech_picc18.yml +101 -101
  332. data/vendor/{c_exception/vendor/unity → cmock/vendor/c_exception/vendor/unity/test}/targets/iar_arm_v4.yml +89 -89
  333. data/vendor/{c_exception/vendor/unity → cmock/vendor/c_exception/vendor/unity/test}/targets/iar_arm_v5.yml +79 -79
  334. data/vendor/cmock/vendor/c_exception/vendor/unity/{targets → test/targets}/iar_arm_v5_3.yml +79 -79
  335. data/vendor/{c_exception/vendor/unity → cmock/vendor/c_exception/vendor/unity/test}/targets/iar_armcortex_LM3S9B92_v5_4.yml +93 -93
  336. data/vendor/cmock/vendor/c_exception/vendor/unity/{targets → test/targets}/iar_cortexm3_v5.yml +83 -83
  337. data/vendor/{c_exception/vendor/unity → cmock/vendor/c_exception/vendor/unity/test}/targets/iar_msp430.yml +94 -94
  338. data/vendor/cmock/vendor/c_exception/vendor/unity/{targets → test/targets}/iar_sh2a_v6.yml +85 -85
  339. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/mocksample.c +51 -51
  340. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/sample.yml +8 -8
  341. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testsample.c +68 -51
  342. data/vendor/{c_exception/vendor/unity/test → cmock/vendor/c_exception/vendor/unity/test/tests}/test_generate_test_runner.rb +102 -88
  343. data/vendor/{c_exception/vendor/unity/test → cmock/vendor/c_exception/vendor/unity/test/tests}/testparameterized.c +104 -101
  344. data/vendor/cmock/vendor/c_exception/vendor/unity/test/{testunity.c → tests/testunity.c} +3682 -3447
  345. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +30 -13
  346. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +260 -0
  347. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +96 -93
  348. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
  349. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +12 -19
  350. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +18 -17
  351. data/vendor/cmock/vendor/unity/extras/fixture/test/Makefile +66 -5
  352. data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +2 -1
  353. data/vendor/cmock/vendor/unity/extras/fixture/test/{testunity_fixture.c → template_fixture_tests.c} +0 -0
  354. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +187 -27
  355. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +14 -0
  356. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +6 -5
  357. data/vendor/cmock/vendor/unity/release/version.info +1 -1
  358. data/vendor/cmock/vendor/unity/src/unity.c +38 -27
  359. data/vendor/cmock/vendor/unity/src/unity.h +5 -0
  360. data/vendor/cmock/vendor/unity/src/unity_internals.h +22 -18
  361. data/vendor/cmock/vendor/unity/test/Makefile +52 -0
  362. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +4 -0
  363. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +4 -0
  364. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +4 -0
  365. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.h +7 -4
  366. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +6 -4
  367. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +4 -0
  368. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +4 -0
  369. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +4 -0
  370. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +4 -0
  371. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +4 -0
  372. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +4 -0
  373. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +1 -1
  374. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -1
  375. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +0 -1
  376. data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +0 -1
  377. data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +0 -1
  378. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +0 -1
  379. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_sizeof.yml +0 -1
  380. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +0 -1
  381. data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +0 -1
  382. data/vendor/cmock/vendor/unity/test/testdata/testsample.c +19 -2
  383. data/vendor/cmock/vendor/unity/test/tests/testunity.c +55 -4
  384. data/vendor/unity/auto/generate_test_runner.rb +4 -2
  385. data/vendor/unity/auto/stylize_as_junit.rb +260 -0
  386. data/vendor/unity/extras/fixture/src/unity_fixture.c +24 -41
  387. data/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
  388. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +5 -7
  389. data/vendor/unity/extras/fixture/test/Makefile +53 -8
  390. data/vendor/unity/extras/fixture/test/{testunity_fixture.c → template_fixture_tests.c} +0 -0
  391. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +129 -32
  392. data/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +6 -0
  393. data/vendor/unity/extras/fixture/test/unity_output_Spy.c +4 -4
  394. data/vendor/unity/release/version.info +1 -1
  395. data/vendor/unity/src/unity.c +32 -21
  396. data/vendor/unity/src/unity.h +5 -0
  397. data/vendor/unity/src/unity_internals.h +7 -3
  398. data/vendor/unity/test/Makefile +52 -0
  399. data/vendor/unity/test/expectdata/testsample_cmd.c +4 -0
  400. data/vendor/unity/test/expectdata/testsample_def.c +4 -0
  401. data/vendor/unity/test/expectdata/testsample_head1.c +4 -0
  402. data/vendor/unity/test/expectdata/testsample_head1.h +7 -4
  403. data/vendor/unity/test/expectdata/testsample_mock_head1.h +6 -4
  404. data/vendor/unity/test/expectdata/testsample_new1.c +4 -0
  405. data/vendor/unity/test/expectdata/testsample_new2.c +4 -0
  406. data/vendor/unity/test/expectdata/testsample_param.c +4 -0
  407. data/vendor/unity/test/expectdata/testsample_run1.c +4 -0
  408. data/vendor/unity/test/expectdata/testsample_run2.c +4 -0
  409. data/vendor/unity/test/expectdata/testsample_yaml.c +4 -0
  410. data/vendor/unity/test/testdata/testsample.c +19 -2
  411. data/vendor/unity/test/tests/testunity.c +35 -4
  412. metadata +75 -52
  413. data/ceedling-0.18.0.gem +0 -0
  414. data/docs/CeedlingLogo.png +0 -0
  415. data/vendor/c_exception/vendor/unity/Gemfile +0 -4
  416. data/vendor/c_exception/vendor/unity/Gemfile.lock +0 -12
  417. data/vendor/c_exception/vendor/unity/examples/example_3/makefile +0 -41
  418. data/vendor/c_exception/vendor/unity/examples/example_3/test/no_ruby/TestProductionCode2_Runner.c +0 -46
  419. data/vendor/c_exception/vendor/unity/examples/example_3/test/no_ruby/TestProductionCode_Runner.c +0 -50
  420. data/vendor/c_exception/vendor/unity/makefile +0 -37
  421. data/vendor/cmock/vendor/c_exception/vendor/unity/Gemfile +0 -4
  422. data/vendor/cmock/vendor/c_exception/vendor/unity/Gemfile.lock +0 -12
  423. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/makefile +0 -41
  424. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/test/no_ruby/TestProductionCode2_Runner.c +0 -46
  425. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/test/no_ruby/TestProductionCode_Runner.c +0 -50
  426. data/vendor/cmock/vendor/c_exception/vendor/unity/makefile +0 -37
@@ -1,93 +1,93 @@
1
-
2
- #gem install test-unit -v 1.2.3
3
- ruby_version = RUBY_VERSION.split('.')
4
- if (ruby_version[1].to_i == 9) and (ruby_version[2].to_i > 1)
5
- require 'gems'
6
- gem 'test-unit'
7
- end
8
- require 'test/unit'
9
- require 'behaviors'
10
-
11
-
12
- TESTS_ROOT = File.expand_path(File.dirname(__FILE__))
13
- SYSTEM_TEST_ROOT = TESTS_ROOT + '/system'
14
- INTEGRATION_TEST_ROOT = TESTS_ROOT + '/integration'
15
- LIB_ROOT = File.expand_path(File.dirname(__FILE__) + '/../lib')
16
- CEEDLING_ROOT = 'test_ceedling_root/'
17
- CEEDLING_LIB = 'test_ceedling_lib/'
18
- CEEDLING_VENDOR = 'test_ceedling_vendor/'
19
- CEEDLING_RELEASE = 'test_ceedling_release/'
20
-
21
- $config_options = {
22
- :project_build_root => 'project/build',
23
- :project_test_build_output_path => 'project/build/tests/output',
24
- :project_test_results_path => 'project/build/tests/results',
25
- :project_source_include_dirs => [],
26
- :project_test_file_prefix => 'test_',
27
- :project_test_preprocess_files_path => 'project/build/tests/preprocess/files',
28
- :project_test_preprocess_includes_path => 'project/build/tests/preprocess/includes',
29
- :project_test_dependencies_path => 'project/build/tests/dependencies',
30
- :test_runner_file_suffix => '_runner',
31
- :cmock_mock_prefix => 'mock_',
32
- :extension_source => '.c',
33
- :extension_header => '.h',
34
- :extension_object => '.o',
35
- :extension_executable => '.out',
36
- :extension_testpass => '.pass',
37
- :extension_dependencies => '.d',
38
- :collection_all_tests => [],
39
- :collection_all_include_paths => [],
40
- :defines_test => [],
41
- }
42
-
43
- PROJECT_BUILD_ROOT = $config_options[:project_build_root]
44
- PROJECT_TEST_BUILD_OUTPUT_PATH = $config_options[:project_test_build_output_path]
45
- PROJECT_TEST_RESULTS_PATH = $config_options[:project_test_results_path]
46
- PROJECT_SOURCE_INCLUDE_PATHS = $config_options[:project_source_include_dirs]
47
- PROJECT_TEST_FILE_PREFIX = $config_options[:project_test_file_prefix]
48
- PROJECT_TEST_PREPROCESS_FILES_PATH = $config_options[:project_test_preprocess_files_path]
49
- PROJECT_TEST_PREPROCESS_INCLUDES_PATH = $config_options[:project_test_preprocess_includes_path]
50
- PROJECT_TEST_DEPENDENCIES_PATH = $config_options[:project_test_dependencies_path]
51
- TEST_RUNNER_FILE_SUFFIX = $config_options[:test_runner_file_suffix]
52
- CMOCK_MOCK_PREFIX = $config_options[:cmock_mock_prefix]
53
- EXTENSION_SOURCE = $config_options[:extension_source]
54
- EXTENSION_HEADER = $config_options[:extension_header]
55
- EXTENSION_OBJECT = $config_options[:extension_object]
56
- EXTENSION_EXECUTABLE = $config_options[:extension_executable]
57
- EXTENSION_TESTPASS = $config_options[:extension_testpass]
58
- EXTENSION_DEPENDENCIES = $config_options[:extension_dependencies]
59
- COLLECTION_ALL_TESTS = $config_options[:collection_all_tests]
60
- COLLECTION_ALL_INCLUDE_PATHS = $config_options[:collection_all_include_paths]
61
- DEFINES_TEST = $config_options[:defines_test]
62
-
63
-
64
- class String
65
- def left_margin(margin=0)
66
- non_whitespace_column = 0
67
- new_lines = []
68
-
69
- # find first line with non-whitespace and count left columns of whitespace
70
- self.each_line do |line|
71
- if (line =~ /^\s*\S/)
72
- non_whitespace_column = $&.length - 1
73
- break
74
- end
75
- end
76
-
77
- # iterate through each line, chopping off leftmost whitespace columns and add back the desired whitespace margin
78
- self.each_line do |line|
79
- columns = []
80
- margin.times{columns << ' '}
81
- # handle special case of line being narrower than width to be lopped off
82
- if (non_whitespace_column < line.length)
83
- new_lines << "#{columns.join}#{line[non_whitespace_column..-1]}"
84
- else
85
- new_lines << "\n"
86
- end
87
- end
88
-
89
- return new_lines.join
90
- end
91
- end
92
-
93
-
1
+
2
+ #gem install test-unit -v 1.2.3
3
+ ruby_version = RUBY_VERSION.split('.')
4
+ if (ruby_version[1].to_i == 9) and (ruby_version[2].to_i > 1)
5
+ require 'gems'
6
+ gem 'test-unit'
7
+ end
8
+ require 'test/unit'
9
+ require 'behaviors'
10
+
11
+
12
+ TESTS_ROOT = File.expand_path(File.dirname(__FILE__))
13
+ SYSTEM_TEST_ROOT = TESTS_ROOT + '/system'
14
+ INTEGRATION_TEST_ROOT = TESTS_ROOT + '/integration'
15
+ LIB_ROOT = File.expand_path(File.dirname(__FILE__) + '/../lib')
16
+ CEEDLING_ROOT = 'test_ceedling_root/'
17
+ CEEDLING_LIB = 'test_ceedling_lib/'
18
+ CEEDLING_VENDOR = 'test_ceedling_vendor/'
19
+ CEEDLING_RELEASE = 'test_ceedling_release/'
20
+
21
+ $config_options = {
22
+ :project_build_root => 'project/build',
23
+ :project_test_build_output_path => 'project/build/tests/output',
24
+ :project_test_results_path => 'project/build/tests/results',
25
+ :project_source_include_dirs => [],
26
+ :project_test_file_prefix => 'test_',
27
+ :project_test_preprocess_files_path => 'project/build/tests/preprocess/files',
28
+ :project_test_preprocess_includes_path => 'project/build/tests/preprocess/includes',
29
+ :project_test_dependencies_path => 'project/build/tests/dependencies',
30
+ :test_runner_file_suffix => '_runner',
31
+ :cmock_mock_prefix => 'mock_',
32
+ :extension_source => '.c',
33
+ :extension_header => '.h',
34
+ :extension_object => '.o',
35
+ :extension_executable => '.out',
36
+ :extension_testpass => '.pass',
37
+ :extension_dependencies => '.d',
38
+ :collection_all_tests => [],
39
+ :collection_all_include_paths => [],
40
+ :defines_test => [],
41
+ }
42
+
43
+ PROJECT_BUILD_ROOT = $config_options[:project_build_root]
44
+ PROJECT_TEST_BUILD_OUTPUT_PATH = $config_options[:project_test_build_output_path]
45
+ PROJECT_TEST_RESULTS_PATH = $config_options[:project_test_results_path]
46
+ PROJECT_SOURCE_INCLUDE_PATHS = $config_options[:project_source_include_dirs]
47
+ PROJECT_TEST_FILE_PREFIX = $config_options[:project_test_file_prefix]
48
+ PROJECT_TEST_PREPROCESS_FILES_PATH = $config_options[:project_test_preprocess_files_path]
49
+ PROJECT_TEST_PREPROCESS_INCLUDES_PATH = $config_options[:project_test_preprocess_includes_path]
50
+ PROJECT_TEST_DEPENDENCIES_PATH = $config_options[:project_test_dependencies_path]
51
+ TEST_RUNNER_FILE_SUFFIX = $config_options[:test_runner_file_suffix]
52
+ CMOCK_MOCK_PREFIX = $config_options[:cmock_mock_prefix]
53
+ EXTENSION_SOURCE = $config_options[:extension_source]
54
+ EXTENSION_HEADER = $config_options[:extension_header]
55
+ EXTENSION_OBJECT = $config_options[:extension_object]
56
+ EXTENSION_EXECUTABLE = $config_options[:extension_executable]
57
+ EXTENSION_TESTPASS = $config_options[:extension_testpass]
58
+ EXTENSION_DEPENDENCIES = $config_options[:extension_dependencies]
59
+ COLLECTION_ALL_TESTS = $config_options[:collection_all_tests]
60
+ COLLECTION_ALL_INCLUDE_PATHS = $config_options[:collection_all_include_paths]
61
+ DEFINES_TEST = $config_options[:defines_test]
62
+
63
+
64
+ class String
65
+ def left_margin(margin=0)
66
+ non_whitespace_column = 0
67
+ new_lines = []
68
+
69
+ # find first line with non-whitespace and count left columns of whitespace
70
+ self.each_line do |line|
71
+ if (line =~ /^\s*\S/)
72
+ non_whitespace_column = $&.length - 1
73
+ break
74
+ end
75
+ end
76
+
77
+ # iterate through each line, chopping off leftmost whitespace columns and add back the desired whitespace margin
78
+ self.each_line do |line|
79
+ columns = []
80
+ margin.times{columns << ' '}
81
+ # handle special case of line being narrower than width to be lopped off
82
+ if (non_whitespace_column < line.length)
83
+ new_lines << "#{columns.join}#{line[non_whitespace_column..-1]}"
84
+ else
85
+ new_lines << "\n"
86
+ end
87
+ end
88
+
89
+ return new_lines.join
90
+ end
91
+ end
92
+
93
+
@@ -1,569 +1,569 @@
1
- require File.dirname(__FILE__) + '/../unit_test_helper'
2
- require 'yaml'
3
- require 'ceedling/configurator_builder'
4
- require 'ceedling/constants' # for Verbosity constants class
5
-
6
-
7
- class ConfiguratorBuilderTest < Test::Unit::TestCase
8
-
9
- def setup
10
- objects = create_mocks(:project_config_manager, :file_system_utils, :file_wrapper)
11
- create_mocks(:file_list)
12
- @builder = ConfiguratorBuilder.new(objects)
13
- end
14
-
15
- def teardown
16
- end
17
-
18
- ############# insert tool names #############
19
-
20
- should "insert tool names into tools config from their config hash key names" do
21
- in_hash = {
22
- :tools => {
23
- :thinger => {:executable => '/bin/thinger', :arguments => ['-E']},
24
- :zinger => {:executable => 'zinger', :arguments => ['-option', '-flag']}
25
- }}
26
-
27
- @builder.populate_tool_names(in_hash)
28
-
29
- assert_equal('thinger', in_hash[:tools][:thinger][:name])
30
- assert_equal('/bin/thinger', in_hash[:tools][:thinger][:executable])
31
- assert_equal(['-E'], in_hash[:tools][:thinger][:arguments])
32
-
33
- assert_equal('zinger', in_hash[:tools][:zinger][:name])
34
- assert_equal('zinger', in_hash[:tools][:zinger][:executable])
35
- assert_equal(['-option', '-flag'], in_hash[:tools][:zinger][:arguments])
36
-
37
- end
38
-
39
- ############# flattenify #############
40
-
41
- should "flattenify keys and values contained in yaml and not blow up on empty top-level entries" do
42
-
43
- config = %Q{
44
- ---
45
- :project:
46
- :name: App
47
- :dirs:
48
- - .
49
- - gui
50
- - ../common/modules/
51
-
52
- :extension:
53
- :obj: .o
54
- :bin: .out
55
- :dep: .d
56
-
57
- :cmock:
58
- :mock_path: build/tests/mocks/
59
- :plugins:
60
- - cexception
61
- - ignore
62
-
63
- :empty:
64
-
65
- ...
66
- }.left_margin
67
- hash = @builder.flattenify( YAML.load(config) )
68
-
69
- assert_equal(hash[:project_name], 'App')
70
- assert_equal(hash[:project_dirs], ['.', 'gui', '../common/modules/'])
71
-
72
- assert_equal(hash[:extension_obj], '.o')
73
- assert_equal(hash[:extension_bin], '.out')
74
- assert_equal(hash[:extension_dep], '.d')
75
-
76
- assert_equal(hash[:cmock_mock_path], 'build/tests/mocks/')
77
- assert_equal(hash[:cmock_plugins], ['cexception', 'ignore'])
78
- end
79
-
80
- ############# defaults #############
81
-
82
- should "populate all defaults for unspecified entries in config hash" do
83
- # pass in blank configuration and ensure all defaults populated
84
- assert_equal(DEFAULT_CEEDLING_CONFIG, @builder.populate_defaults({}))
85
- end
86
-
87
- should "not default any entry in input config hash that's already been set to something" do
88
- in_hash = {
89
- # all set to something other than defaults in source
90
- :project_use_exceptions => false,
91
- :project_use_mocks => false,
92
- :project_use_preprocessor => true,
93
- :project_use_deep_dependencies => true,
94
- :project_test_file_prefix => 'yeehaw_',
95
- :project_verbosity => Verbosity::OBNOXIOUS,
96
-
97
- :paths_support => ['path/support'],
98
- :paths_include => ['path/include'],
99
-
100
- :defines_test => ['TEST_DEFINE'],
101
- :defines_source => ['SOURCE_DEFINE'],
102
-
103
- :extension_header => '.H',
104
- :extension_source => '.C',
105
- :extension_object => '.O',
106
- :extension_executable => '.exe',
107
- :extension_testpass => '.p',
108
- :extension_testfail => '.f',
109
- :extension_dependencies => '.dep',
110
-
111
- :unity_int_width => 16,
112
- :unity_exclude_float => true,
113
- :unity_float_type => 'double',
114
- :unity_float_precision => '0.0000001f',
115
-
116
- :test_runner_includes => ['Common.h'],
117
- :test_runner_file_suffix => '_walker',
118
-
119
- :tools_includes_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
120
- :tools_file_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
121
- :tools_dependencies_generator => {:name => 'doohicky', :executable => 'exe', :arguments => []},
122
- }
123
-
124
- assert_equal(in_hash, @builder.populate_defaults(in_hash))
125
- end
126
-
127
- should "merge complex/nested values within default values" do
128
- in_hash = {
129
- :tools_file_preprocessor => {:executable => '/bin/app'},
130
- :tools_dependencies_generator => {:arguments => ['-option', '-flag']}
131
- }
132
-
133
- out_hash = @builder.populate_defaults(in_hash)
134
-
135
- # default executable has been overwritten but default arguments remain
136
- assert_equal('/bin/app', out_hash[:tools_file_preprocessor][:executable])
137
- assert_equal(DEFAULT_FILE_PREPROCESSOR_TOOL[:arguments], out_hash[:tools_file_preprocessor][:arguments])
138
-
139
- # default arguments have been overwritten but default executable remains
140
- assert_equal(DEFAULT_DEPENDENCIES_GENERATOR_TOOL[:executable], out_hash[:tools_dependencies_generator][:executable])
141
- assert_equal(['-option', '-flag'], out_hash[:tools_dependencies_generator][:arguments])
142
- end
143
-
144
- should "preserve in defaulted configuration anything in input that's not a handled default" do
145
- in_hash = {
146
- :yo => 'mama',
147
- :be => 'all you can be'
148
- }
149
-
150
- assert_equal(DEFAULT_CEEDLING_CONFIG.merge(in_hash), @builder.populate_defaults(in_hash))
151
- end
152
-
153
- ############# clean #############
154
-
155
- should "tidy up configuration values" do
156
- in_hash = {
157
- :test_runner_includes => ['common', 'types.h', 'thing.H'],
158
- :extension_header => '.h',
159
- }
160
-
161
- @builder.clean(in_hash)
162
-
163
- assert_equal(['common.h', 'types.h', 'thing.h'], in_hash[:test_runner_includes])
164
- end
165
-
166
- ############# build paths #############
167
-
168
- should "construct and collect simple build paths" do
169
- in_hash = {
170
- :project_build_root => 'files/build'}
171
- expected_build_paths = [
172
- 'files/build/tests/runners',
173
- 'files/build/tests/results',
174
- 'files/build/tests/out',
175
- 'files/build/tests/artifacts',
176
- 'files/build/release/out',
177
- 'files/build/release/artifacts',]
178
-
179
- out_hash = @builder.set_build_paths(in_hash)
180
-
181
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
182
-
183
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
184
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
185
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
186
- assert_equal(expected_build_paths[3], out_hash[:project_test_artifacts_path])
187
- assert_equal(expected_build_paths[4], out_hash[:project_release_build_output_path])
188
- assert_equal(expected_build_paths[5], out_hash[:project_release_artifacts_path])
189
- end
190
-
191
- should "construct and collect build paths including mocks path" do
192
- in_hash = {
193
- :project_build_root => 'files/build',
194
- :project_use_mocks => true,
195
- :cmock_mock_path => 'files/build/tests/mocks'}
196
- expected_build_paths = [
197
- 'files/build/tests/runners',
198
- 'files/build/tests/results',
199
- 'files/build/tests/out',
200
- 'files/build/tests/mocks',
201
- 'files/build/tests/artifacts',
202
- 'files/build/release/out',
203
- 'files/build/release/artifacts',]
204
-
205
- out_hash = @builder.set_build_paths(in_hash)
206
-
207
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
208
-
209
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
210
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
211
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
212
- assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
213
- assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
214
- assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
215
- end
216
-
217
- should "construct and collect build paths including preprocessing paths" do
218
- in_hash = {
219
- :project_build_root => 'files/build',
220
- :project_use_preprocessor => true}
221
- expected_build_paths = [
222
- 'files/build/tests/runners',
223
- 'files/build/tests/results',
224
- 'files/build/tests/out',
225
- 'files/build/tests/preprocess/includes',
226
- 'files/build/tests/preprocess/files',
227
- 'files/build/temp',
228
- 'files/build/tests/artifacts',
229
- 'files/build/release/out',
230
- 'files/build/release/artifacts',]
231
-
232
- out_hash = @builder.set_build_paths(in_hash)
233
-
234
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
235
-
236
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
237
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
238
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
239
- assert_equal(expected_build_paths[3], out_hash[:project_test_preprocess_includes_path])
240
- assert_equal(expected_build_paths[4], out_hash[:project_test_preprocess_files_path])
241
- assert_equal(expected_build_paths[5], out_hash[:project_temp_path])
242
- assert_equal(expected_build_paths[6], out_hash[:project_test_artifacts_path])
243
- assert_equal(expected_build_paths[7], out_hash[:project_release_build_output_path])
244
- assert_equal(expected_build_paths[8], out_hash[:project_release_artifacts_path])
245
- end
246
-
247
- should "construct and collect build paths including dependencies paths" do
248
- in_hash = {
249
- :project_build_root => 'files/build',
250
- :project_use_deep_dependencies => true}
251
- expected_build_paths = [
252
- 'files/build/tests/runners',
253
- 'files/build/tests/results',
254
- 'files/build/tests/out',
255
- 'files/build/tests/dependencies',
256
- 'files/build/tests/artifacts',
257
- 'files/build/release/out',
258
- 'files/build/release/artifacts',]
259
-
260
- out_hash = @builder.set_build_paths(in_hash)
261
-
262
- assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
263
-
264
- assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
265
- assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
266
- assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
267
- assert_equal(expected_build_paths[3], out_hash[:project_test_dependencies_path])
268
- assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
269
- assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
270
- assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
271
- end
272
-
273
- ############# rakefile components #############
274
-
275
- should "set rakefile components needed to load the project" do
276
- in_hash = {}
277
- out_hash = @builder.set_rakefile_components(in_hash)
278
- assert_equal(
279
- ["#{CEEDLING_LIB}rules.rake",
280
- "#{CEEDLING_LIB}tasks.rake",
281
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
282
- out_hash[:project_rakefile_component_files].sort)
283
-
284
- in_hash = {:project_use_mocks => true}
285
- out_hash = @builder.set_rakefile_components(in_hash)
286
- assert_equal(
287
- ["#{CEEDLING_LIB}rules.rake",
288
- "#{CEEDLING_LIB}tasks.rake",
289
- "#{CEEDLING_LIB}rules_cmock.rake",
290
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
291
- out_hash[:project_rakefile_component_files].sort)
292
-
293
- in_hash = {:project_use_preprocessor => true}
294
- out_hash = @builder.set_rakefile_components(in_hash)
295
- assert_equal(
296
- ["#{CEEDLING_LIB}rules.rake",
297
- "#{CEEDLING_LIB}tasks.rake",
298
- "#{CEEDLING_LIB}rules_preprocess.rake",
299
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
300
- out_hash[:project_rakefile_component_files].sort)
301
-
302
- in_hash = {:project_use_deep_dependencies => true}
303
- out_hash = @builder.set_rakefile_components(in_hash)
304
- assert_equal(
305
- ["#{CEEDLING_LIB}rules.rake",
306
- "#{CEEDLING_LIB}tasks.rake",
307
- "#{CEEDLING_LIB}rules_deep_dependencies.rake",
308
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
309
- out_hash[:project_rakefile_component_files].sort)
310
-
311
- in_hash = {:project_use_mocks => true, :project_use_preprocessor => true, :project_use_deep_dependencies => true}
312
- out_hash = @builder.set_rakefile_components(in_hash)
313
- assert_equal(
314
- ["#{CEEDLING_LIB}rules.rake",
315
- "#{CEEDLING_LIB}tasks.rake",
316
- "#{CEEDLING_LIB}rules_cmock.rake",
317
- "#{CEEDLING_LIB}rules_preprocess.rake",
318
- "#{CEEDLING_LIB}rules_deep_dependencies.rake",
319
- "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
320
- out_hash[:project_rakefile_component_files].sort)
321
- end
322
-
323
- ############# source and test include paths #############
324
-
325
- should "collect all source and test include paths without optional mocks and exception paths" do
326
- in_hash = {
327
- :project_use_exceptions => false,
328
- :project_use_mocks => false,
329
- :paths_test => ['files/tests'],
330
- :paths_support => ['files/tests/support'],
331
- :paths_source => ['files/source'],
332
- :paths_include => ['files/source/include'],
333
- }
334
-
335
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src"]
336
-
337
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
338
-
339
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
340
- end
341
-
342
- should "collect all source and test include paths without optional mocks paths but with exception path" do
343
- in_hash = {
344
- :project_use_exceptions => true,
345
- :project_use_mocks => false,
346
- :paths_test => ['files/tests'],
347
- :paths_support => ['files/tests/support'],
348
- :paths_source => ['files/source'],
349
- :paths_include => ['files/source/include'],
350
- }
351
-
352
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib"]
353
-
354
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
355
-
356
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
357
- end
358
-
359
- should "collect all source and test include paths with optional mocks paths but without exception path" do
360
- in_hash = {
361
- :project_use_exceptions => false,
362
- :project_use_mocks => true,
363
- :cmock_mock_path => 'files/build/mocks',
364
- :paths_test => ['files/tests'],
365
- :paths_support => ['files/tests/support'],
366
- :paths_source => ['files/source'],
367
- :paths_include => ['files/source/include'],
368
- }
369
-
370
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", 'files/build/mocks']
371
-
372
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
373
-
374
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
375
- end
376
-
377
- should "collect all source and test include paths with both optional mocks paths and exception path" do
378
- in_hash = {
379
- :project_use_exceptions => true,
380
- :project_use_mocks => true,
381
- :cmock_mock_path => 'files/build/mocks',
382
- :paths_test => ['files/tests'],
383
- :paths_support => ['files/tests/support'],
384
- :paths_source => ['files/source'],
385
- :paths_include => ['files/source/include'],
386
- }
387
-
388
- expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib", 'files/build/mocks']
389
-
390
- out_hash = @builder.collect_test_and_source_include_paths(in_hash)
391
-
392
- assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
393
- end
394
-
395
- ############# source and test paths #############
396
-
397
- should "collect all source and test paths without optional mocks and exception paths" do
398
- in_hash = {
399
- :project_use_exceptions => false,
400
- :project_use_mocks => false,
401
- :paths_test => ['files/tests'],
402
- :paths_support => ['files/tests/support'],
403
- :paths_source => ['files/source'],
404
- :project_test_runners_path => 'files/build/runners',
405
- }
406
-
407
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}unity/src"]
408
-
409
- out_hash = @builder.collect_test_and_source_paths(in_hash)
410
-
411
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
412
- end
413
-
414
- should "collect all source and test paths with optional mocks path but without exception path" do
415
- in_hash = {
416
- :project_use_exceptions => false,
417
- :project_use_mocks => true,
418
- :paths_test => ['files/tests'],
419
- :paths_support => ['files/tests/support'],
420
- :paths_source => ['files/source'],
421
- :project_test_runners_path => 'files/build/runners',
422
- :cmock_mock_path => 'files/build/mocks',
423
- }
424
-
425
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}unity/src"]
426
-
427
- out_hash = @builder.collect_test_and_source_paths(in_hash)
428
-
429
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
430
- end
431
-
432
- should "collect all source and test paths without optional mocks path but with exception path" do
433
- in_hash = {
434
- :project_use_exceptions => true,
435
- :project_use_mocks => false,
436
- :paths_test => ['files/tests'],
437
- :paths_support => ['files/tests/support'],
438
- :paths_source => ['files/source'],
439
- :project_test_runners_path => 'files/build/runners',
440
- }
441
-
442
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
443
-
444
- out_hash = @builder.collect_test_and_source_paths(in_hash)
445
-
446
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
447
- end
448
-
449
- should "collect all source and test paths with both optional mocks path and exception path" do
450
- in_hash = {
451
- :project_use_exceptions => true,
452
- :project_use_mocks => true,
453
- :paths_test => ['files/tests'],
454
- :paths_support => ['files/tests/support'],
455
- :paths_source => ['files/source'],
456
- :project_test_runners_path => 'files/build/runners',
457
- :cmock_mock_path => 'files/build/mocks',
458
- }
459
-
460
- expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
461
-
462
- out_hash = @builder.collect_test_and_source_paths(in_hash)
463
-
464
- assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
465
- end
466
-
467
- ############# all tests #############
468
-
469
- should "collect all tests" do
470
- in_hash = {
471
- :paths_test => ['tests/main', 'tests/other/**'],
472
- :project_test_file_prefix => 'Test',
473
- :extension_source => '.c'}
474
-
475
- @file_wrapper.expects.instantiate_file_list.returns(@file_list)
476
-
477
- @file_list.expects.include('tests/main/Test*.c')
478
- @file_list.expects.include('tests/other/**/Test*.c')
479
-
480
- assert_equal({:collection_all_tests => @file_list}, @builder.collect_tests(in_hash))
481
- end
482
-
483
- ############# all source #############
484
-
485
- should "collect all source" do
486
- in_hash = {
487
- :paths_source => ['files/source', 'files/modules/**'],
488
- :extension_source => '.c'}
489
-
490
- @file_wrapper.expects.instantiate_file_list.returns(@file_list)
491
-
492
- @file_list.expects.include('files/source/*.c')
493
- @file_list.expects.include('files/modules/**/*.c')
494
-
495
- assert_equal({:collection_all_source => @file_list}, @builder.collect_source(in_hash))
496
- end
497
-
498
- ############# all headers #############
499
-
500
- should "collect all headers" do
501
- in_hash = {
502
- :paths_support => ['files/test/support/**'],
503
- :paths_include => ['files/source/include'],
504
- :paths_source => ['files/source', 'files/modules/**'],
505
- :extension_header => '.h'}
506
-
507
- @file_wrapper.expects.instantiate_file_list.returns(@file_list)
508
-
509
- @file_list.expects.include('files/test/support/**/*.h')
510
- @file_list.expects.include('files/source/*.h')
511
- @file_list.expects.include('files/modules/**/*.h')
512
- @file_list.expects.include('files/source/include/*.h')
513
-
514
- assert_equal({:collection_all_headers => @file_list}, @builder.collect_headers(in_hash))
515
- end
516
-
517
- ############# collect environment files #############
518
-
519
- should "collect environment source files plus project file but no user project file" do
520
- @project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
521
- @project_config_manager.expects.user_project_filepath.returns('')
522
-
523
- out_hash = @builder.collect_code_generation_dependencies
524
-
525
- assert_equal(
526
- ["#{CEEDLING_VENDOR}cmock/release/build.info",
527
- '/home/project/config/project.yaml'].sort,
528
- out_hash[:collection_code_generation_dependencies].sort)
529
- end
530
-
531
- should "collect environment source files plus project file and user project file" do
532
- @project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
533
- @project_config_manager.expects.user_project_filepath.returns('/home/project/config/user.yaml')
534
-
535
- out_hash = @builder.collect_code_generation_dependencies
536
-
537
- assert_equal(
538
- ["#{CEEDLING_VENDOR}cmock/release/build.info",
539
- '/home/project/config/project.yaml',
540
- '/home/project/config/user.yaml'].sort,
541
- out_hash[:collection_code_generation_dependencies].sort)
542
- end
543
-
544
- ############# expand path globs #############
545
-
546
- should "inspect each element of paths in config hash and expand any and all globs into a collection" do
547
-
548
- create_mocks(:paths_collection1, :paths_collection2, :paths_collection3)
549
- in_hash = {
550
- :path_dummy => [],
551
- :paths_custom => ['oh', 'yeah'],
552
- :paths_source => ['files/source', 'files/modules/**'],
553
- :paths_to_destruction => ['paths/sin', 'paths/avarice'],
554
- :whatever => 'blah blah blah',
555
- }
556
-
557
- @file_system_utils.expects.collect_paths(['oh', 'yeah']).returns(@paths_collection1)
558
- @file_system_utils.expects.collect_paths(['files/source', 'files/modules/**']).returns(@paths_collection2)
559
- @file_system_utils.expects.collect_paths(['paths/sin', 'paths/avarice']).returns(@paths_collection3)
560
-
561
- out_hash = @builder.expand_all_path_globs(in_hash)
562
-
563
- assert_equal(@paths_collection1, out_hash[:collection_paths_custom])
564
- assert_equal(@paths_collection2, out_hash[:collection_paths_source])
565
- assert_equal(@paths_collection3, out_hash[:collection_paths_to_destruction])
566
- end
567
-
568
- end
569
-
1
+ require File.dirname(__FILE__) + '/../unit_test_helper'
2
+ require 'yaml'
3
+ require 'ceedling/configurator_builder'
4
+ require 'ceedling/constants' # for Verbosity constants class
5
+
6
+
7
+ class ConfiguratorBuilderTest < Test::Unit::TestCase
8
+
9
+ def setup
10
+ objects = create_mocks(:project_config_manager, :file_system_utils, :file_wrapper)
11
+ create_mocks(:file_list)
12
+ @builder = ConfiguratorBuilder.new(objects)
13
+ end
14
+
15
+ def teardown
16
+ end
17
+
18
+ ############# insert tool names #############
19
+
20
+ should "insert tool names into tools config from their config hash key names" do
21
+ in_hash = {
22
+ :tools => {
23
+ :thinger => {:executable => '/bin/thinger', :arguments => ['-E']},
24
+ :zinger => {:executable => 'zinger', :arguments => ['-option', '-flag']}
25
+ }}
26
+
27
+ @builder.populate_tool_names(in_hash)
28
+
29
+ assert_equal('thinger', in_hash[:tools][:thinger][:name])
30
+ assert_equal('/bin/thinger', in_hash[:tools][:thinger][:executable])
31
+ assert_equal(['-E'], in_hash[:tools][:thinger][:arguments])
32
+
33
+ assert_equal('zinger', in_hash[:tools][:zinger][:name])
34
+ assert_equal('zinger', in_hash[:tools][:zinger][:executable])
35
+ assert_equal(['-option', '-flag'], in_hash[:tools][:zinger][:arguments])
36
+
37
+ end
38
+
39
+ ############# flattenify #############
40
+
41
+ should "flattenify keys and values contained in yaml and not blow up on empty top-level entries" do
42
+
43
+ config = %Q{
44
+ ---
45
+ :project:
46
+ :name: App
47
+ :dirs:
48
+ - .
49
+ - gui
50
+ - ../common/modules/
51
+
52
+ :extension:
53
+ :obj: .o
54
+ :bin: .out
55
+ :dep: .d
56
+
57
+ :cmock:
58
+ :mock_path: build/tests/mocks/
59
+ :plugins:
60
+ - cexception
61
+ - ignore
62
+
63
+ :empty:
64
+
65
+ ...
66
+ }.left_margin
67
+ hash = @builder.flattenify( YAML.load(config) )
68
+
69
+ assert_equal(hash[:project_name], 'App')
70
+ assert_equal(hash[:project_dirs], ['.', 'gui', '../common/modules/'])
71
+
72
+ assert_equal(hash[:extension_obj], '.o')
73
+ assert_equal(hash[:extension_bin], '.out')
74
+ assert_equal(hash[:extension_dep], '.d')
75
+
76
+ assert_equal(hash[:cmock_mock_path], 'build/tests/mocks/')
77
+ assert_equal(hash[:cmock_plugins], ['cexception', 'ignore'])
78
+ end
79
+
80
+ ############# defaults #############
81
+
82
+ should "populate all defaults for unspecified entries in config hash" do
83
+ # pass in blank configuration and ensure all defaults populated
84
+ assert_equal(DEFAULT_CEEDLING_CONFIG, @builder.populate_defaults({}))
85
+ end
86
+
87
+ should "not default any entry in input config hash that's already been set to something" do
88
+ in_hash = {
89
+ # all set to something other than defaults in source
90
+ :project_use_exceptions => false,
91
+ :project_use_mocks => false,
92
+ :project_use_preprocessor => true,
93
+ :project_use_deep_dependencies => true,
94
+ :project_test_file_prefix => 'yeehaw_',
95
+ :project_verbosity => Verbosity::OBNOXIOUS,
96
+
97
+ :paths_support => ['path/support'],
98
+ :paths_include => ['path/include'],
99
+
100
+ :defines_test => ['TEST_DEFINE'],
101
+ :defines_source => ['SOURCE_DEFINE'],
102
+
103
+ :extension_header => '.H',
104
+ :extension_source => '.C',
105
+ :extension_object => '.O',
106
+ :extension_executable => '.exe',
107
+ :extension_testpass => '.p',
108
+ :extension_testfail => '.f',
109
+ :extension_dependencies => '.dep',
110
+
111
+ :unity_int_width => 16,
112
+ :unity_exclude_float => true,
113
+ :unity_float_type => 'double',
114
+ :unity_float_precision => '0.0000001f',
115
+
116
+ :test_runner_includes => ['Common.h'],
117
+ :test_runner_file_suffix => '_walker',
118
+
119
+ :tools_includes_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
120
+ :tools_file_preprocessor => {:name => 'doohicky', :executable => 'exe', :arguments => []},
121
+ :tools_dependencies_generator => {:name => 'doohicky', :executable => 'exe', :arguments => []},
122
+ }
123
+
124
+ assert_equal(in_hash, @builder.populate_defaults(in_hash))
125
+ end
126
+
127
+ should "merge complex/nested values within default values" do
128
+ in_hash = {
129
+ :tools_file_preprocessor => {:executable => '/bin/app'},
130
+ :tools_dependencies_generator => {:arguments => ['-option', '-flag']}
131
+ }
132
+
133
+ out_hash = @builder.populate_defaults(in_hash)
134
+
135
+ # default executable has been overwritten but default arguments remain
136
+ assert_equal('/bin/app', out_hash[:tools_file_preprocessor][:executable])
137
+ assert_equal(DEFAULT_FILE_PREPROCESSOR_TOOL[:arguments], out_hash[:tools_file_preprocessor][:arguments])
138
+
139
+ # default arguments have been overwritten but default executable remains
140
+ assert_equal(DEFAULT_DEPENDENCIES_GENERATOR_TOOL[:executable], out_hash[:tools_dependencies_generator][:executable])
141
+ assert_equal(['-option', '-flag'], out_hash[:tools_dependencies_generator][:arguments])
142
+ end
143
+
144
+ should "preserve in defaulted configuration anything in input that's not a handled default" do
145
+ in_hash = {
146
+ :yo => 'mama',
147
+ :be => 'all you can be'
148
+ }
149
+
150
+ assert_equal(DEFAULT_CEEDLING_CONFIG.merge(in_hash), @builder.populate_defaults(in_hash))
151
+ end
152
+
153
+ ############# clean #############
154
+
155
+ should "tidy up configuration values" do
156
+ in_hash = {
157
+ :test_runner_includes => ['common', 'types.h', 'thing.H'],
158
+ :extension_header => '.h',
159
+ }
160
+
161
+ @builder.clean(in_hash)
162
+
163
+ assert_equal(['common.h', 'types.h', 'thing.h'], in_hash[:test_runner_includes])
164
+ end
165
+
166
+ ############# build paths #############
167
+
168
+ should "construct and collect simple build paths" do
169
+ in_hash = {
170
+ :project_build_root => 'files/build'}
171
+ expected_build_paths = [
172
+ 'files/build/tests/runners',
173
+ 'files/build/tests/results',
174
+ 'files/build/tests/out',
175
+ 'files/build/tests/artifacts',
176
+ 'files/build/release/out',
177
+ 'files/build/release/artifacts',]
178
+
179
+ out_hash = @builder.set_build_paths(in_hash)
180
+
181
+ assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
182
+
183
+ assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
184
+ assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
185
+ assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
186
+ assert_equal(expected_build_paths[3], out_hash[:project_test_artifacts_path])
187
+ assert_equal(expected_build_paths[4], out_hash[:project_release_build_output_path])
188
+ assert_equal(expected_build_paths[5], out_hash[:project_release_artifacts_path])
189
+ end
190
+
191
+ should "construct and collect build paths including mocks path" do
192
+ in_hash = {
193
+ :project_build_root => 'files/build',
194
+ :project_use_mocks => true,
195
+ :cmock_mock_path => 'files/build/tests/mocks'}
196
+ expected_build_paths = [
197
+ 'files/build/tests/runners',
198
+ 'files/build/tests/results',
199
+ 'files/build/tests/out',
200
+ 'files/build/tests/mocks',
201
+ 'files/build/tests/artifacts',
202
+ 'files/build/release/out',
203
+ 'files/build/release/artifacts',]
204
+
205
+ out_hash = @builder.set_build_paths(in_hash)
206
+
207
+ assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
208
+
209
+ assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
210
+ assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
211
+ assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
212
+ assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
213
+ assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
214
+ assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
215
+ end
216
+
217
+ should "construct and collect build paths including preprocessing paths" do
218
+ in_hash = {
219
+ :project_build_root => 'files/build',
220
+ :project_use_preprocessor => true}
221
+ expected_build_paths = [
222
+ 'files/build/tests/runners',
223
+ 'files/build/tests/results',
224
+ 'files/build/tests/out',
225
+ 'files/build/tests/preprocess/includes',
226
+ 'files/build/tests/preprocess/files',
227
+ 'files/build/temp',
228
+ 'files/build/tests/artifacts',
229
+ 'files/build/release/out',
230
+ 'files/build/release/artifacts',]
231
+
232
+ out_hash = @builder.set_build_paths(in_hash)
233
+
234
+ assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
235
+
236
+ assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
237
+ assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
238
+ assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
239
+ assert_equal(expected_build_paths[3], out_hash[:project_test_preprocess_includes_path])
240
+ assert_equal(expected_build_paths[4], out_hash[:project_test_preprocess_files_path])
241
+ assert_equal(expected_build_paths[5], out_hash[:project_temp_path])
242
+ assert_equal(expected_build_paths[6], out_hash[:project_test_artifacts_path])
243
+ assert_equal(expected_build_paths[7], out_hash[:project_release_build_output_path])
244
+ assert_equal(expected_build_paths[8], out_hash[:project_release_artifacts_path])
245
+ end
246
+
247
+ should "construct and collect build paths including dependencies paths" do
248
+ in_hash = {
249
+ :project_build_root => 'files/build',
250
+ :project_use_deep_dependencies => true}
251
+ expected_build_paths = [
252
+ 'files/build/tests/runners',
253
+ 'files/build/tests/results',
254
+ 'files/build/tests/out',
255
+ 'files/build/tests/dependencies',
256
+ 'files/build/tests/artifacts',
257
+ 'files/build/release/out',
258
+ 'files/build/release/artifacts',]
259
+
260
+ out_hash = @builder.set_build_paths(in_hash)
261
+
262
+ assert_equal(expected_build_paths.sort, out_hash[:project_build_paths].sort)
263
+
264
+ assert_equal(expected_build_paths[0], out_hash[:project_test_runners_path])
265
+ assert_equal(expected_build_paths[1], out_hash[:project_test_results_path])
266
+ assert_equal(expected_build_paths[2], out_hash[:project_test_build_output_path])
267
+ assert_equal(expected_build_paths[3], out_hash[:project_test_dependencies_path])
268
+ assert_equal(expected_build_paths[4], out_hash[:project_test_artifacts_path])
269
+ assert_equal(expected_build_paths[5], out_hash[:project_release_build_output_path])
270
+ assert_equal(expected_build_paths[6], out_hash[:project_release_artifacts_path])
271
+ end
272
+
273
+ ############# rakefile components #############
274
+
275
+ should "set rakefile components needed to load the project" do
276
+ in_hash = {}
277
+ out_hash = @builder.set_rakefile_components(in_hash)
278
+ assert_equal(
279
+ ["#{CEEDLING_LIB}rules.rake",
280
+ "#{CEEDLING_LIB}tasks.rake",
281
+ "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
282
+ out_hash[:project_rakefile_component_files].sort)
283
+
284
+ in_hash = {:project_use_mocks => true}
285
+ out_hash = @builder.set_rakefile_components(in_hash)
286
+ assert_equal(
287
+ ["#{CEEDLING_LIB}rules.rake",
288
+ "#{CEEDLING_LIB}tasks.rake",
289
+ "#{CEEDLING_LIB}rules_cmock.rake",
290
+ "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
291
+ out_hash[:project_rakefile_component_files].sort)
292
+
293
+ in_hash = {:project_use_preprocessor => true}
294
+ out_hash = @builder.set_rakefile_components(in_hash)
295
+ assert_equal(
296
+ ["#{CEEDLING_LIB}rules.rake",
297
+ "#{CEEDLING_LIB}tasks.rake",
298
+ "#{CEEDLING_LIB}rules_preprocess.rake",
299
+ "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
300
+ out_hash[:project_rakefile_component_files].sort)
301
+
302
+ in_hash = {:project_use_deep_dependencies => true}
303
+ out_hash = @builder.set_rakefile_components(in_hash)
304
+ assert_equal(
305
+ ["#{CEEDLING_LIB}rules.rake",
306
+ "#{CEEDLING_LIB}tasks.rake",
307
+ "#{CEEDLING_LIB}rules_deep_dependencies.rake",
308
+ "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
309
+ out_hash[:project_rakefile_component_files].sort)
310
+
311
+ in_hash = {:project_use_mocks => true, :project_use_preprocessor => true, :project_use_deep_dependencies => true}
312
+ out_hash = @builder.set_rakefile_components(in_hash)
313
+ assert_equal(
314
+ ["#{CEEDLING_LIB}rules.rake",
315
+ "#{CEEDLING_LIB}tasks.rake",
316
+ "#{CEEDLING_LIB}rules_cmock.rake",
317
+ "#{CEEDLING_LIB}rules_preprocess.rake",
318
+ "#{CEEDLING_LIB}rules_deep_dependencies.rake",
319
+ "#{CEEDLING_LIB}tasks_filesystem.rake"].sort,
320
+ out_hash[:project_rakefile_component_files].sort)
321
+ end
322
+
323
+ ############# source and test include paths #############
324
+
325
+ should "collect all source and test include paths without optional mocks and exception paths" do
326
+ in_hash = {
327
+ :project_use_exceptions => false,
328
+ :project_use_mocks => false,
329
+ :paths_test => ['files/tests'],
330
+ :paths_support => ['files/tests/support'],
331
+ :paths_source => ['files/source'],
332
+ :paths_include => ['files/source/include'],
333
+ }
334
+
335
+ expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src"]
336
+
337
+ out_hash = @builder.collect_test_and_source_include_paths(in_hash)
338
+
339
+ assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
340
+ end
341
+
342
+ should "collect all source and test include paths without optional mocks paths but with exception path" do
343
+ in_hash = {
344
+ :project_use_exceptions => true,
345
+ :project_use_mocks => false,
346
+ :paths_test => ['files/tests'],
347
+ :paths_support => ['files/tests/support'],
348
+ :paths_source => ['files/source'],
349
+ :paths_include => ['files/source/include'],
350
+ }
351
+
352
+ expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib"]
353
+
354
+ out_hash = @builder.collect_test_and_source_include_paths(in_hash)
355
+
356
+ assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
357
+ end
358
+
359
+ should "collect all source and test include paths with optional mocks paths but without exception path" do
360
+ in_hash = {
361
+ :project_use_exceptions => false,
362
+ :project_use_mocks => true,
363
+ :cmock_mock_path => 'files/build/mocks',
364
+ :paths_test => ['files/tests'],
365
+ :paths_support => ['files/tests/support'],
366
+ :paths_source => ['files/source'],
367
+ :paths_include => ['files/source/include'],
368
+ }
369
+
370
+ expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", 'files/build/mocks']
371
+
372
+ out_hash = @builder.collect_test_and_source_include_paths(in_hash)
373
+
374
+ assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
375
+ end
376
+
377
+ should "collect all source and test include paths with both optional mocks paths and exception path" do
378
+ in_hash = {
379
+ :project_use_exceptions => true,
380
+ :project_use_mocks => true,
381
+ :cmock_mock_path => 'files/build/mocks',
382
+ :paths_test => ['files/tests'],
383
+ :paths_support => ['files/tests/support'],
384
+ :paths_source => ['files/source'],
385
+ :paths_include => ['files/source/include'],
386
+ }
387
+
388
+ expected_include_paths = ['files/source', 'files/source/include', 'files/tests', 'files/tests/support', "#{CEEDLING_VENDOR}unity/src", "#{CEEDLING_VENDOR}c_exception/lib", 'files/build/mocks']
389
+
390
+ out_hash = @builder.collect_test_and_source_include_paths(in_hash)
391
+
392
+ assert_equal(expected_include_paths.sort, out_hash[:paths_test_and_source_include].sort)
393
+ end
394
+
395
+ ############# source and test paths #############
396
+
397
+ should "collect all source and test paths without optional mocks and exception paths" do
398
+ in_hash = {
399
+ :project_use_exceptions => false,
400
+ :project_use_mocks => false,
401
+ :paths_test => ['files/tests'],
402
+ :paths_support => ['files/tests/support'],
403
+ :paths_source => ['files/source'],
404
+ :project_test_runners_path => 'files/build/runners',
405
+ }
406
+
407
+ expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}unity/src"]
408
+
409
+ out_hash = @builder.collect_test_and_source_paths(in_hash)
410
+
411
+ assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
412
+ end
413
+
414
+ should "collect all source and test paths with optional mocks path but without exception path" do
415
+ in_hash = {
416
+ :project_use_exceptions => false,
417
+ :project_use_mocks => true,
418
+ :paths_test => ['files/tests'],
419
+ :paths_support => ['files/tests/support'],
420
+ :paths_source => ['files/source'],
421
+ :project_test_runners_path => 'files/build/runners',
422
+ :cmock_mock_path => 'files/build/mocks',
423
+ }
424
+
425
+ expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}unity/src"]
426
+
427
+ out_hash = @builder.collect_test_and_source_paths(in_hash)
428
+
429
+ assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
430
+ end
431
+
432
+ should "collect all source and test paths without optional mocks path but with exception path" do
433
+ in_hash = {
434
+ :project_use_exceptions => true,
435
+ :project_use_mocks => false,
436
+ :paths_test => ['files/tests'],
437
+ :paths_support => ['files/tests/support'],
438
+ :paths_source => ['files/source'],
439
+ :project_test_runners_path => 'files/build/runners',
440
+ }
441
+
442
+ expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
443
+
444
+ out_hash = @builder.collect_test_and_source_paths(in_hash)
445
+
446
+ assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
447
+ end
448
+
449
+ should "collect all source and test paths with both optional mocks path and exception path" do
450
+ in_hash = {
451
+ :project_use_exceptions => true,
452
+ :project_use_mocks => true,
453
+ :paths_test => ['files/tests'],
454
+ :paths_support => ['files/tests/support'],
455
+ :paths_source => ['files/source'],
456
+ :project_test_runners_path => 'files/build/runners',
457
+ :cmock_mock_path => 'files/build/mocks',
458
+ }
459
+
460
+ expected_paths = ['files/tests', 'files/tests/support', 'files/source', 'files/build/runners', 'files/build/mocks', "#{CEEDLING_VENDOR}c_exception/lib", "#{CEEDLING_VENDOR}unity/src"]
461
+
462
+ out_hash = @builder.collect_test_and_source_paths(in_hash)
463
+
464
+ assert_equal(expected_paths.sort, out_hash[:paths_test_and_source].sort)
465
+ end
466
+
467
+ ############# all tests #############
468
+
469
+ should "collect all tests" do
470
+ in_hash = {
471
+ :paths_test => ['tests/main', 'tests/other/**'],
472
+ :project_test_file_prefix => 'Test',
473
+ :extension_source => '.c'}
474
+
475
+ @file_wrapper.expects.instantiate_file_list.returns(@file_list)
476
+
477
+ @file_list.expects.include('tests/main/Test*.c')
478
+ @file_list.expects.include('tests/other/**/Test*.c')
479
+
480
+ assert_equal({:collection_all_tests => @file_list}, @builder.collect_tests(in_hash))
481
+ end
482
+
483
+ ############# all source #############
484
+
485
+ should "collect all source" do
486
+ in_hash = {
487
+ :paths_source => ['files/source', 'files/modules/**'],
488
+ :extension_source => '.c'}
489
+
490
+ @file_wrapper.expects.instantiate_file_list.returns(@file_list)
491
+
492
+ @file_list.expects.include('files/source/*.c')
493
+ @file_list.expects.include('files/modules/**/*.c')
494
+
495
+ assert_equal({:collection_all_source => @file_list}, @builder.collect_source(in_hash))
496
+ end
497
+
498
+ ############# all headers #############
499
+
500
+ should "collect all headers" do
501
+ in_hash = {
502
+ :paths_support => ['files/test/support/**'],
503
+ :paths_include => ['files/source/include'],
504
+ :paths_source => ['files/source', 'files/modules/**'],
505
+ :extension_header => '.h'}
506
+
507
+ @file_wrapper.expects.instantiate_file_list.returns(@file_list)
508
+
509
+ @file_list.expects.include('files/test/support/**/*.h')
510
+ @file_list.expects.include('files/source/*.h')
511
+ @file_list.expects.include('files/modules/**/*.h')
512
+ @file_list.expects.include('files/source/include/*.h')
513
+
514
+ assert_equal({:collection_all_headers => @file_list}, @builder.collect_headers(in_hash))
515
+ end
516
+
517
+ ############# collect environment files #############
518
+
519
+ should "collect environment source files plus project file but no user project file" do
520
+ @project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
521
+ @project_config_manager.expects.user_project_filepath.returns('')
522
+
523
+ out_hash = @builder.collect_code_generation_dependencies
524
+
525
+ assert_equal(
526
+ ["#{CEEDLING_VENDOR}cmock/release/build.info",
527
+ '/home/project/config/project.yaml'].sort,
528
+ out_hash[:collection_code_generation_dependencies].sort)
529
+ end
530
+
531
+ should "collect environment source files plus project file and user project file" do
532
+ @project_config_manager.expects.main_project_filepath.returns('/home/project/config/project.yaml')
533
+ @project_config_manager.expects.user_project_filepath.returns('/home/project/config/user.yaml')
534
+
535
+ out_hash = @builder.collect_code_generation_dependencies
536
+
537
+ assert_equal(
538
+ ["#{CEEDLING_VENDOR}cmock/release/build.info",
539
+ '/home/project/config/project.yaml',
540
+ '/home/project/config/user.yaml'].sort,
541
+ out_hash[:collection_code_generation_dependencies].sort)
542
+ end
543
+
544
+ ############# expand path globs #############
545
+
546
+ should "inspect each element of paths in config hash and expand any and all globs into a collection" do
547
+
548
+ create_mocks(:paths_collection1, :paths_collection2, :paths_collection3)
549
+ in_hash = {
550
+ :path_dummy => [],
551
+ :paths_custom => ['oh', 'yeah'],
552
+ :paths_source => ['files/source', 'files/modules/**'],
553
+ :paths_to_destruction => ['paths/sin', 'paths/avarice'],
554
+ :whatever => 'blah blah blah',
555
+ }
556
+
557
+ @file_system_utils.expects.collect_paths(['oh', 'yeah']).returns(@paths_collection1)
558
+ @file_system_utils.expects.collect_paths(['files/source', 'files/modules/**']).returns(@paths_collection2)
559
+ @file_system_utils.expects.collect_paths(['paths/sin', 'paths/avarice']).returns(@paths_collection3)
560
+
561
+ out_hash = @builder.expand_all_path_globs(in_hash)
562
+
563
+ assert_equal(@paths_collection1, out_hash[:collection_paths_custom])
564
+ assert_equal(@paths_collection2, out_hash[:collection_paths_source])
565
+ assert_equal(@paths_collection3, out_hash[:collection_paths_to_destruction])
566
+ end
567
+
568
+ end
569
+