ceedling 0.28.3 → 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (1101) hide show
  1. checksums.yaml +5 -5
  2. data/Gemfile +16 -16
  3. data/Gemfile.lock +17 -16
  4. data/README.md +107 -66
  5. data/Rakefile +11 -11
  6. data/assets/ceedling +3 -3
  7. data/assets/ceedling.cmd +1 -1
  8. data/assets/default_gitignore +5 -5
  9. data/assets/example_file.c +5 -5
  10. data/assets/example_file.h +6 -6
  11. data/assets/project_as_gem.yml +100 -90
  12. data/assets/project_with_guts.yml +101 -91
  13. data/assets/project_with_guts_gcov.yml +101 -91
  14. data/assets/test_example_file.c +13 -13
  15. data/assets/test_example_file_boom.c +13 -13
  16. data/assets/test_example_file_success.c +14 -14
  17. data/assets/test_example_file_verbose.c +12 -12
  18. data/bin/ceedling +337 -316
  19. data/ceedling.gemspec +36 -39
  20. data/ceedling.sublime-project +25 -0
  21. data/ceedling.sublime-workspace +1276 -0
  22. data/config/test_environment.rb +11 -11
  23. data/docs/CeedlingPacket.md +2119 -2060
  24. data/docs/ThrowTheSwitchCodingStandard.md +207 -207
  25. data/examples/blinky/project.yml +99 -98
  26. data/examples/blinky/rakefile.rb +31 -31
  27. data/examples/blinky/src/BlinkTask.c +21 -21
  28. data/examples/blinky/src/BlinkTask.h +6 -6
  29. data/examples/blinky/src/Configure.c +36 -36
  30. data/examples/blinky/src/Configure.h +6 -6
  31. data/examples/blinky/src/main.c +51 -51
  32. data/examples/blinky/src/main.h +9 -9
  33. data/examples/blinky/test/support/stub_interrupt.h +347 -347
  34. data/examples/blinky/test/support/stub_io.h +421 -421
  35. data/examples/blinky/test/support/stub_iom328p.h +883 -883
  36. data/examples/blinky/test/support/stub_sfr_defs.h +269 -269
  37. data/examples/blinky/test/test_BlinkTask.c +42 -42
  38. data/examples/blinky/test/test_Configure.c +29 -29
  39. data/examples/blinky/test/test_main.c +60 -60
  40. data/examples/temp_sensor/project.yml +76 -76
  41. data/examples/temp_sensor/rakefile.rb +6 -6
  42. data/examples/temp_sensor/src/AdcConductor.c +42 -42
  43. data/examples/temp_sensor/src/AdcConductor.h +13 -13
  44. data/examples/temp_sensor/src/AdcHardware.c +27 -27
  45. data/examples/temp_sensor/src/AdcHardware.h +11 -11
  46. data/examples/temp_sensor/src/AdcHardwareConfigurator.c +18 -18
  47. data/examples/temp_sensor/src/AdcHardwareConfigurator.h +10 -10
  48. data/examples/temp_sensor/src/AdcModel.c +33 -33
  49. data/examples/temp_sensor/src/AdcModel.h +13 -13
  50. data/examples/temp_sensor/src/AdcTemperatureSensor.c +51 -51
  51. data/examples/temp_sensor/src/AdcTemperatureSensor.h +10 -10
  52. data/examples/temp_sensor/src/Executor.c +25 -25
  53. data/examples/temp_sensor/src/Executor.h +9 -9
  54. data/examples/temp_sensor/src/IntrinsicsWrapper.c +18 -18
  55. data/examples/temp_sensor/src/IntrinsicsWrapper.h +7 -7
  56. data/examples/temp_sensor/src/Main.c +46 -46
  57. data/examples/temp_sensor/src/Main.h +7 -7
  58. data/examples/temp_sensor/src/Model.c +10 -10
  59. data/examples/temp_sensor/src/Model.h +8 -8
  60. data/examples/temp_sensor/src/ModelConfig.h +7 -7
  61. data/examples/temp_sensor/src/TaskScheduler.c +72 -72
  62. data/examples/temp_sensor/src/TaskScheduler.h +11 -11
  63. data/examples/temp_sensor/src/TemperatureCalculator.c +27 -27
  64. data/examples/temp_sensor/src/TemperatureCalculator.h +8 -8
  65. data/examples/temp_sensor/src/TemperatureFilter.c +38 -38
  66. data/examples/temp_sensor/src/TemperatureFilter.h +10 -10
  67. data/examples/temp_sensor/src/TimerConductor.c +15 -15
  68. data/examples/temp_sensor/src/TimerConductor.h +9 -9
  69. data/examples/temp_sensor/src/TimerConfigurator.c +51 -51
  70. data/examples/temp_sensor/src/TimerConfigurator.h +15 -15
  71. data/examples/temp_sensor/src/TimerHardware.c +15 -15
  72. data/examples/temp_sensor/src/TimerHardware.h +8 -8
  73. data/examples/temp_sensor/src/TimerInterruptConfigurator.c +55 -55
  74. data/examples/temp_sensor/src/TimerInterruptConfigurator.h +13 -13
  75. data/examples/temp_sensor/src/TimerInterruptHandler.c +25 -25
  76. data/examples/temp_sensor/src/TimerInterruptHandler.h +10 -10
  77. data/examples/temp_sensor/src/TimerModel.c +9 -9
  78. data/examples/temp_sensor/src/TimerModel.h +8 -8
  79. data/examples/temp_sensor/src/Types.h +90 -90
  80. data/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c +18 -18
  81. data/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h +8 -8
  82. data/examples/temp_sensor/src/UsartConductor.c +21 -21
  83. data/examples/temp_sensor/src/UsartConductor.h +7 -7
  84. data/examples/temp_sensor/src/UsartConfigurator.c +39 -39
  85. data/examples/temp_sensor/src/UsartConfigurator.h +13 -13
  86. data/examples/temp_sensor/src/UsartHardware.c +22 -22
  87. data/examples/temp_sensor/src/UsartHardware.h +9 -9
  88. data/examples/temp_sensor/src/UsartModel.c +34 -34
  89. data/examples/temp_sensor/src/UsartModel.h +10 -10
  90. data/examples/temp_sensor/src/UsartPutChar.c +16 -16
  91. data/examples/temp_sensor/src/UsartPutChar.h +8 -8
  92. data/examples/temp_sensor/src/UsartTransmitBufferStatus.c +7 -7
  93. data/examples/temp_sensor/src/UsartTransmitBufferStatus.h +8 -8
  94. data/examples/temp_sensor/test/TestAdcConductor.c +121 -121
  95. data/examples/temp_sensor/test/TestAdcHardware.c +44 -44
  96. data/examples/temp_sensor/test/TestAdcModel.c +33 -33
  97. data/examples/temp_sensor/test/TestExecutor.c +36 -36
  98. data/examples/temp_sensor/test/TestMain.c +24 -24
  99. data/examples/temp_sensor/test/TestModel.c +20 -20
  100. data/examples/temp_sensor/test/TestTaskScheduler.c +104 -104
  101. data/examples/temp_sensor/test/TestTemperatureCalculator.c +36 -36
  102. data/examples/temp_sensor/test/TestTemperatureFilter.c +79 -79
  103. data/examples/temp_sensor/test/TestTimerConductor.c +32 -32
  104. data/examples/temp_sensor/test/TestTimerHardware.c +26 -26
  105. data/examples/temp_sensor/test/TestTimerModel.c +18 -18
  106. data/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c +21 -21
  107. data/examples/temp_sensor/test/TestUsartConductor.c +40 -40
  108. data/examples/temp_sensor/test/TestUsartHardware.c +36 -36
  109. data/examples/temp_sensor/test/TestUsartModel.c +40 -40
  110. data/examples/temp_sensor/test/support/UnityHelper.c +12 -12
  111. data/examples/temp_sensor/test/support/UnityHelper.h +12 -12
  112. data/lib/ceedling.rb +99 -99
  113. data/lib/ceedling/build_invoker_utils.rb +39 -39
  114. data/lib/ceedling/cacheinator.rb +47 -42
  115. data/lib/ceedling/cacheinator_helper.rb +31 -12
  116. data/lib/ceedling/cmock_builder.rb +15 -15
  117. data/lib/ceedling/configurator.rb +363 -356
  118. data/lib/ceedling/configurator_builder.rb +458 -451
  119. data/lib/ceedling/configurator_plugins.rb +111 -111
  120. data/lib/ceedling/configurator_setup.rb +127 -127
  121. data/lib/ceedling/configurator_validator.rb +193 -193
  122. data/lib/ceedling/constants.rb +97 -97
  123. data/lib/ceedling/defaults.rb +418 -418
  124. data/lib/ceedling/dependinator.rb +98 -91
  125. data/lib/ceedling/erb_wrapper.rb +8 -8
  126. data/lib/ceedling/file_finder.rb +149 -149
  127. data/lib/ceedling/file_finder_helper.rb +54 -54
  128. data/lib/ceedling/file_path_utils.rb +200 -200
  129. data/lib/ceedling/file_system_utils.rb +69 -69
  130. data/lib/ceedling/file_system_wrapper.rb +9 -9
  131. data/lib/ceedling/file_wrapper.rb +83 -83
  132. data/lib/ceedling/flaginator.rb +74 -74
  133. data/lib/ceedling/generator.rb +183 -176
  134. data/lib/ceedling/generator_helper.rb +40 -40
  135. data/lib/ceedling/generator_test_results.rb +89 -89
  136. data/lib/ceedling/generator_test_results_sanity_checker.rb +65 -65
  137. data/lib/ceedling/generator_test_runner.rb +56 -52
  138. data/lib/ceedling/loginator.rb +31 -31
  139. data/lib/ceedling/makefile.rb +46 -46
  140. data/lib/ceedling/objects.yml +310 -307
  141. data/lib/ceedling/par_map.rb +19 -19
  142. data/lib/ceedling/plugin.rb +80 -80
  143. data/lib/ceedling/plugin_builder.rb +52 -52
  144. data/lib/ceedling/plugin_manager.rb +107 -107
  145. data/lib/ceedling/plugin_manager_helper.rb +19 -19
  146. data/lib/ceedling/plugin_reportinator.rb +76 -76
  147. data/lib/ceedling/plugin_reportinator_helper.rb +51 -51
  148. data/lib/ceedling/preprocessinator.rb +42 -43
  149. data/lib/ceedling/preprocessinator_extractor.rb +30 -30
  150. data/lib/ceedling/preprocessinator_file_handler.rb +21 -21
  151. data/lib/ceedling/preprocessinator_helper.rb +46 -46
  152. data/lib/ceedling/preprocessinator_includes_handler.rb +181 -96
  153. data/lib/ceedling/project_config_manager.rb +46 -37
  154. data/lib/ceedling/project_file_loader.rb +99 -99
  155. data/lib/ceedling/rake_utils.rb +17 -17
  156. data/lib/ceedling/rake_wrapper.rb +33 -33
  157. data/lib/ceedling/rakefile.rb +86 -86
  158. data/lib/ceedling/release_invoker.rb +73 -73
  159. data/lib/ceedling/release_invoker_helper.rb +19 -19
  160. data/lib/ceedling/reportinator.rb +26 -26
  161. data/lib/ceedling/rules_cmock.rake +9 -9
  162. data/lib/ceedling/rules_preprocess.rake +26 -26
  163. data/lib/ceedling/rules_release.rake +86 -86
  164. data/lib/ceedling/rules_release_deep_dependencies.rake +15 -15
  165. data/lib/ceedling/rules_tests.rake +74 -74
  166. data/lib/ceedling/rules_tests_deep_dependencies.rake +15 -15
  167. data/lib/ceedling/setupinator.rb +53 -53
  168. data/lib/ceedling/stream_wrapper.rb +28 -20
  169. data/lib/ceedling/streaminator.rb +40 -40
  170. data/lib/ceedling/streaminator_helper.rb +15 -15
  171. data/lib/ceedling/system_utils.rb +37 -37
  172. data/lib/ceedling/system_wrapper.rb +80 -80
  173. data/lib/ceedling/target_loader.rb +38 -38
  174. data/lib/ceedling/task_invoker.rb +117 -101
  175. data/lib/ceedling/tasks_base.rake +111 -112
  176. data/lib/ceedling/tasks_filesystem.rake +103 -100
  177. data/lib/ceedling/tasks_release.rake +30 -30
  178. data/lib/ceedling/tasks_release_deep_dependencies.rake +9 -9
  179. data/lib/ceedling/tasks_tests.rake +60 -55
  180. data/lib/ceedling/tasks_tests_deep_dependencies.rake +9 -9
  181. data/lib/ceedling/tasks_vendor.rake +35 -35
  182. data/lib/ceedling/test_includes_extractor.rb +85 -85
  183. data/lib/ceedling/test_invoker.rb +188 -164
  184. data/lib/ceedling/test_invoker_helper.rb +32 -32
  185. data/lib/ceedling/tool_executor.rb +229 -223
  186. data/lib/ceedling/tool_executor_helper.rb +164 -164
  187. data/lib/ceedling/verbosinator.rb +10 -10
  188. data/lib/ceedling/version.rb +36 -15
  189. data/lib/ceedling/yaml_wrapper.rb +17 -17
  190. data/license.txt +31 -31
  191. data/out.fail +22 -21
  192. data/plugins/beep/README.md +22 -22
  193. data/plugins/beep/lib/beep.rb +40 -40
  194. data/plugins/bullseye/assets/template.erb +15 -15
  195. data/plugins/bullseye/bullseye.rake +169 -169
  196. data/plugins/bullseye/config/defaults.yml +57 -57
  197. data/plugins/bullseye/lib/bullseye.rb +194 -194
  198. data/plugins/colour_report/lib/colour_report.rb +16 -0
  199. data/plugins/command_hooks/README.md +53 -52
  200. data/plugins/command_hooks/lib/command_hooks.rb +92 -75
  201. data/plugins/fake_function_framework/README.md +250 -250
  202. data/plugins/fake_function_framework/Rakefile +18 -18
  203. data/plugins/fake_function_framework/examples/fff_example/project.yml +71 -71
  204. data/plugins/fake_function_framework/examples/fff_example/rakefile.rb +7 -7
  205. data/plugins/fake_function_framework/examples/fff_example/src/bar.c +1 -1
  206. data/plugins/fake_function_framework/examples/fff_example/src/bar.h +14 -14
  207. data/plugins/fake_function_framework/examples/fff_example/src/custom_types.h +6 -6
  208. data/plugins/fake_function_framework/examples/fff_example/src/display.c +6 -6
  209. data/plugins/fake_function_framework/examples/fff_example/src/display.h +16 -16
  210. data/plugins/fake_function_framework/examples/fff_example/src/event_processor.c +93 -93
  211. data/plugins/fake_function_framework/examples/fff_example/src/event_processor.h +11 -11
  212. data/plugins/fake_function_framework/examples/fff_example/src/foo.c +16 -16
  213. data/plugins/fake_function_framework/examples/fff_example/src/foo.h +8 -8
  214. data/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.c +1 -1
  215. data/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.h +6 -6
  216. data/plugins/fake_function_framework/examples/fff_example/test/test_event_processor.c +155 -155
  217. data/plugins/fake_function_framework/examples/fff_example/test/test_foo.c +47 -47
  218. data/plugins/fake_function_framework/lib/fake_function_framework.rb +87 -87
  219. data/plugins/fake_function_framework/lib/fff_mock_generator.rb +163 -163
  220. data/plugins/fake_function_framework/spec/fff_mock_header_generator_spec.rb +304 -304
  221. data/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb +148 -148
  222. data/plugins/fake_function_framework/spec/header_generator.rb +50 -50
  223. data/plugins/fake_function_framework/spec/spec_helper.rb +96 -96
  224. data/plugins/fake_function_framework/src/fff_unity_helper.h +32 -32
  225. data/plugins/gcov/README.md +101 -42
  226. data/plugins/gcov/assets/template.erb +15 -15
  227. data/plugins/gcov/config/defaults.yml +73 -66
  228. data/plugins/gcov/gcov.rake +220 -180
  229. data/plugins/gcov/lib/gcov.rb +113 -106
  230. data/plugins/gcov/lib/gcov_constants.rb +19 -18
  231. data/plugins/junit_tests_report/README.md +36 -0
  232. data/plugins/junit_tests_report/lib/junit_tests_report.rb +129 -118
  233. data/plugins/module_generator/config/module_generator.yml +3 -3
  234. data/plugins/module_generator/lib/module_generator.rb +70 -51
  235. data/plugins/module_generator/module_generator.rake +47 -43
  236. data/plugins/raw_output_report/lib/raw_output_report.rb +41 -41
  237. data/plugins/stdout_gtestlike_tests_report/assets/template.erb +84 -84
  238. data/plugins/stdout_gtestlike_tests_report/assets/template.erb copy +59 -59
  239. data/plugins/stdout_gtestlike_tests_report/config/stdout_gtestlike_tests_report.yml +4 -4
  240. data/plugins/stdout_gtestlike_tests_report/lib/stdout_gtestlike_tests_report.rb +43 -43
  241. data/plugins/stdout_ide_tests_report/config/stdout_ide_tests_report.yml +4 -4
  242. data/plugins/stdout_ide_tests_report/lib/stdout_ide_tests_report.rb +44 -44
  243. data/plugins/stdout_pretty_tests_report/assets/template.erb +59 -59
  244. data/plugins/stdout_pretty_tests_report/config/stdout_pretty_tests_report.yml +4 -4
  245. data/plugins/stdout_pretty_tests_report/lib/stdout_pretty_tests_report.rb +47 -47
  246. data/plugins/subprojects/README.md +63 -63
  247. data/plugins/subprojects/config/defaults.yml +33 -33
  248. data/plugins/subprojects/lib/subprojects.rb +92 -92
  249. data/plugins/subprojects/subprojects.rake +78 -78
  250. data/plugins/teamcity_tests_report/config/teamcity_tests_report.yml +4 -4
  251. data/plugins/teamcity_tests_report/lib/teamcity_tests_report.rb +57 -57
  252. data/plugins/warnings_report/lib/warnings_report.rb +69 -69
  253. data/plugins/xml_tests_report/README.md +36 -0
  254. data/plugins/xml_tests_report/lib/xml_tests_report.rb +110 -108
  255. data/spec/build_invoker_utils_spec.rb +54 -54
  256. data/spec/ceedling_spec.rb +154 -154
  257. data/spec/configurator_builder_spec.rb +6 -6
  258. data/spec/configurator_helper_spec.rb +4 -4
  259. data/spec/configurator_spec.rb +9 -9
  260. data/spec/file_finder_helper_spec.rb +53 -53
  261. data/spec/gcov/gcov_deployment_spec.rb +70 -70
  262. data/spec/gcov/gcov_test_cases_spec.rb +91 -91
  263. data/spec/generator_test_results_sanity_checker_spec.rb +88 -88
  264. data/spec/generator_test_results_spec.rb +107 -107
  265. data/spec/par_map_spec.rb +57 -57
  266. data/spec/preprocessinator_extractor_spec.rb +45 -45
  267. data/spec/preprocessinator_includes_handler_spec.rb +202 -186
  268. data/spec/reportinator_spec.rb +19 -19
  269. data/spec/spec_helper.rb +27 -27
  270. data/spec/spec_system_helper.rb +575 -481
  271. data/spec/support/test_example.fail +22 -22
  272. data/spec/support/test_example.pass +22 -22
  273. data/spec/support/test_example_empty.pass +14 -14
  274. data/spec/support/test_example_ignore.pass +22 -22
  275. data/spec/support/test_example_mangled.pass +20 -20
  276. data/spec/support/test_example_with_time.pass +22 -22
  277. data/spec/system/deployment_spec.rb +219 -197
  278. data/spec/system_utils_spec.rb +56 -56
  279. data/spec/target_loader_spec.rb +30 -30
  280. data/spec/tool_executor_helper_spec.rb +310 -310
  281. data/spec/uncatagorized_specs_spec.rb +8 -8
  282. data/vendor/behaviors/Manifest.txt +9 -9
  283. data/vendor/behaviors/Rakefile +19 -19
  284. data/vendor/behaviors/lib/behaviors.rb +76 -76
  285. data/vendor/behaviors/lib/behaviors/reporttask.rb +158 -158
  286. data/vendor/behaviors/test/behaviors_tasks_test.rb +73 -73
  287. data/vendor/behaviors/test/behaviors_test.rb +50 -50
  288. data/vendor/behaviors/test/tasks_test/Rakefile +19 -19
  289. data/vendor/behaviors/test/tasks_test/lib/user.rb +2 -2
  290. data/vendor/behaviors/test/tasks_test/test/user_test.rb +17 -17
  291. data/vendor/c_exception/Gemfile +4 -4
  292. data/vendor/c_exception/Gemfile.lock +12 -12
  293. data/vendor/c_exception/LICENSE.txt +30 -30
  294. data/vendor/c_exception/README.md +162 -162
  295. data/vendor/c_exception/Rakefile +42 -42
  296. data/vendor/c_exception/docs/CException.md +292 -292
  297. data/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -207
  298. data/vendor/c_exception/lib/CException.c +46 -46
  299. data/vendor/c_exception/lib/CException.h +115 -110
  300. data/vendor/c_exception/makefile +23 -23
  301. data/vendor/c_exception/test/CExceptionConfig.h +46 -46
  302. data/vendor/c_exception/test/TestException.c +391 -391
  303. data/vendor/c_exception/test/TestException_Runner.c +67 -67
  304. data/vendor/c_exception/vendor/unity/README.md +220 -0
  305. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +118 -0
  306. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +39 -0
  307. data/vendor/c_exception/vendor/unity/auto/generate_config.yml +36 -0
  308. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +308 -0
  309. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +437 -0
  310. data/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
  311. data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +252 -0
  312. data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +25 -0
  313. data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +6 -0
  314. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +139 -0
  315. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +136 -0
  316. data/vendor/c_exception/vendor/unity/auto/unity_to_junit.py +146 -0
  317. data/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  318. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  319. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  320. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  321. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  322. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  323. data/vendor/{cmock → c_exception}/vendor/unity/docs/license.txt +21 -21
  324. data/vendor/c_exception/vendor/unity/examples/example_1/makefile +71 -0
  325. data/vendor/c_exception/vendor/unity/examples/example_1/readme.txt +5 -0
  326. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.c +24 -0
  327. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.h +3 -0
  328. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.c +11 -0
  329. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.h +2 -0
  330. data/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode.c +62 -0
  331. data/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode2.c +31 -0
  332. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -0
  333. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -0
  334. data/vendor/c_exception/vendor/unity/examples/example_2/makefile +70 -0
  335. data/vendor/c_exception/vendor/unity/examples/example_2/readme.txt +5 -0
  336. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode.c +24 -0
  337. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode.h +3 -0
  338. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.c +11 -0
  339. data/vendor/c_exception/vendor/unity/examples/example_2/src/ProductionCode2.h +2 -0
  340. data/vendor/c_exception/vendor/unity/examples/example_2/test/TestProductionCode.c +64 -0
  341. data/vendor/c_exception/vendor/unity/examples/example_2/test/TestProductionCode2.c +33 -0
  342. data/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
  343. data/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
  344. data/vendor/c_exception/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
  345. data/vendor/c_exception/vendor/unity/examples/example_3/helper/UnityHelper.c +10 -0
  346. data/vendor/c_exception/vendor/unity/examples/example_3/helper/UnityHelper.h +12 -0
  347. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +43 -0
  348. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +249 -0
  349. data/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +13 -0
  350. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode.c +24 -0
  351. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode.h +3 -0
  352. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.c +11 -0
  353. data/vendor/c_exception/vendor/unity/examples/example_3/src/ProductionCode2.h +2 -0
  354. data/vendor/c_exception/vendor/unity/examples/example_3/target_gcc_32.yml +46 -0
  355. data/vendor/c_exception/vendor/unity/examples/example_3/test/TestProductionCode.c +62 -0
  356. data/vendor/c_exception/vendor/unity/examples/example_3/test/TestProductionCode2.c +31 -0
  357. data/vendor/c_exception/vendor/unity/examples/unity_config.h +237 -0
  358. data/vendor/c_exception/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
  359. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +48 -0
  360. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +178 -0
  361. data/vendor/{cmock → c_exception}/vendor/unity/extras/fixture/readme.txt +8 -8
  362. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +432 -0
  363. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +83 -0
  364. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +51 -0
  365. data/vendor/{unity → c_exception/vendor/unity}/extras/fixture/src/unity_fixture_malloc_overrides.h +47 -47
  366. data/vendor/c_exception/vendor/unity/extras/fixture/test/Makefile +74 -0
  367. data/vendor/c_exception/vendor/unity/extras/fixture/test/main/AllTests.c +22 -0
  368. data/vendor/c_exception/vendor/unity/extras/fixture/test/template_fixture_tests.c +39 -0
  369. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +543 -0
  370. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +57 -0
  371. data/vendor/{cmock → c_exception}/vendor/unity/extras/fixture/test/unity_output_Spy.c +57 -57
  372. data/vendor/{cmock → c_exception}/vendor/unity/extras/fixture/test/unity_output_Spy.h +17 -17
  373. data/vendor/c_exception/vendor/unity/release/build.info +2 -0
  374. data/vendor/c_exception/vendor/unity/release/version.info +2 -0
  375. data/vendor/c_exception/vendor/unity/src/unity.c +1517 -0
  376. data/vendor/c_exception/vendor/unity/src/unity.h +339 -0
  377. data/vendor/c_exception/vendor/unity/src/unity_internals.h +784 -0
  378. data/vendor/c_exception/vendor/unity/test/Makefile +63 -0
  379. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +61 -0
  380. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +57 -0
  381. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.c +55 -0
  382. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.h +15 -0
  383. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +80 -0
  384. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +76 -0
  385. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -0
  386. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -0
  387. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +89 -0
  388. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +89 -0
  389. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +77 -0
  390. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +89 -0
  391. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +89 -0
  392. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +90 -0
  393. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +67 -0
  394. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +70 -0
  395. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +58 -0
  396. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +67 -0
  397. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +70 -0
  398. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +71 -0
  399. data/vendor/c_exception/vendor/unity/test/rakefile +125 -0
  400. data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +260 -0
  401. data/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  402. data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +78 -0
  403. data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +78 -0
  404. data/vendor/c_exception/vendor/unity/test/targets/gcc_32.yml +49 -0
  405. data/vendor/c_exception/vendor/unity/test/targets/gcc_64.yml +50 -0
  406. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_limits.yml +47 -0
  407. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_stdint.yml +59 -0
  408. data/vendor/c_exception/vendor/unity/test/targets/gcc_manual_math.yml +47 -0
  409. data/vendor/c_exception/vendor/unity/test/targets/hitech_picc18.yml +101 -0
  410. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v4.yml +90 -0
  411. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5.yml +80 -0
  412. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5_3.yml +80 -0
  413. data/vendor/c_exception/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +94 -0
  414. data/vendor/c_exception/vendor/unity/test/targets/iar_cortexm3_v5.yml +84 -0
  415. data/vendor/c_exception/vendor/unity/test/targets/iar_msp430.yml +95 -0
  416. data/vendor/c_exception/vendor/unity/test/targets/iar_sh2a_v6.yml +86 -0
  417. data/vendor/c_exception/vendor/unity/test/testdata/CException.h +11 -0
  418. data/vendor/c_exception/vendor/unity/test/testdata/Defs.h +8 -0
  419. data/vendor/c_exception/vendor/unity/test/testdata/cmock.h +14 -0
  420. data/vendor/c_exception/vendor/unity/test/testdata/mockMock.h +13 -0
  421. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGenerator.c +183 -0
  422. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +67 -0
  423. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +192 -0
  424. data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +1252 -0
  425. data/vendor/c_exception/vendor/unity/test/tests/testparameterized.c +110 -0
  426. data/vendor/c_exception/vendor/unity/test/tests/testunity.c +4993 -0
  427. data/vendor/cmock/Gemfile +9 -9
  428. data/vendor/cmock/{docs/license.txt → LICENSE.txt} +18 -18
  429. data/vendor/cmock/README.md +34 -34
  430. data/vendor/cmock/config/production_environment.rb +14 -14
  431. data/vendor/cmock/config/test_environment.rb +16 -16
  432. data/vendor/cmock/docs/CMock_Summary.md +689 -603
  433. data/vendor/cmock/docs/ThrowTheSwitchCodingStandard.md +207 -207
  434. data/vendor/cmock/examples/make_example/Makefile +30 -30
  435. data/vendor/cmock/examples/make_example/src/foo.c +5 -5
  436. data/vendor/cmock/examples/make_example/src/foo.h +5 -5
  437. data/vendor/cmock/examples/make_example/src/main.c +15 -15
  438. data/vendor/cmock/examples/make_example/test/test_foo.c +17 -17
  439. data/vendor/cmock/examples/make_example/test/test_main.c +15 -15
  440. data/vendor/cmock/examples/temp_sensor/gcc.yml +44 -44
  441. data/vendor/cmock/examples/temp_sensor/iar_v4.yml +92 -92
  442. data/vendor/cmock/examples/temp_sensor/iar_v5.yml +81 -81
  443. data/vendor/cmock/examples/temp_sensor/rakefile.rb +42 -42
  444. data/vendor/cmock/examples/temp_sensor/rakefile_helper.rb +272 -272
  445. data/vendor/cmock/examples/temp_sensor/src/AT91SAM7X256.h +2556 -2556
  446. data/vendor/cmock/examples/temp_sensor/src/AdcConductor.c +42 -42
  447. data/vendor/cmock/examples/temp_sensor/src/AdcConductor.h +11 -11
  448. data/vendor/cmock/examples/temp_sensor/src/AdcHardware.c +27 -27
  449. data/vendor/cmock/examples/temp_sensor/src/AdcHardware.h +9 -9
  450. data/vendor/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.c +18 -18
  451. data/vendor/cmock/examples/temp_sensor/src/AdcHardwareConfigurator.h +10 -10
  452. data/vendor/cmock/examples/temp_sensor/src/AdcModel.c +33 -33
  453. data/vendor/cmock/examples/temp_sensor/src/AdcModel.h +13 -13
  454. data/vendor/cmock/examples/temp_sensor/src/AdcTemperatureSensor.c +51 -51
  455. data/vendor/cmock/examples/temp_sensor/src/AdcTemperatureSensor.h +10 -10
  456. data/vendor/cmock/examples/temp_sensor/src/Executor.c +25 -25
  457. data/vendor/cmock/examples/temp_sensor/src/Executor.h +9 -9
  458. data/vendor/cmock/examples/temp_sensor/src/IntrinsicsWrapper.c +18 -18
  459. data/vendor/cmock/examples/temp_sensor/src/IntrinsicsWrapper.h +7 -7
  460. data/vendor/cmock/examples/temp_sensor/src/Main.c +46 -46
  461. data/vendor/cmock/examples/temp_sensor/src/Main.h +7 -7
  462. data/vendor/cmock/examples/temp_sensor/src/Model.c +10 -10
  463. data/vendor/cmock/examples/temp_sensor/src/Model.h +8 -8
  464. data/vendor/cmock/examples/temp_sensor/src/ModelConfig.h +7 -7
  465. data/vendor/cmock/examples/temp_sensor/src/TaskScheduler.c +72 -72
  466. data/vendor/cmock/examples/temp_sensor/src/TaskScheduler.h +11 -11
  467. data/vendor/cmock/examples/temp_sensor/src/TemperatureCalculator.c +27 -27
  468. data/vendor/cmock/examples/temp_sensor/src/TemperatureCalculator.h +6 -6
  469. data/vendor/cmock/examples/temp_sensor/src/TemperatureFilter.c +39 -39
  470. data/vendor/cmock/examples/temp_sensor/src/TemperatureFilter.h +10 -10
  471. data/vendor/cmock/examples/temp_sensor/src/TimerConductor.c +15 -15
  472. data/vendor/cmock/examples/temp_sensor/src/TimerConductor.h +9 -9
  473. data/vendor/cmock/examples/temp_sensor/src/TimerConfigurator.c +51 -51
  474. data/vendor/cmock/examples/temp_sensor/src/TimerConfigurator.h +15 -15
  475. data/vendor/cmock/examples/temp_sensor/src/TimerHardware.c +15 -15
  476. data/vendor/cmock/examples/temp_sensor/src/TimerHardware.h +8 -8
  477. data/vendor/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.c +55 -55
  478. data/vendor/cmock/examples/temp_sensor/src/TimerInterruptConfigurator.h +13 -13
  479. data/vendor/cmock/examples/temp_sensor/src/TimerInterruptHandler.c +25 -25
  480. data/vendor/cmock/examples/temp_sensor/src/TimerInterruptHandler.h +10 -10
  481. data/vendor/cmock/examples/temp_sensor/src/TimerModel.c +9 -9
  482. data/vendor/cmock/examples/temp_sensor/src/TimerModel.h +8 -8
  483. data/vendor/cmock/examples/temp_sensor/src/Types.h +103 -103
  484. data/vendor/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.c +18 -18
  485. data/vendor/cmock/examples/temp_sensor/src/UsartBaudRateRegisterCalculator.h +6 -6
  486. data/vendor/cmock/examples/temp_sensor/src/UsartConductor.c +21 -21
  487. data/vendor/cmock/examples/temp_sensor/src/UsartConductor.h +7 -7
  488. data/vendor/cmock/examples/temp_sensor/src/UsartConfigurator.c +39 -39
  489. data/vendor/cmock/examples/temp_sensor/src/UsartConfigurator.h +13 -13
  490. data/vendor/cmock/examples/temp_sensor/src/UsartHardware.c +22 -22
  491. data/vendor/cmock/examples/temp_sensor/src/UsartHardware.h +9 -9
  492. data/vendor/cmock/examples/temp_sensor/src/UsartModel.c +34 -34
  493. data/vendor/cmock/examples/temp_sensor/src/UsartModel.h +10 -10
  494. data/vendor/cmock/examples/temp_sensor/src/UsartPutChar.c +16 -16
  495. data/vendor/cmock/examples/temp_sensor/src/UsartPutChar.h +8 -8
  496. data/vendor/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.c +7 -7
  497. data/vendor/cmock/examples/temp_sensor/src/UsartTransmitBufferStatus.h +8 -8
  498. data/vendor/cmock/examples/temp_sensor/test/TestAdcConductor.c +121 -121
  499. data/vendor/cmock/examples/temp_sensor/test/TestAdcHardware.c +44 -44
  500. data/vendor/cmock/examples/temp_sensor/test/TestAdcHardwareConfigurator.c +43 -43
  501. data/vendor/cmock/examples/temp_sensor/test/TestAdcModel.c +33 -33
  502. data/vendor/cmock/examples/temp_sensor/test/TestAdcTemperatureSensor.c +47 -47
  503. data/vendor/cmock/examples/temp_sensor/test/TestExecutor.c +36 -36
  504. data/vendor/cmock/examples/temp_sensor/test/TestMain.c +24 -24
  505. data/vendor/cmock/examples/temp_sensor/test/TestModel.c +20 -20
  506. data/vendor/cmock/examples/temp_sensor/test/TestTaskScheduler.c +104 -104
  507. data/vendor/cmock/examples/temp_sensor/test/TestTemperatureCalculator.c +33 -33
  508. data/vendor/cmock/examples/temp_sensor/test/TestTemperatureFilter.c +69 -69
  509. data/vendor/cmock/examples/temp_sensor/test/TestTimerConductor.c +32 -32
  510. data/vendor/cmock/examples/temp_sensor/test/TestTimerConfigurator.c +112 -112
  511. data/vendor/cmock/examples/temp_sensor/test/TestTimerHardware.c +26 -26
  512. data/vendor/cmock/examples/temp_sensor/test/TestTimerInterruptConfigurator.c +78 -78
  513. data/vendor/cmock/examples/temp_sensor/test/TestTimerInterruptHandler.c +66 -66
  514. data/vendor/cmock/examples/temp_sensor/test/TestTimerModel.c +18 -18
  515. data/vendor/cmock/examples/temp_sensor/test/TestUsartBaudRateRegisterCalculator.c +21 -21
  516. data/vendor/cmock/examples/temp_sensor/test/TestUsartConductor.c +40 -40
  517. data/vendor/cmock/examples/temp_sensor/test/TestUsartConfigurator.c +77 -77
  518. data/vendor/cmock/examples/temp_sensor/test/TestUsartHardware.c +37 -37
  519. data/vendor/cmock/examples/temp_sensor/test/TestUsartModel.c +40 -40
  520. data/vendor/cmock/examples/temp_sensor/test/TestUsartPutChar.c +43 -43
  521. data/vendor/cmock/examples/temp_sensor/test/TestUsartTransmitBufferStatus.c +22 -22
  522. data/vendor/cmock/lib/cmock.rb +86 -86
  523. data/vendor/cmock/lib/cmock_config.rb +153 -145
  524. data/vendor/cmock/lib/cmock_file_writer.rb +44 -44
  525. data/vendor/cmock/lib/cmock_generator.rb +268 -264
  526. data/vendor/cmock/lib/cmock_generator_plugin_array.rb +63 -63
  527. data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +88 -98
  528. data/vendor/cmock/lib/cmock_generator_plugin_cexception.rb +51 -51
  529. data/vendor/cmock/lib/cmock_generator_plugin_expect.rb +103 -104
  530. data/vendor/cmock/lib/cmock_generator_plugin_expect_any_args.rb +53 -54
  531. data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +75 -75
  532. data/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb +42 -42
  533. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +79 -73
  534. data/vendor/cmock/lib/cmock_generator_utils.rb +253 -240
  535. data/vendor/cmock/lib/cmock_header_parser.rb +364 -337
  536. data/vendor/cmock/lib/cmock_plugin_manager.rb +55 -55
  537. data/vendor/cmock/lib/cmock_unityhelper_parser.rb +75 -75
  538. data/vendor/cmock/meson.build +72 -0
  539. data/vendor/cmock/scripts/create_makefile.rb +202 -202
  540. data/vendor/cmock/scripts/create_mock.rb +8 -8
  541. data/vendor/cmock/scripts/create_runner.rb +20 -20
  542. data/vendor/cmock/scripts/test_summary.rb +19 -19
  543. data/vendor/cmock/src/cmock.c +216 -210
  544. data/vendor/cmock/src/cmock.h +40 -38
  545. data/vendor/cmock/src/cmock_internals.h +91 -89
  546. data/vendor/cmock/src/meson.build +17 -0
  547. data/vendor/cmock/test/c/TestCMockC.c +333 -323
  548. data/vendor/cmock/test/c/TestCMockC.yml +14 -13
  549. data/vendor/cmock/test/c/TestCMockCDynamic.c +186 -186
  550. data/vendor/cmock/test/c/TestCMockCDynamic.yml +12 -12
  551. data/vendor/cmock/test/c/TestCMockCDynamic_Runner.c +36 -36
  552. data/vendor/cmock/test/c/TestCMockC_Runner.c +41 -39
  553. data/vendor/cmock/test/iar/iar_v4/Resource/at91SAM7X256_FLASH.xcl +185 -185
  554. data/vendor/cmock/test/iar/iar_v4/Resource/at91SAM7X256_RAM.xcl +185 -185
  555. data/vendor/cmock/test/iar/iar_v4/Resource/ioat91sam7x256.ddf +2259 -2259
  556. data/vendor/cmock/test/iar/iar_v4/cmock_demo.dep +3691 -3691
  557. data/vendor/cmock/test/iar/iar_v4/cmock_demo.ewp +2581 -2581
  558. data/vendor/cmock/test/iar/iar_v4/incIAR/AT91SAM7X-EK.h +61 -61
  559. data/vendor/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.inc +2314 -2314
  560. data/vendor/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.rdf +4704 -4704
  561. data/vendor/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256.tcl +3407 -3407
  562. data/vendor/cmock/test/iar/iar_v4/incIAR/AT91SAM7X256_inc.h +2268 -2268
  563. data/vendor/cmock/test/iar/iar_v4/incIAR/ioat91sam7x256.h +4380 -4380
  564. data/vendor/cmock/test/iar/iar_v4/incIAR/lib_AT91SAM7X256.h +4211 -4211
  565. data/vendor/cmock/test/iar/iar_v4/settings/cmock_demo.cspy.bat +32 -32
  566. data/vendor/cmock/test/iar/iar_v4/srcIAR/Cstartup.s79 +265 -265
  567. data/vendor/cmock/test/iar/iar_v4/srcIAR/Cstartup_SAM7.c +98 -98
  568. data/vendor/cmock/test/iar/iar_v5/Resource/at91SAM7X256_FLASH.icf +43 -43
  569. data/vendor/cmock/test/iar/iar_v5/Resource/at91SAM7X256_RAM.icf +42 -42
  570. data/vendor/cmock/test/iar/iar_v5/cmock_demo.dep +4204 -4204
  571. data/vendor/cmock/test/iar/iar_v5/cmock_demo.ewp +2426 -2426
  572. data/vendor/cmock/test/iar/iar_v5/incIAR/AT91SAM7X-EK.h +61 -61
  573. data/vendor/cmock/test/iar/iar_v5/incIAR/AT91SAM7X256_inc.h +2268 -2268
  574. data/vendor/cmock/test/iar/iar_v5/incIAR/lib_AT91SAM7X256.h +4211 -4211
  575. data/vendor/cmock/test/iar/iar_v5/incIAR/project.h +30 -30
  576. data/vendor/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +33 -33
  577. data/vendor/cmock/test/iar/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +12 -12
  578. data/vendor/cmock/test/iar/iar_v5/settings/cmock_demo.cspy.bat +33 -33
  579. data/vendor/cmock/test/iar/iar_v5/settings/cmock_demo_Binary.jlink +12 -12
  580. data/vendor/cmock/test/iar/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +12 -12
  581. data/vendor/cmock/test/iar/iar_v5/settings/cmock_demo_RAM_Debug.jlink +12 -12
  582. data/vendor/cmock/test/iar/iar_v5/srcIAR/Cstartup.s +299 -299
  583. data/vendor/cmock/test/iar/iar_v5/srcIAR/Cstartup_SAM7.c +98 -98
  584. data/vendor/cmock/test/rakefile +106 -106
  585. data/vendor/cmock/test/rakefile_helper.rb +382 -381
  586. data/vendor/cmock/test/system/systest_generator.rb +193 -194
  587. data/vendor/cmock/test/system/test_compilation/callingconv.h +11 -11
  588. data/vendor/cmock/test/system/test_compilation/config.yml +9 -9
  589. data/vendor/cmock/test/system/test_compilation/const.h +37 -37
  590. data/vendor/cmock/test/system/test_compilation/osek.h +275 -275
  591. data/vendor/cmock/test/system/test_compilation/parsing.h +89 -52
  592. data/vendor/cmock/test/system/test_interactions/all_plugins_but_other_limits.yml +375 -375
  593. data/vendor/cmock/test/system/test_interactions/all_plugins_coexist.yml +459 -459
  594. data/vendor/cmock/test/system/test_interactions/array_and_pointer_handling.yml +446 -446
  595. data/vendor/cmock/test/system/test_interactions/basic_expect_and_return.yml +124 -124
  596. data/vendor/cmock/test/system/test_interactions/const_primitives_handling.yml +87 -87
  597. data/vendor/cmock/test/system/test_interactions/doesnt_leave_details_behind.yml +308 -308
  598. data/vendor/cmock/test/system/test_interactions/enforce_strict_ordering.yml +247 -247
  599. data/vendor/cmock/test/system/test_interactions/expect_and_return_custom_types.yml +108 -108
  600. data/vendor/cmock/test/system/test_interactions/expect_and_return_treat_as.yml +173 -173
  601. data/vendor/cmock/test/system/test_interactions/expect_and_throw.yml +170 -170
  602. data/vendor/cmock/test/system/test_interactions/expect_any_args.yml +238 -238
  603. data/vendor/cmock/test/system/test_interactions/fancy_pointer_handling.yml +210 -210
  604. data/vendor/cmock/test/system/test_interactions/function_pointer_handling.yml +82 -82
  605. data/vendor/cmock/test/system/test_interactions/ignore_and_return.yml +329 -329
  606. data/vendor/cmock/test/system/test_interactions/ignore_strict_mock_calling.yml +37 -37
  607. data/vendor/cmock/test/system/test_interactions/newer_standards_stuff1.yml +52 -52
  608. data/vendor/cmock/test/system/test_interactions/nonstandard_parsed_stuff_1.yml +91 -91
  609. data/vendor/cmock/test/system/test_interactions/nonstandard_parsed_stuff_2.yml +59 -59
  610. data/vendor/cmock/test/system/test_interactions/out_of_memory.yml +65 -65
  611. data/vendor/cmock/test/system/test_interactions/parsing_challenges.yml +242 -242
  612. data/vendor/cmock/test/system/test_interactions/return_thru_ptr_and_expect_any_args.yml +235 -235
  613. data/vendor/cmock/test/system/test_interactions/return_thru_ptr_ignore_arg.yml +231 -231
  614. data/vendor/cmock/test/system/test_interactions/struct_union_enum_expect_and_return.yml +277 -277
  615. data/vendor/cmock/test/system/test_interactions/struct_union_enum_expect_and_return_with_plugins.yml +280 -280
  616. data/vendor/cmock/test/system/test_interactions/stubs_with_callbacks.yml +221 -221
  617. data/vendor/cmock/test/system/test_interactions/unity_64bit_support.yml +77 -77
  618. data/vendor/cmock/test/system/test_interactions/unity_ignores.yml +139 -139
  619. data/vendor/cmock/test/system/test_interactions/unity_void_pointer_compare.yml +91 -0
  620. data/vendor/cmock/test/targets/clang_strict.yml +90 -90
  621. data/vendor/cmock/test/targets/gcc.yml +58 -58
  622. data/vendor/cmock/test/targets/gcc_64.yml +58 -58
  623. data/vendor/cmock/test/targets/gcc_tiny.yml +80 -80
  624. data/vendor/cmock/test/targets/iar_arm_v4.yml +110 -110
  625. data/vendor/cmock/test/targets/iar_arm_v5.yml +95 -95
  626. data/vendor/cmock/test/test_helper.rb +44 -44
  627. data/vendor/cmock/test/unit/cmock_config_test.rb +120 -120
  628. data/vendor/cmock/test/unit/cmock_config_test.yml +5 -5
  629. data/vendor/cmock/test/unit/cmock_file_writer_test.rb +27 -27
  630. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +548 -542
  631. data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +141 -141
  632. data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +281 -259
  633. data/vendor/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +96 -96
  634. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +183 -186
  635. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +67 -60
  636. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +200 -203
  637. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +116 -116
  638. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +105 -105
  639. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +136 -136
  640. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +415 -394
  641. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +1728 -1699
  642. data/vendor/cmock/test/unit/cmock_plugin_manager_test.rb +100 -91
  643. data/vendor/cmock/test/unit/cmock_unityhelper_parser_test.rb +223 -223
  644. data/vendor/cmock/vendor/behaviors/Manifest.txt +9 -9
  645. data/vendor/cmock/vendor/behaviors/Rakefile +19 -19
  646. data/vendor/cmock/vendor/behaviors/lib/behaviors.rb +76 -76
  647. data/vendor/cmock/vendor/behaviors/lib/behaviors/reporttask.rb +158 -158
  648. data/vendor/cmock/vendor/behaviors/test/behaviors_tasks_test.rb +73 -73
  649. data/vendor/cmock/vendor/behaviors/test/behaviors_test.rb +50 -50
  650. data/vendor/cmock/vendor/behaviors/test/tasks_test/Rakefile +19 -19
  651. data/vendor/cmock/vendor/behaviors/test/tasks_test/lib/user.rb +2 -2
  652. data/vendor/cmock/vendor/behaviors/test/tasks_test/test/user_test.rb +17 -17
  653. data/vendor/cmock/vendor/c_exception/Gemfile +4 -4
  654. data/vendor/cmock/vendor/c_exception/Gemfile.lock +12 -12
  655. data/vendor/cmock/vendor/c_exception/LICENSE.txt +30 -30
  656. data/vendor/cmock/vendor/c_exception/README.md +162 -162
  657. data/vendor/cmock/vendor/c_exception/Rakefile +42 -42
  658. data/vendor/cmock/vendor/c_exception/docs/CException.md +292 -292
  659. data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -207
  660. data/vendor/cmock/vendor/c_exception/lib/CException.c +46 -46
  661. data/vendor/cmock/vendor/c_exception/lib/CException.h +115 -110
  662. data/vendor/cmock/vendor/c_exception/makefile +23 -23
  663. data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +46 -46
  664. data/vendor/cmock/vendor/c_exception/test/TestException.c +391 -391
  665. data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +67 -67
  666. data/vendor/cmock/vendor/unity/CMakeLists.txt +31 -0
  667. data/vendor/{unity/docs/license.txt → cmock/vendor/unity/LICENSE.txt} +21 -21
  668. data/vendor/cmock/vendor/unity/README.md +191 -231
  669. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +119 -118
  670. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +39 -39
  671. data/vendor/cmock/vendor/unity/auto/generate_config.yml +36 -36
  672. data/vendor/cmock/vendor/unity/auto/generate_module.rb +309 -308
  673. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +495 -457
  674. data/vendor/cmock/vendor/unity/auto/parse_output.rb +322 -323
  675. data/vendor/cmock/vendor/unity/auto/run_test.erb +36 -0
  676. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +251 -252
  677. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +25 -25
  678. data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +6 -6
  679. data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +139 -139
  680. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +135 -136
  681. data/vendor/cmock/vendor/unity/auto/unity_to_junit.py +146 -146
  682. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +206 -206
  683. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +850 -779
  684. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +541 -433
  685. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +251 -192
  686. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +266 -260
  687. data/vendor/cmock/vendor/unity/examples/example_1/makefile +72 -71
  688. data/vendor/cmock/vendor/unity/examples/example_1/readme.txt +4 -4
  689. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +24 -24
  690. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +3 -3
  691. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +11 -11
  692. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +2 -2
  693. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +62 -62
  694. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +31 -31
  695. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -53
  696. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -57
  697. data/vendor/cmock/vendor/unity/examples/example_2/makefile +71 -70
  698. data/vendor/cmock/vendor/unity/examples/example_2/readme.txt +4 -4
  699. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +24 -24
  700. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +3 -3
  701. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +11 -11
  702. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +2 -2
  703. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +64 -64
  704. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +33 -33
  705. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +8 -8
  706. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +10 -10
  707. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -12
  708. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +10 -10
  709. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +12 -12
  710. data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +38 -43
  711. data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +250 -249
  712. data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +13 -13
  713. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +24 -24
  714. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +3 -3
  715. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +11 -11
  716. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +2 -2
  717. data/vendor/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +47 -46
  718. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +62 -62
  719. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +31 -31
  720. data/vendor/cmock/vendor/unity/examples/example_4/meson.build +17 -0
  721. data/vendor/cmock/vendor/unity/examples/example_4/readme.txt +15 -0
  722. data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode.c +24 -0
  723. data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode.h +3 -0
  724. data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode2.c +11 -0
  725. data/vendor/cmock/vendor/unity/examples/example_4/src/ProductionCode2.h +2 -0
  726. data/vendor/cmock/vendor/unity/examples/example_4/src/meson.build +21 -0
  727. data/vendor/cmock/vendor/unity/examples/example_4/subprojects/unity.wrap +4 -0
  728. data/vendor/cmock/vendor/unity/examples/example_4/test/TestProductionCode.c +63 -0
  729. data/vendor/cmock/vendor/unity/examples/example_4/test/TestProductionCode2.c +35 -0
  730. data/vendor/cmock/vendor/unity/examples/example_4/test/meson.build +12 -0
  731. data/vendor/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c +53 -0
  732. data/vendor/cmock/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c +57 -0
  733. data/vendor/cmock/vendor/unity/examples/example_4/test/test_runners/meson.build +16 -0
  734. data/vendor/cmock/vendor/unity/examples/unity_config.h +263 -247
  735. data/vendor/cmock/vendor/unity/extras/eclipse/error_parsers.txt +26 -26
  736. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +44 -48
  737. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +183 -178
  738. data/vendor/cmock/vendor/unity/extras/fixture/readme.md +17 -0
  739. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +275 -436
  740. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +83 -83
  741. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +50 -51
  742. data/vendor/cmock/vendor/unity/extras/fixture/test/Makefile +72 -75
  743. data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +20 -22
  744. data/vendor/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +39 -39
  745. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +245 -543
  746. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +32 -57
  747. data/vendor/cmock/vendor/unity/extras/memory/rakefile.rb +45 -0
  748. data/vendor/cmock/vendor/unity/extras/memory/rakefile_helper.rb +187 -0
  749. data/vendor/cmock/vendor/unity/extras/memory/readme.md +49 -0
  750. data/vendor/cmock/vendor/unity/extras/memory/src/unity_memory.c +202 -0
  751. data/vendor/cmock/vendor/unity/extras/{fixture/src/unity_fixture_malloc_overrides.h → memory/src/unity_memory.h} +60 -47
  752. data/vendor/cmock/vendor/unity/extras/memory/test/Makefile +78 -0
  753. data/vendor/cmock/vendor/unity/extras/memory/test/unity_memory_Test.c +325 -0
  754. data/vendor/cmock/vendor/unity/extras/memory/test/unity_memory_TestRunner.c +49 -0
  755. data/vendor/{unity/extras/fixture → cmock/vendor/unity/extras/memory}/test/unity_output_Spy.c +56 -57
  756. data/vendor/{unity/extras/fixture → cmock/vendor/unity/extras/memory}/test/unity_output_Spy.h +16 -17
  757. data/vendor/cmock/vendor/unity/meson.build +69 -0
  758. data/vendor/cmock/vendor/unity/src/CMakeLists.txt +22 -0
  759. data/vendor/cmock/vendor/unity/src/meson.build +16 -0
  760. data/vendor/cmock/vendor/unity/src/unity.c +2085 -1572
  761. data/vendor/cmock/vendor/unity/src/unity.h +617 -503
  762. data/vendor/cmock/vendor/unity/src/unity_internals.h +1002 -924
  763. data/vendor/cmock/vendor/unity/test/Makefile +67 -68
  764. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +61 -61
  765. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +57 -57
  766. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +55 -55
  767. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.h +15 -15
  768. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +80 -80
  769. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +76 -76
  770. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -75
  771. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -13
  772. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +89 -89
  773. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +89 -89
  774. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +77 -77
  775. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +89 -89
  776. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +89 -89
  777. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +90 -90
  778. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +67 -67
  779. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +70 -70
  780. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +58 -58
  781. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +67 -67
  782. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +70 -70
  783. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +71 -71
  784. data/vendor/cmock/vendor/unity/test/rakefile +124 -125
  785. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +269 -260
  786. data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -158
  787. data/vendor/cmock/vendor/unity/test/targets/ansi.yml +49 -0
  788. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +78 -78
  789. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +78 -78
  790. data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +49 -49
  791. data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +50 -50
  792. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +47 -47
  793. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +59 -59
  794. data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +47 -47
  795. data/vendor/cmock/vendor/unity/test/targets/hitech_picc18.yml +101 -101
  796. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +90 -90
  797. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +80 -80
  798. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +80 -80
  799. data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +94 -94
  800. data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +84 -84
  801. data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +95 -95
  802. data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +86 -86
  803. data/vendor/cmock/vendor/unity/test/testdata/CException.h +11 -11
  804. data/vendor/cmock/vendor/unity/test/testdata/Defs.h +8 -8
  805. data/vendor/cmock/vendor/unity/test/testdata/cmock.h +14 -14
  806. data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +13 -13
  807. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +189 -186
  808. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +70 -70
  809. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +197 -195
  810. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +1268 -1252
  811. data/vendor/cmock/vendor/unity/test/tests/testparameterized.c +171 -113
  812. data/vendor/cmock/vendor/unity/test/tests/testunity.c +8168 -5371
  813. data/vendor/deep_merge/MIT-LICENSE +20 -20
  814. data/vendor/deep_merge/README +94 -94
  815. data/vendor/deep_merge/Rakefile +28 -28
  816. data/vendor/deep_merge/lib/deep_merge.rb +211 -211
  817. data/vendor/deep_merge/test/test_deep_merge.rb +553 -553
  818. data/vendor/diy/History.txt +28 -28
  819. data/vendor/diy/README.rdoc +233 -233
  820. data/vendor/diy/Rakefile +33 -33
  821. data/vendor/diy/TODO.txt +9 -9
  822. data/vendor/diy/diy.gemspec +131 -131
  823. data/vendor/diy/lib/diy.rb +403 -403
  824. data/vendor/diy/lib/diy/factory.rb +36 -36
  825. data/vendor/diy/sample_code/car.rb +7 -7
  826. data/vendor/diy/sample_code/chassis.rb +5 -5
  827. data/vendor/diy/sample_code/diy_example.rb +26 -26
  828. data/vendor/diy/sample_code/engine.rb +5 -5
  829. data/vendor/diy/sample_code/objects.yml +10 -10
  830. data/vendor/diy/test/constructor.rb +119 -119
  831. data/vendor/diy/test/diy_test.rb +608 -608
  832. data/vendor/diy/test/factory_test.rb +79 -79
  833. data/vendor/diy/test/files/broken_construction.yml +7 -7
  834. data/vendor/diy/test/files/cat/cat.rb +3 -3
  835. data/vendor/diy/test/files/cat/extra_conflict.yml +5 -5
  836. data/vendor/diy/test/files/cat/heritage.rb +2 -2
  837. data/vendor/diy/test/files/cat/needs_input.yml +3 -3
  838. data/vendor/diy/test/files/cat/the_cat_lineage.rb +1 -1
  839. data/vendor/diy/test/files/dog/dog_model.rb +3 -3
  840. data/vendor/diy/test/files/dog/dog_presenter.rb +3 -3
  841. data/vendor/diy/test/files/dog/dog_view.rb +2 -2
  842. data/vendor/diy/test/files/dog/file_resolver.rb +2 -2
  843. data/vendor/diy/test/files/dog/other_thing.rb +2 -2
  844. data/vendor/diy/test/files/dog/simple.yml +11 -11
  845. data/vendor/diy/test/files/donkey/foo.rb +8 -8
  846. data/vendor/diy/test/files/donkey/foo/bar/qux.rb +7 -7
  847. data/vendor/diy/test/files/factory/beef.rb +5 -5
  848. data/vendor/diy/test/files/factory/dog.rb +6 -6
  849. data/vendor/diy/test/files/factory/factory.yml +19 -19
  850. data/vendor/diy/test/files/factory/farm/llama.rb +7 -7
  851. data/vendor/diy/test/files/factory/farm/pork.rb +7 -7
  852. data/vendor/diy/test/files/factory/kitten.rb +13 -13
  853. data/vendor/diy/test/files/fud/objects.yml +13 -13
  854. data/vendor/diy/test/files/fud/toy.rb +14 -14
  855. data/vendor/diy/test/files/functions/attached_things_builder.rb +1 -1
  856. data/vendor/diy/test/files/functions/invalid_method.yml +4 -4
  857. data/vendor/diy/test/files/functions/method_extractor.rb +2 -2
  858. data/vendor/diy/test/files/functions/nonsingleton_objects.yml +5 -5
  859. data/vendor/diy/test/files/functions/objects.yml +21 -21
  860. data/vendor/diy/test/files/functions/thing.rb +2 -2
  861. data/vendor/diy/test/files/functions/thing_builder.rb +24 -24
  862. data/vendor/diy/test/files/functions/things_builder.rb +2 -2
  863. data/vendor/diy/test/files/gnu/objects.yml +14 -14
  864. data/vendor/diy/test/files/gnu/thinger.rb +7 -7
  865. data/vendor/diy/test/files/goat/base.rb +8 -8
  866. data/vendor/diy/test/files/goat/can.rb +6 -6
  867. data/vendor/diy/test/files/goat/goat.rb +6 -6
  868. data/vendor/diy/test/files/goat/objects.yml +12 -12
  869. data/vendor/diy/test/files/goat/paper.rb +6 -6
  870. data/vendor/diy/test/files/goat/plane.rb +7 -7
  871. data/vendor/diy/test/files/goat/shirt.rb +6 -6
  872. data/vendor/diy/test/files/goat/wings.rb +8 -8
  873. data/vendor/diy/test/files/horse/holder_thing.rb +3 -3
  874. data/vendor/diy/test/files/horse/objects.yml +7 -7
  875. data/vendor/diy/test/files/namespace/animal/bird.rb +5 -5
  876. data/vendor/diy/test/files/namespace/animal/cat.rb +5 -5
  877. data/vendor/diy/test/files/namespace/animal/reptile/hardshell/turtle.rb +8 -8
  878. data/vendor/diy/test/files/namespace/animal/reptile/lizard.rb +7 -7
  879. data/vendor/diy/test/files/namespace/bad_module_specified.yml +8 -8
  880. data/vendor/diy/test/files/namespace/class_name_combine.yml +8 -8
  881. data/vendor/diy/test/files/namespace/no_module_specified.yml +8 -8
  882. data/vendor/diy/test/files/namespace/objects.yml +21 -21
  883. data/vendor/diy/test/files/namespace/road.rb +2 -2
  884. data/vendor/diy/test/files/namespace/sky.rb +2 -2
  885. data/vendor/diy/test/files/namespace/subcontext.yml +22 -22
  886. data/vendor/diy/test/files/non_singleton/air.rb +2 -2
  887. data/vendor/diy/test/files/non_singleton/fat_cat.rb +3 -3
  888. data/vendor/diy/test/files/non_singleton/objects.yml +19 -19
  889. data/vendor/diy/test/files/non_singleton/pig.rb +3 -3
  890. data/vendor/diy/test/files/non_singleton/thread_spinner.rb +3 -3
  891. data/vendor/diy/test/files/non_singleton/tick.rb +3 -3
  892. data/vendor/diy/test/files/non_singleton/yard.rb +2 -2
  893. data/vendor/diy/test/files/yak/core_model.rb +3 -3
  894. data/vendor/diy/test/files/yak/core_presenter.rb +3 -3
  895. data/vendor/diy/test/files/yak/core_view.rb +1 -1
  896. data/vendor/diy/test/files/yak/data_source.rb +1 -1
  897. data/vendor/diy/test/files/yak/fringe_model.rb +3 -3
  898. data/vendor/diy/test/files/yak/fringe_presenter.rb +3 -3
  899. data/vendor/diy/test/files/yak/fringe_view.rb +1 -1
  900. data/vendor/diy/test/files/yak/giant_squid.rb +3 -3
  901. data/vendor/diy/test/files/yak/krill.rb +2 -2
  902. data/vendor/diy/test/files/yak/my_objects.yml +21 -21
  903. data/vendor/diy/test/files/yak/sub_sub_context_test.yml +27 -27
  904. data/vendor/diy/test/test_helper.rb +55 -55
  905. data/vendor/hardmock/CHANGES +78 -78
  906. data/vendor/hardmock/LICENSE +7 -7
  907. data/vendor/hardmock/README +70 -70
  908. data/vendor/hardmock/Rakefile +8 -8
  909. data/vendor/hardmock/config/environment.rb +12 -12
  910. data/vendor/hardmock/lib/assert_error.rb +23 -23
  911. data/vendor/hardmock/lib/extend_test_unit.rb +14 -14
  912. data/vendor/hardmock/lib/hardmock.rb +86 -86
  913. data/vendor/hardmock/lib/hardmock/errors.rb +22 -22
  914. data/vendor/hardmock/lib/hardmock/expectation.rb +229 -229
  915. data/vendor/hardmock/lib/hardmock/expectation_builder.rb +9 -9
  916. data/vendor/hardmock/lib/hardmock/expector.rb +26 -26
  917. data/vendor/hardmock/lib/hardmock/method_cleanout.rb +33 -33
  918. data/vendor/hardmock/lib/hardmock/mock.rb +180 -180
  919. data/vendor/hardmock/lib/hardmock/mock_control.rb +53 -53
  920. data/vendor/hardmock/lib/hardmock/stubbing.rb +210 -210
  921. data/vendor/hardmock/lib/hardmock/trapper.rb +31 -31
  922. data/vendor/hardmock/lib/hardmock/utils.rb +9 -9
  923. data/vendor/hardmock/lib/test_unit_before_after.rb +169 -169
  924. data/vendor/hardmock/rake_tasks/rdoc.rake +19 -19
  925. data/vendor/hardmock/rake_tasks/rdoc_options.rb +4 -4
  926. data/vendor/hardmock/rake_tasks/test.rake +22 -22
  927. data/vendor/hardmock/test/functional/assert_error_test.rb +52 -52
  928. data/vendor/hardmock/test/functional/auto_verify_test.rb +178 -178
  929. data/vendor/hardmock/test/functional/direct_mock_usage_test.rb +396 -396
  930. data/vendor/hardmock/test/functional/hardmock_test.rb +434 -434
  931. data/vendor/hardmock/test/functional/stubbing_test.rb +479 -479
  932. data/vendor/hardmock/test/test_helper.rb +43 -43
  933. data/vendor/hardmock/test/unit/expectation_builder_test.rb +19 -19
  934. data/vendor/hardmock/test/unit/expectation_test.rb +372 -372
  935. data/vendor/hardmock/test/unit/expector_test.rb +57 -57
  936. data/vendor/hardmock/test/unit/method_cleanout_test.rb +36 -36
  937. data/vendor/hardmock/test/unit/mock_control_test.rb +175 -175
  938. data/vendor/hardmock/test/unit/mock_test.rb +279 -279
  939. data/vendor/hardmock/test/unit/test_unit_before_after_test.rb +452 -452
  940. data/vendor/hardmock/test/unit/trapper_test.rb +62 -62
  941. data/vendor/hardmock/test/unit/verify_error_test.rb +40 -40
  942. data/vendor/unity/CMakeLists.txt +31 -0
  943. data/vendor/unity/LICENSE.txt +21 -0
  944. data/vendor/unity/README.md +191 -231
  945. data/vendor/unity/auto/colour_prompt.rb +119 -118
  946. data/vendor/unity/auto/colour_reporter.rb +39 -39
  947. data/vendor/unity/auto/generate_config.yml +36 -36
  948. data/vendor/unity/auto/generate_module.rb +309 -308
  949. data/vendor/unity/auto/generate_test_runner.rb +495 -457
  950. data/vendor/unity/auto/parse_output.rb +322 -323
  951. data/vendor/unity/auto/run_test.erb +36 -0
  952. data/vendor/unity/auto/stylize_as_junit.rb +251 -252
  953. data/vendor/unity/auto/test_file_filter.rb +25 -25
  954. data/vendor/unity/auto/type_sanitizer.rb +6 -6
  955. data/vendor/unity/auto/unity_test_summary.py +139 -139
  956. data/vendor/unity/auto/unity_test_summary.rb +135 -136
  957. data/vendor/unity/auto/unity_to_junit.py +146 -146
  958. data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +206 -206
  959. data/vendor/unity/docs/UnityAssertionsReference.md +850 -779
  960. data/vendor/unity/docs/UnityConfigurationGuide.md +541 -433
  961. data/vendor/unity/docs/UnityGettingStartedGuide.md +251 -192
  962. data/vendor/unity/docs/UnityHelperScriptsGuide.md +266 -260
  963. data/vendor/unity/examples/example_1/makefile +72 -71
  964. data/vendor/unity/examples/example_1/readme.txt +4 -4
  965. data/vendor/unity/examples/example_1/src/ProductionCode.c +24 -24
  966. data/vendor/unity/examples/example_1/src/ProductionCode.h +3 -3
  967. data/vendor/unity/examples/example_1/src/ProductionCode2.c +11 -11
  968. data/vendor/unity/examples/example_1/src/ProductionCode2.h +2 -2
  969. data/vendor/unity/examples/example_1/test/TestProductionCode.c +62 -62
  970. data/vendor/unity/examples/example_1/test/TestProductionCode2.c +31 -31
  971. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -53
  972. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -57
  973. data/vendor/unity/examples/example_2/makefile +71 -70
  974. data/vendor/unity/examples/example_2/readme.txt +4 -4
  975. data/vendor/unity/examples/example_2/src/ProductionCode.c +24 -24
  976. data/vendor/unity/examples/example_2/src/ProductionCode.h +3 -3
  977. data/vendor/unity/examples/example_2/src/ProductionCode2.c +11 -11
  978. data/vendor/unity/examples/example_2/src/ProductionCode2.h +2 -2
  979. data/vendor/unity/examples/example_2/test/TestProductionCode.c +64 -64
  980. data/vendor/unity/examples/example_2/test/TestProductionCode2.c +33 -33
  981. data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +8 -8
  982. data/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +10 -10
  983. data/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -12
  984. data/vendor/unity/examples/example_3/helper/UnityHelper.c +10 -10
  985. data/vendor/unity/examples/example_3/helper/UnityHelper.h +12 -12
  986. data/vendor/unity/examples/example_3/rakefile.rb +38 -43
  987. data/vendor/unity/examples/example_3/rakefile_helper.rb +250 -249
  988. data/vendor/unity/examples/example_3/readme.txt +13 -13
  989. data/vendor/unity/examples/example_3/src/ProductionCode.c +24 -24
  990. data/vendor/unity/examples/example_3/src/ProductionCode.h +3 -3
  991. data/vendor/unity/examples/example_3/src/ProductionCode2.c +11 -11
  992. data/vendor/unity/examples/example_3/src/ProductionCode2.h +2 -2
  993. data/vendor/unity/examples/example_3/target_gcc_32.yml +47 -46
  994. data/vendor/unity/examples/example_3/test/TestProductionCode.c +62 -62
  995. data/vendor/unity/examples/example_3/test/TestProductionCode2.c +31 -31
  996. data/vendor/unity/examples/example_4/meson.build +17 -0
  997. data/vendor/unity/examples/example_4/readme.txt +15 -0
  998. data/vendor/unity/examples/example_4/src/ProductionCode.c +24 -0
  999. data/vendor/unity/examples/example_4/src/ProductionCode.h +3 -0
  1000. data/vendor/unity/examples/example_4/src/ProductionCode2.c +11 -0
  1001. data/vendor/unity/examples/example_4/src/ProductionCode2.h +2 -0
  1002. data/vendor/unity/examples/example_4/src/meson.build +21 -0
  1003. data/vendor/unity/examples/example_4/subprojects/unity.wrap +4 -0
  1004. data/vendor/unity/examples/example_4/test/TestProductionCode.c +63 -0
  1005. data/vendor/unity/examples/example_4/test/TestProductionCode2.c +35 -0
  1006. data/vendor/unity/examples/example_4/test/meson.build +12 -0
  1007. data/vendor/unity/examples/example_4/test/test_runners/TestProductionCode2_Runner.c +53 -0
  1008. data/vendor/unity/examples/example_4/test/test_runners/TestProductionCode_Runner.c +57 -0
  1009. data/vendor/unity/examples/example_4/test/test_runners/meson.build +16 -0
  1010. data/vendor/unity/examples/unity_config.h +263 -247
  1011. data/vendor/unity/extras/eclipse/error_parsers.txt +26 -26
  1012. data/vendor/unity/extras/fixture/rakefile.rb +44 -48
  1013. data/vendor/unity/extras/fixture/rakefile_helper.rb +183 -178
  1014. data/vendor/unity/extras/fixture/readme.md +17 -0
  1015. data/vendor/unity/extras/fixture/src/unity_fixture.c +275 -436
  1016. data/vendor/unity/extras/fixture/src/unity_fixture.h +83 -83
  1017. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +50 -51
  1018. data/vendor/unity/extras/fixture/test/Makefile +72 -75
  1019. data/vendor/unity/extras/fixture/test/main/AllTests.c +20 -22
  1020. data/vendor/unity/extras/fixture/test/template_fixture_tests.c +39 -39
  1021. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +245 -543
  1022. data/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +32 -57
  1023. data/vendor/unity/extras/memory/rakefile.rb +45 -0
  1024. data/vendor/unity/extras/memory/rakefile_helper.rb +187 -0
  1025. data/vendor/unity/extras/memory/readme.md +49 -0
  1026. data/vendor/unity/extras/memory/src/unity_memory.c +202 -0
  1027. data/vendor/unity/extras/memory/src/unity_memory.h +60 -0
  1028. data/vendor/unity/extras/memory/test/Makefile +78 -0
  1029. data/vendor/unity/extras/memory/test/unity_memory_Test.c +325 -0
  1030. data/vendor/unity/extras/memory/test/unity_memory_TestRunner.c +49 -0
  1031. data/vendor/unity/extras/memory/test/unity_output_Spy.c +56 -0
  1032. data/vendor/unity/extras/memory/test/unity_output_Spy.h +16 -0
  1033. data/vendor/unity/meson.build +69 -0
  1034. data/vendor/unity/src/CMakeLists.txt +22 -0
  1035. data/vendor/unity/src/meson.build +16 -0
  1036. data/vendor/unity/src/unity.c +2085 -1572
  1037. data/vendor/unity/src/unity.h +617 -503
  1038. data/vendor/unity/src/unity_internals.h +1002 -924
  1039. data/vendor/unity/test/Makefile +67 -68
  1040. data/vendor/unity/test/expectdata/testsample_cmd.c +61 -61
  1041. data/vendor/unity/test/expectdata/testsample_def.c +57 -57
  1042. data/vendor/unity/test/expectdata/testsample_head1.c +55 -55
  1043. data/vendor/unity/test/expectdata/testsample_head1.h +15 -15
  1044. data/vendor/unity/test/expectdata/testsample_mock_cmd.c +80 -80
  1045. data/vendor/unity/test/expectdata/testsample_mock_def.c +76 -76
  1046. data/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -75
  1047. data/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -13
  1048. data/vendor/unity/test/expectdata/testsample_mock_new1.c +89 -89
  1049. data/vendor/unity/test/expectdata/testsample_mock_new2.c +89 -89
  1050. data/vendor/unity/test/expectdata/testsample_mock_param.c +77 -77
  1051. data/vendor/unity/test/expectdata/testsample_mock_run1.c +89 -89
  1052. data/vendor/unity/test/expectdata/testsample_mock_run2.c +89 -89
  1053. data/vendor/unity/test/expectdata/testsample_mock_yaml.c +90 -90
  1054. data/vendor/unity/test/expectdata/testsample_new1.c +67 -67
  1055. data/vendor/unity/test/expectdata/testsample_new2.c +70 -70
  1056. data/vendor/unity/test/expectdata/testsample_param.c +58 -58
  1057. data/vendor/unity/test/expectdata/testsample_run1.c +67 -67
  1058. data/vendor/unity/test/expectdata/testsample_run2.c +70 -70
  1059. data/vendor/unity/test/expectdata/testsample_yaml.c +71 -71
  1060. data/vendor/unity/test/rakefile +124 -125
  1061. data/vendor/unity/test/rakefile_helper.rb +269 -260
  1062. data/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -158
  1063. data/vendor/unity/test/targets/ansi.yml +49 -0
  1064. data/vendor/unity/test/targets/clang_file.yml +78 -78
  1065. data/vendor/unity/test/targets/clang_strict.yml +78 -78
  1066. data/vendor/unity/test/targets/gcc_32.yml +49 -49
  1067. data/vendor/unity/test/targets/gcc_64.yml +50 -50
  1068. data/vendor/unity/test/targets/gcc_auto_limits.yml +47 -47
  1069. data/vendor/unity/test/targets/gcc_auto_stdint.yml +59 -59
  1070. data/vendor/unity/test/targets/gcc_manual_math.yml +47 -47
  1071. data/vendor/unity/test/targets/hitech_picc18.yml +101 -101
  1072. data/vendor/unity/test/targets/iar_arm_v4.yml +90 -90
  1073. data/vendor/unity/test/targets/iar_arm_v5.yml +80 -80
  1074. data/vendor/unity/test/targets/iar_arm_v5_3.yml +80 -80
  1075. data/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +94 -94
  1076. data/vendor/unity/test/targets/iar_cortexm3_v5.yml +84 -84
  1077. data/vendor/unity/test/targets/iar_msp430.yml +95 -95
  1078. data/vendor/unity/test/targets/iar_sh2a_v6.yml +86 -86
  1079. data/vendor/unity/test/testdata/CException.h +11 -11
  1080. data/vendor/unity/test/testdata/Defs.h +8 -8
  1081. data/vendor/unity/test/testdata/cmock.h +14 -14
  1082. data/vendor/unity/test/testdata/mockMock.h +13 -13
  1083. data/vendor/unity/test/testdata/testRunnerGenerator.c +189 -186
  1084. data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +70 -70
  1085. data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +197 -195
  1086. data/vendor/unity/test/tests/test_generate_test_runner.rb +1268 -1252
  1087. data/vendor/unity/test/tests/testparameterized.c +171 -113
  1088. data/vendor/unity/test/tests/testunity.c +8168 -5371
  1089. metadata +201 -27
  1090. data/lib/ceedling/version.rb.erb +0 -15
  1091. data/vendor/c_exception/release/build.info +0 -2
  1092. data/vendor/c_exception/release/version.info +0 -2
  1093. data/vendor/cmock/release/build.info +0 -2
  1094. data/vendor/cmock/release/version.info +0 -2
  1095. data/vendor/cmock/vendor/c_exception/release/build.info +0 -2
  1096. data/vendor/cmock/vendor/c_exception/release/version.info +0 -2
  1097. data/vendor/cmock/vendor/unity/release/build.info +0 -2
  1098. data/vendor/cmock/vendor/unity/release/version.info +0 -2
  1099. data/vendor/unity/extras/fixture/readme.txt +0 -9
  1100. data/vendor/unity/release/build.info +0 -2
  1101. data/vendor/unity/release/version.info +0 -2
@@ -1,11 +1,11 @@
1
-
2
- # Setup our load path:
3
- [
4
- 'lib',
5
- 'test',
6
- 'vendor/behaviors/lib',
7
- 'vendor/hardmock/lib',
8
- 'vendor/deep_merge/lib',
9
- ].each do |dir|
10
- $LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__) + "/../"), dir) )
11
- end
1
+
2
+ # Setup our load path:
3
+ [
4
+ 'lib',
5
+ 'test',
6
+ 'vendor/behaviors/lib',
7
+ 'vendor/hardmock/lib',
8
+ 'vendor/deep_merge/lib',
9
+ ].each do |dir|
10
+ $LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__) + "/../"), dir) )
11
+ end
@@ -1,2060 +1,2119 @@
1
- [All code is copyright © 2010-2012 Ceedling Project
2
- by Mike Karlesky, Mark VanderVoord, and Greg Williams.
3
-
4
- This Documentation Is Released Under a
5
- Creative Commons 3.0 Attribution Share-Alike License]
6
-
7
- What the What?
8
-
9
- Assembling build environments for C projects - especially with
10
- automated unit tests - is a pain. Whether it's Make or Rake or Premake
11
- or what-have-you, set up with an all-purpose build environment
12
- tool is tedious and requires considerable glue code to pull together
13
- the necessary tools and libraries. Ceedling allows you to generate
14
- an entire test and build environment for a C project from a single
15
- YAML configuration file. Ceedling is written in Ruby and works
16
- with the Rake build tool plus other goodness like Unity and CMock
17
- - the unit testing and mocking frameworks for C. Ceedling and
18
- its complementary tools can support the tiniest of embedded
19
- processors, the beefiest 64 bit power houses available, and
20
- everything in between.
21
-
22
- For a build project including unit tests and using the default
23
- toolchain gcc, the configuration file could be as simple as this:
24
-
25
- ```yaml
26
- :project:
27
- :build_root: project/build/
28
- :release_build: TRUE
29
-
30
- :paths:
31
- :test:
32
- - tests/**
33
- :source:
34
- - source/**
35
- ```
36
-
37
- From the command line, to build the release version of your project,
38
- you would simply run `ceedling release`. To run all your unit tests,
39
- you would run `ceedling test:all`. That's it!
40
-
41
- Of course, many more advanced options allow you to configure
42
- your project with a variety of features to meet a variety of needs.
43
- Ceedling can work with practically any command line toolchain
44
- and directory structure – all by way of the configuration file.
45
- Further, because Ceedling piggy backs on Rake, you can add your
46
- own Rake tasks to accomplish project tasks outside of testing
47
- and release builds. A facility for plugins also allows you to
48
- extend Ceedling's capabilities for needs such as custom code
49
- metrics reporting and coverage testing.
50
-
51
- What's with this Name?
52
-
53
- Glad you asked. Ceedling is tailored for unit tested C projects
54
- and is built upon / around Rake (Rake is a Make replacement implemented
55
- in the Ruby scripting language). So, we've got C, our Rake, and
56
- the fertile soil of a build environment in which to grow and tend
57
- your project and its unit tests. Ta da - _Ceedling_.
58
-
59
- What Do You Mean "tailored for unit tested C projects"?
60
-
61
- Well, we like to write unit tests for our C code to make it lean and
62
- mean (that whole [Test-Driven Development][tdd]
63
- thing). Along the way, this style of writing C code spawned two
64
- tools to make the job easier: a unit test framework for C called
65
- _Unity_ and a mocking library called _CMock_. And, though it's
66
- not directly related to testing, a C framework for exception
67
- handling called _CException_ also came along.
68
-
69
- [tdd]: http://en.wikipedia.org/wiki/Test-driven_development
70
-
71
- These tools and frameworks are great, but they require quite
72
- a bit of environment support to pull them all together in a convenient,
73
- usable fashion. We started off with Rakefiles to assemble everything.
74
- These ended up being quite complicated and had to be hand-edited
75
- or created anew for each new project. Ceedling replaces all that
76
- tedium and rework with a configuration file that ties everything
77
- together.
78
-
79
- Though Ceedling is tailored for unit testing, it can also go right ahead
80
- and build your final binary release artifact for you as well. Or,
81
- Ceedling and your tests can live alongside your existing release build
82
- setup. That said, Ceedling is more powerful as a unit test build
83
- environment than it is a general purpose release build environment;
84
- complicated projects including separate bootloaders or multiple library
85
- builds, etc. are not its strong suit.
86
-
87
- Hold on. Back up. Ruby? Rake? YAML? Unity? CMock? CException?
88
-
89
- Seem overwhelming? It's not bad at all, and for the benefits tests
90
- bring us, it's all worth it.
91
-
92
- [Ruby][] is a handy scripting
93
- language like Perl or Python. It's a modern, full featured language
94
- that happens to be quite handy for accomplishing tasks like code
95
- generation or automating one's workflow while developing in
96
- a compiled language such as C.
97
-
98
- [Ruby]: http://www.ruby-lang.org/en/
99
-
100
- [Rake][] is a utility written in Ruby
101
- for accomplishing dependency tracking and task automation
102
- common to building software. It's a modern, more flexible replacement
103
- for [Make][]).
104
- Rakefiles are Ruby files, but they contain build targets similar
105
- in nature to that of Makefiles (but you can also run Ruby code in
106
- your Rakefile).
107
-
108
- [Rake]: http://rubyrake.org/
109
- [Make]: http://en.wikipedia.org/wiki/Make_(software)
110
-
111
- [YAML][] is a "human friendly data serialization standard for all
112
- programming languages." It's kinda like a markup language, but don't
113
- call it that. With a YAML library, you can [serialize][] data structures
114
- to and from the file system in a textual, human readable form. Ceedling
115
- uses a serialized data structure as its configuration input.
116
-
117
- [YAML]: http://en.wikipedia.org/wiki/Yaml
118
- [serialize]: http://en.wikipedia.org/wiki/Serialization
119
-
120
- [Unity] is a [unit test framework][test] for C. It provides facilities
121
- for test assertions, executing tests, and collecting / reporting test
122
- results. Unity derives its name from its implementation in a single C
123
- source file (plus two C header files) and from the nature of its
124
- implementation - Unity will build in any C toolchain and is configurable
125
- for even the very minimalist of processors.
126
-
127
- [Unity]: http://github.com/ThrowTheSwitch/Unity
128
- [test]: http://en.wikipedia.org/wiki/Unit_testing
129
-
130
- [CMock] is a tool written in Ruby able to generate entire
131
- [mock functions][mock] in C code from a given C header file. Mock
132
- functions are invaluable in [interaction-based unit testing][ut].
133
- CMock's generated C code uses Unity.
134
-
135
- [CMock]: http://github.com/ThrowTheSwitch/CMock
136
- [mock]: http://en.wikipedia.org/wiki/Mock_object
137
- [ut]: http://martinfowler.com/articles/mocksArentStubs.html
138
-
139
- [CException] is a C source and header file that provide a simple
140
- [exception mechanism][exn] for C by way of wrapping up the
141
- [setjmp / longjmp][setjmp] standard library calls. Exceptions are a much
142
- cleaner and preferable alternative to managing and passing error codes
143
- up your return call trace.
144
-
145
- [CException]: http://github.com/ThrowTheSwitch/CException
146
- [exn]: http://en.wikipedia.org/wiki/Exception_handling
147
- [setjmp]: http://en.wikipedia.org/wiki/Setjmp.h
148
-
149
- Notes
150
- -----
151
-
152
- * YAML support is included with Ruby - requires no special installation
153
- or configuration.
154
-
155
- * Unity, CMock, and CException are bundled with Ceedling, and
156
- Ceedling is designed to glue them all together for your project
157
- as seamlessly as possible.
158
-
159
-
160
- Installation & Setup: What Exactly Do I Need to Get Started?
161
- ------------------------------------------------------------
162
-
163
- As a [Ruby gem](http://docs.rubygems.org/read/chapter/1):
164
-
165
- 1. [Download and install Ruby](http://www.ruby-lang.org/en/downloads/)
166
-
167
- 2. Use Ruby's command line gem package manager to install Ceedling:
168
- `gem install ceedling`
169
- (Unity, CMock, and CException come along with Ceedling for free)
170
-
171
- 3. Execute Ceedling at command line to create example project
172
- or an empty Ceedling project in your filesystem (executing
173
- `ceedling help` first is, well, helpful).
174
-
175
- Gem install notes:
176
-
177
- 1. Steps 1-2 are a one time affair for your local environment.
178
- When steps 1-2 are completed once, only step 3 is needed for
179
- each new project.
180
-
181
-
182
-
183
- General notes:
184
-
185
- 1. Certain advanced features of Ceedling rely on gcc and cpp
186
- as preprocessing tools. In most *nix systems, these tools
187
- are already available. For Windows environments, we recommend
188
- the [mingw project](http://www.mingw.org/) (Minimalist
189
- GNU for Windows). This represents an optional, additional
190
- setup / installation step to complement the list above. Upon
191
- installing mingw ensure your system path is updated or set
192
- [:environment][:path] in your `project.yml` file (see
193
- environment section later in this document).
194
-
195
- 2. To use a project file name other than the default `project.yml`
196
- or place the project file in a directory other than the one
197
- in which you'll run Rake, create an environment variable
198
- `CEEDLING_MAIN_PROJECT_FILE` with your desired project
199
- file path.
200
-
201
- 3. To better understand Rake conventions, Rake execution,
202
- and Rakefiles, consult the [Rake tutorial, examples, and
203
- user guide](http://rubyrake.org/).
204
-
205
- 4. When using Ceedling in Windows environments, a test file name may
206
- not include the sequences “patch” or “setup”. The Windows Installer
207
- Detection Technology (part of UAC), requires administrator
208
- privileges to execute file names with these strings.
209
-
210
-
211
-
212
- Now What? How Do I Make It GO?
213
- ------------------------------
214
-
215
- We're getting a little ahead of ourselves here, but it's good
216
- context on how to drive this bus. Everything is done via the command
217
- line. We'll cover conventions and how to actually configure
218
- your project in later sections.
219
-
220
- To run tests, build your release artifact, etc., you will be interacting
221
- with Rake on the command line. Ceedling works with Rake to present
222
- you with named tasks that coordinate the file generation and
223
- build steps needed to accomplish something useful. You can also
224
- add your own independent Rake tasks or create plugins to extend
225
- Ceedling (more on this later).
226
-
227
-
228
- * `ceedling [no arguments]`:
229
-
230
- Run the default Rake task (conveniently recognized by the name default
231
- by Rake). Neither Rake nor Ceedling provide a default task. Rake will
232
- abort if run without arguments when no default task is defined. You can
233
- conveniently define a default task in the Rakefile discussed in the
234
- preceding setup & installation section of this document.
235
-
236
- * `ceedling -T`:
237
-
238
- List all available Rake tasks with descriptions (Rake tasks without
239
- descriptions are not listed). -T is a command line switch for Rake and
240
- not the same as tasks that follow.
241
-
242
- * `ceedling <tasks...> --trace`:
243
-
244
- For advanced users troubleshooting a confusing build error, debug
245
- Ceedling or a plugin, --trace provides a stack trace of dependencies
246
- walked during task execution and any Ruby failures along the way. Note
247
- that --trace is a command line switch for Rake and is not the same as
248
- tasks that follow.
249
-
250
- * `ceedling environment`:
251
-
252
- List all configured environment variable names and string values. This
253
- task is helpful in verifying the evaluatio of any Ruby expressions in
254
- the [:environment] section of your config file.`: Note: Ceedling may
255
- set some convenience environment variables by default.
256
-
257
- * `ceedling paths:*`:
258
-
259
- List all paths collected from [:paths] entries in your YAML config
260
- file where * is the name of any section contained in [:paths]. This
261
- task is helpful in verifying the expansion of path wildcards / globs
262
- specified in the [:paths] section of your config file.
263
-
264
- * `ceedling files:assembly`
265
- * `ceedling files:header`
266
- * `ceedling files:source`
267
- * `ceedling files:test`
268
-
269
- List all files and file counts collected from the relevant search
270
- paths specified by the [:paths] entries of your YAML config file. The
271
- files:assembly task will only be available if assembly support is
272
- enabled in the [:release_build] section of your configuration file.
273
-
274
- * `ceedling options:*`:
275
-
276
- Load and merge configuration settings into the main project
277
- configuration. Each task is named after a *.yml file found in the
278
- configured options directory. See documentation for the configuration
279
- setting [:project][:options_path] and for options files in advanced
280
- topics.
281
-
282
- * `ceedling test:all`:
283
-
284
- Run all unit tests (rebuilding anything that's changed along the way).
285
-
286
- * `ceedling test:delta`:
287
-
288
- Run only those unit tests for which the source or test files have
289
- changed (i.e. incremental build). Note: with the
290
- [:project][:use_test_preprocessor] configuration file option set,
291
- runner files are always regenerated limiting the total efficiency this
292
- text execution option can afford.
293
-
294
- * `ceedling test:*`:
295
-
296
- Execute the named test file or the named source file that has an
297
- accompanying test. No path. Examples: ceedling test:foo.c or ceed
298
- test:test_foo.c
299
-
300
- * `ceedling test:pattern[*]`:
301
-
302
- Execute any tests whose name and/or path match the regular expression
303
- pattern (case sensitive). Example: ceedling "test:pattern[(I|i)nit]" will
304
- execute all tests named for initialization testing. Note: quotes may
305
- be necessary around the ceedling parameter to distinguish regex characters
306
- from command line operators.
307
-
308
- * `ceedling test:path[*]`:
309
-
310
- Execute any tests whose path contains the given string (case
311
- sensitive). Example: ceedling test:path[foo/bar] will execute all tests
312
- whose path contains foo/bar. Note: both directory separator characters
313
- / and \ are valid.
314
-
315
- * `ceedling release`:
316
-
317
- Build all source into a release artifact (if the release build option
318
- is configured).
319
-
320
- * `ceedling release:compile:*`:
321
-
322
- Sometimes you just need to compile a single file dagnabit. Example:
323
- ceedling release:compile:foo.c
324
-
325
- * `ceedling release:assemble:*`:
326
-
327
- Sometimes you just need to assemble a single file doggonit. Example:
328
- ceedling release:assemble:foo.s
329
-
330
- * `ceedling module:create[Filename]`:
331
- * `ceedling module:create[<Path:>Filename]`:
332
-
333
- It's often helpful to create a file automatically. What's better than
334
- that? Creating a source file, a header file, and a corresponding test
335
- file all in one step!
336
-
337
- There are also patterns which can be specified to automatically generate
338
- a bunch of files. Try `ceedling module:create[Poodles,mch]` for example!
339
-
340
- The module generator has several options you can configure.
341
- F.e. Generating the source/header/test file in a subdirectory (by adding <Path> when calling module:create).
342
- For more info, refer to the [Module Generator](https://github.com/ThrowTheSwitch/Ceedling/blob/master/docs/CeedlingPacket.md#module-generator) section.
343
-
344
- * `ceedling logging <tasks...>`:
345
-
346
- Enable logging to <build path>/logs. Must come before test and release
347
- tasks to log their steps and output. Log names are a concatenation of
348
- project, user, and option files loaded. User and option files are
349
- documented in the advanced topics section of this document.
350
-
351
- * `ceedling verbosity[x] <tasks...>`:
352
-
353
- Change the default verbosity level. [x] ranges from 0 (quiet) to 4
354
- (obnoxious). Level [3] is the default. The verbosity task must precede
355
- all tasks in the command line list for which output is desired to be
356
- seen. Verbosity settings are generally most meaningful in conjunction
357
- with test and release tasks.
358
-
359
- * `ceedling summary`:
360
-
361
- If plugins are enabled, this task will execute the summary method of
362
- any plugins supporting it. This task is intended to provide a quick
363
- roundup of build artifact metrics without re-running any part of the
364
- build.
365
-
366
- * `ceedling clean`:
367
-
368
- Deletes all toolchain binary artifacts (object files, executables),
369
- test results, and any temporary files. Clean produces no output at the
370
- command line unless verbosity has been set to an appreciable level.
371
-
372
- * `ceedling clobber`:
373
-
374
- Extends clean task's behavior to also remove generated files: test
375
- runners, mocks, preprocessor output. Clobber produces no output at the
376
- command line unless verbosity has been set to an appreciable level.
377
-
378
- To better understand Rake conventions, Rake execution, and
379
- Rakefiles, consult the [Rake tutorial, examples, and user guide][guide].
380
-
381
- [guide]: http://rubyrake.org/
382
-
383
- At present, none of Ceedling's commands provide persistence.
384
- That is, they must each be specified at the command line each time
385
- they are needed. For instance, Ceedling's verbosity command
386
- only affects output at the time it's run.
387
-
388
- Individual test and release file tasks
389
- are not listed in `-T` output. Because so many files may be present
390
- it's unwieldy to list them all.
391
-
392
- Multiple rake tasks can be executed at the command line (order
393
- is executed as provided). For example, `ceed
394
- clobber test:all release` will removed all generated files;
395
- build and run all tests; and then build all source - in that order.
396
- If any Rake task fails along the way, execution halts before the
397
- next task.
398
-
399
- The `clobber` task removes certain build directories in the
400
- course of deleting generated files. In general, it's best not
401
- to add to source control any Ceedling generated directories
402
- below the root of your top-level build directory. That is, leave
403
- anything Ceedling & its accompanying tools generate out of source
404
- control (but go ahead and add the top-level build directory that
405
- holds all that stuff). Also, since Ceedling is pretty smart about
406
- what it rebuilds and regenerates, you needn't clobber often.
407
-
408
- Important Conventions
409
- =====================
410
-
411
- Directory Structure, Filenames & Extensions
412
- -------------------------------------------
413
-
414
- Much of Ceedling's functionality is driven by collecting files
415
- matching certain patterns inside the paths it's configured
416
- to search. See the documentation for the [:extensions] section
417
- of your configuration file (found later in this document) to
418
- configure the file extensions Ceedling uses to match and collect
419
- files. Test file naming is covered later in this section.
420
-
421
- Test files and source files must be segregated by directories.
422
- Any directory structure will do. Tests can be held in subdirectories
423
- within source directories, or tests and source directories
424
- can be wholly separated at the top of your project's directory
425
- tree.
426
-
427
- Search Path Order
428
- -----------------
429
-
430
- When Ceedling searches for files (e.g. looking for header files
431
- to mock) or when it provides search paths to any of the default
432
- gcc toolchain executables, it organizes / prioritizes its search
433
- paths. The order is always: test paths, support paths, source
434
- paths, and then include paths. This can be useful, for instance,
435
- in certain testing scenarios where we desire Ceedling or a compiler
436
- to find a stand-in header file in our support directory before
437
- the actual source header file of the same name.
438
-
439
- This convention only holds when Ceedling is using its default
440
- tool configurations and / or when tests are involved. If you define
441
- your own tools in the configuration file (see the [:tools] section
442
- documented later in this here document), you have complete control
443
- over what directories are searched and in what order. Further,
444
- test and support directories are only searched when appropriate.
445
- That is, when running a release build, test and support directories
446
- are not used at all.
447
-
448
- Source Files & Binary Release Artifacts
449
- ---------------------------------------
450
-
451
- Your binary release artifact results from the compilation and
452
- linking of all source files Ceedling finds in the specified source
453
- directories. At present only source files with a single (configurable)
454
- extension are recognized. That is, *.c and *.cc files will not
455
- both be recognized - only one or the other. See the configuration
456
- options and defaults in the documentation for the [:extensions]
457
- sections of your configuration file (found later in this document).
458
-
459
- Test Files & Executable Test Fixtures
460
- -------------------------------------
461
-
462
- Ceedling builds each individual test file with its accompanying
463
- source file(s) into a single, monolithic test fixture executable.
464
- Test files are recognized by a naming convention: a (configurable)
465
- prefix such as "`test_`" in the file name with the same file extension
466
- as used by your C source files. See the configuration options
467
- and defaults in the documentation for the [:project] and [:extensions]
468
- sections of your configuration file (found later in this document).
469
- Depending on your configuration options, Ceedling can recognize
470
- a variety of test file naming patterns in your test search paths.
471
- For example: `test_some_super_functionality.c`, `TestYourSourceFile.cc`,
472
- or `testing_MyAwesomeCode.C` could each be valid test file
473
- names. Note, however, that Ceedling can recognize only one test
474
- file naming convention per project.
475
-
476
- Ceedling knows what files to compile and link into each individual
477
- test executable by way of the #include list contained in each
478
- test file. Any C source files in the configured search directories
479
- that correspond to the header files included in a test file will
480
- be compiled and linked into the resulting test fixture executable.
481
- From this same #include list, Ceedling knows which files to mock
482
- and compile and link into the test executable (if you use mocks
483
- in your tests). That was a lot of clauses and information in a very
484
- few sentences; the example that follows in a bit will make it clearer.
485
-
486
- By naming your test functions according to convention, Ceedling
487
- will extract and collect into a runner C file calls to all your
488
- test case functions. This runner file handles all the execution
489
- minutiae so that your test file can be quite simple and so that
490
- you never forget to wire up a test function to be executed. In this
491
- generated runner lives the `main()` entry point for the resulting
492
- test executable. There are no configuration options for the
493
- naming convention of your test case functions. A test case function
494
- signature must have these three elements: void return, void
495
- parameter list, and the function name prepended with lowercase
496
- "`test`". In other words, a test function signature should look
497
- like this: `void test``[any name you like]``(void)`.
498
-
499
- A commented sample test file follows on the next page. Also, see
500
- the sample project contained in the Ceedling documentation
501
- bundle.
502
-
503
- ```c
504
- // test_foo.c -----------------------------------------------
505
- #include "unity.h" // compile/link in Unity test framework
506
- #include "types.h" // header file with no *.c file -- no compilation/linking
507
- #include "foo.h" // source file foo.c under test
508
- #include "mock_bar.h" // bar.h will be found and mocked as mock_bar.c + compiled/linked in;
509
- // foo.c includes bar.h and uses functions declared in it
510
- #include "mock_baz.h" // baz.h will be found and mocked as mock_baz.c + compiled/linked in
511
- // foo.c includes baz.h and uses functions declared in it
512
-
513
-
514
- void setUp(void) {} // every test file requires this function;
515
- // setUp() is called by the generated runner before each test case function
516
-
517
- void tearDown(void) {} // every test file requires this function;
518
- // tearDown() is called by the generated runner before each test case function
519
-
520
- // a test case function
521
- void test_Foo_Function1_should_Call_Bar_AndGrill(void)
522
- {
523
- Bar_AndGrill_Expect(); // setup function from mock_bar.c that instructs our
524
- // framework to expect Bar_AndGrill() to be called once
525
- TEST_ASSERT_EQUAL(0xFF, Foo_Function1()); // assertion provided by Unity
526
- // Foo_Function1() calls Bar_AndGrill() & returns a byte
527
- }
528
-
529
- // another test case function
530
- void test_Foo_Function2_should_Call_Baz_Tec(void)
531
- {
532
- Baz_Tec_ExpectAnd_Return(1); // setup function provided by mock_baz.c that instructs our
533
- // framework to expect Baz_Tec() to be called once and return 1
534
- TEST_ASSERT_TRUE(Foo_Function2()); // assertion provided by Unity
535
- }
536
-
537
- // end of test_foo.c ----------------------------------------
538
- ```
539
-
540
- From the test file specified above Ceedling will generate `test_foo_runner.c`;
541
- this runner file will contain `main()` and call both of the example
542
- test case functions.
543
-
544
- The final test executable will be `test_foo.exe` (for Windows
545
- machines or `test_foo.out` for *nix systems - depending on default
546
- or configured file extensions). Based on the #include list above,
547
- the test executable will be the output of the linker having processed
548
- `unity.o`, `foo.o`, `mock_bar.o`, `mock_baz.o`, `test_foo.o`,
549
- and `test_foo_runner.o`. Ceedling finds the files, generates
550
- mocks, generates a runner, compiles all the files, and links
551
- everything into the test executable. Ceedling will then run
552
- the test executable and collect test results from it to be reported
553
- to the developer at the command line.
554
-
555
- For more on the assertions and mocks shown, consult the documentation
556
- for Unity and CMock.
557
-
558
- The Magic of Dependency Tracking
559
- --------------------------------
560
-
561
- Ceedling is pretty smart in using Rake to build up your project's
562
- dependencies. This means that Ceedling automagically rebuilds
563
- all the appropriate files in your project when necessary: when
564
- your configuration changes, Ceedling or any of the other tools
565
- are updated, or your source or test files change. For instance,
566
- if you modify a header file that is mocked, Ceedling will ensure
567
- that the mock is regenerated and all tests that use that mock are
568
- rebuilt and re-run when you initiate a relevant testing task.
569
- When you see things rebuilding, it's for a good reason. Ceedling
570
- attempts to regenerate and rebuild only what's needed for a given
571
- execution of a task. In the case of large projects, assembling
572
- dependencies and acting upon them can cause some delay in executing
573
- tasks.
574
-
575
- With one exception, the trigger to rebuild or regenerate a file
576
- is always a disparity in timestamps between a target file and
577
- its source - if an input file is newer than its target dependency,
578
- the target is rebuilt or regenerated. For example, if the C source
579
- file from which an object file is compiled is newer than that object
580
- file on disk, recompilation will occur (of course, if no object
581
- file exists on disk, compilation will always occur). The one
582
- exception to this dependency behavior is specific to your input
583
- configuration. Only if your logical configuration changes
584
- will a system-wide rebuild occur. Reorganizing your input configuration
585
- or otherwise updating its file timestamp without modifying
586
- the values within the file will not trigger a rebuild. This behavior
587
- handles the various ways in which your input configuration can
588
- change (discussed later in this document) without having changed
589
- your actual project YAML file.
590
-
591
- Ceedling needs a bit of help to accomplish its magic with deep
592
- dependencies. Shallow dependencies are straightforward:
593
- a mock is dependent on the header file from which it's generated,
594
- a test file is dependent upon the source files it includes (see
595
- the preceding conventions section), etc. Ceedling handles
596
- these "out of the box." Deep dependencies are specifically a
597
- C-related phenomenon and occur as a consequence of include statements
598
- within C source files. Say a source file includes a header file
599
- and that header file in turn includes another header file which
600
- includes still another header file. A change to the deepest header
601
- file should trigger a recompilation of the source file, a relinking
602
- of all the object files comprising a test fixture, and a new execution
603
- of that test fixture.
604
-
605
- Ceedling can handle deep dependencies but only with the help
606
- of a C preprocessor. Ceedling is quite capable, but a full C preprocessor
607
- it ain't. Your project can be configured to use a C preprocessor
608
- or not. Simple projects or large projects constructed so as to
609
- be quite flat in their include structure generally don't need
610
- deep dependency preprocessing - and can enjoy the benefits of
611
- faster execution. Legacy code, on the other hand, will almost
612
- always want to be tested with deep preprocessing enabled. Set
613
- up of the C preprocessor is covered in the documentation for the
614
- [:project] and [:tools] section of the configuration file (later
615
- in this document). Ceedling contains all the configuration
616
- necessary to use the gcc preprocessor by default. That is, as
617
- long as gcc is in your system search path, deep preprocessing
618
- of deep dependencies is available to you by simply enabling it
619
- in your project configuration file.
620
-
621
- Ceedling's Build Output
622
- -----------------------
623
-
624
- Ceedling requires a top-level build directory for all the stuff
625
- that it, the accompanying test tools, and your toolchain generate.
626
- That build directory's location is configured in the [:project]
627
- section of your configuration file (discussed later). There
628
- can be a ton of generated files. By and large, you can live a full
629
- and meaningful life knowing absolutely nothing at all about
630
- the files and directories generated below the root build directory.
631
-
632
- As noted already, it's good practice to add your top-level build
633
- directory to source control but nothing generated beneath it.
634
- You'll spare yourself headache if you let Ceedling delete and
635
- regenerate files and directories in a non-versioned corner
636
- of your project's filesystem beneath the top-level build directory.
637
-
638
- The `artifacts` directory is the one and only directory you may
639
- want to know about beneath the top-level build directory. The
640
- subdirectories beneath `artifacts` will hold your binary release
641
- target output (if your project is configured for release builds)
642
- and will serve as the conventional location for plugin output.
643
- This directory structure was chosen specifically because it
644
- tends to work nicely with Continuous Integration setups that
645
- recognize and list build artifacts for retrieval / download.
646
-
647
- The Almighty Project Configuration File (in Glorious YAML)
648
- ----------------------------------------------------------
649
-
650
- Please consult YAML documentation for the finer points of format
651
- and to understand details of our YAML-based configuration file.
652
- We recommend [Wikipedia's entry on YAML](http://en.wikipedia.org/wiki/Yaml)
653
- for this. A few highlights from that reference page:
654
-
655
- * YAML streams are encoded using the set of printable Unicode
656
- characters, either in UTF-8 or UTF-16
657
-
658
- * Whitespace indentation is used to denote structure; however
659
- tab characters are never allowed as indentation
660
-
661
- * Comments begin with the number sign ( # ), can start anywhere
662
- on a line, and continue until the end of the line unless enclosed
663
- by quotes
664
-
665
- * List members are denoted by a leading hyphen ( - ) with one member
666
- per line, or enclosed in square brackets ( [ ] ) and separated
667
- by comma space ( , )
668
-
669
- * Hashes are represented using the colon space ( : ) in the form
670
- key: value, either one per line or enclosed in curly braces
671
- ( { } ) and separated by comma space ( , )
672
-
673
- * Strings (scalars) are ordinarily unquoted, but may be enclosed
674
- in double-quotes ( " ), or single-quotes ( ' )
675
-
676
- * YAML requires that colons and commas used as list separators
677
- be followed by a space so that scalar values containing embedded
678
- punctuation can generally be represented without needing
679
- to be enclosed in quotes
680
-
681
- * Repeated nodes are initially denoted by an ampersand ( & ) and
682
- thereafter referenced with an asterisk ( * )
683
-
684
-
685
- Notes on what follows:
686
-
687
- * Each of the following sections represent top-level entries
688
- in the YAML configuration file.
689
-
690
- * Unless explicitly specified in the configuration file, default
691
- values are used by Ceedling.
692
-
693
- * These three settings, at minimum, must be specified:
694
- * [:project][:build_root]
695
- * [:paths][:source]
696
- * [:paths][:test]
697
-
698
- * As much as is possible, Ceedling validates your settings in
699
- properly formed YAML.
700
-
701
- * Improperly formed YAML will cause a Ruby error when the YAML
702
- is parsed. This is usually accompanied by a complaint with
703
- line and column number pointing into the project file.
704
-
705
- * Certain advanced features rely on gcc and cpp as preprocessing
706
- tools. In most *nix systems, these tools are already available.
707
- For Windows environments, we recommend the [mingw project](http://www.mingw.org/)
708
- (Minimalist GNU for Windows).
709
-
710
- * Ceedling is primarily meant as a build tool to support automated
711
- unit testing. All the heavy lifting is involved there. Creating
712
- a simple binary release build artifact is quite trivial in
713
- comparison. Consequently, most default options and the construction
714
- of Ceedling itself is skewed towards supporting testing though
715
- Ceedling can, of course, build your binary release artifact
716
- as well. Note that complex binary release artifacts (e.g.
717
- application + bootloader or multiple libraries) are beyond
718
- Ceedling's release build ability.
719
-
720
-
721
- Conventions / features of Ceedling-specific YAML:
722
-
723
- * Any second tier setting keys anywhere in YAML whose names end
724
- in `_path` or `_paths` are automagically processed like all
725
- Ceedling-specific paths in the YAML to have consistent directory
726
- separators (i.e. "/") and to take advantage of inline Ruby
727
- string expansion (see [:environment] setting below for further
728
- explanation of string expansion).
729
-
730
-
731
- **Let's Be Careful Out There:** Ceedling performs validation
732
- on the values you set in your configuration file (this assumes
733
- your YAML is correct and will not fail format parsing, of course).
734
- That said, validation is limited to only those settings Ceedling
735
- uses and those that can be reasonably validated. Ceedling does
736
- not limit what can exist within your configuration file. In this
737
- way, you can take full advantage of YAML as well as add sections
738
- and values for use in your own custom plugins (documented later).
739
- The consequence of this is simple but important. A misspelled
740
- configuration section name or value name is unlikely to cause
741
- Ceedling any trouble. Ceedling will happily process that section
742
- or value and simply use the properly spelled default maintained
743
- internally - thus leading to unexpected behavior without warning.
744
-
745
- project: global project settings
746
-
747
-
748
- * `build_root`:
749
-
750
- Top level directory into which generated path structure and files are
751
- placed. Note: this is one of the handful of configuration values that
752
- must be set. The specified path can be absolute or relative to your
753
- working directory.
754
-
755
- **Default**: (none)
756
-
757
- * `use_exceptions`:
758
-
759
- Configures the build environment to make use of CException. Note that
760
- if you do not use exceptions, there's no harm in leaving this as its
761
- default value.
762
-
763
- **Default**: TRUE
764
-
765
- * `use_mocks`:
766
-
767
- Configures the build environment to make use of CMock. Note that if
768
- you do not use mocks, there's no harm in leaving this setting as its
769
- default value.
770
-
771
- **Default**: TRUE
772
-
773
- * `use_test_preprocessor`:
774
-
775
- This option allows Ceedling to work with test files that contain
776
- conditional compilation statements (e.g. #ifdef) and header files you
777
- wish to mock that contain conditional preprocessor statements and/or
778
- macros.
779
-
780
- Ceedling and CMock are advanced tools with sophisticated parsers.
781
- However, they do not include entire C language preprocessors.
782
- Consequently, with this option enabled, Ceedling will use gcc's
783
- preprocessing mode and the cpp preprocessor tool to strip down /
784
- expand test files and headers to their applicable content which can
785
- then be processed by Ceedling and CMock.
786
-
787
- With this option enabled, the gcc & cpp tools must exist in an
788
- accessible system search path and test runner files are always
789
- regenerated.
790
-
791
- **Default**: FALSE
792
-
793
- * `use_deep_dependencies`:
794
-
795
- The base rules and tasks that Ceedling creates using Rake capture most
796
- of the dependencies within a standard project (e.g. when the source
797
- file accompanying a test file changes, the corresponding test fixture
798
- executable will be rebuilt when tests are re-run). However, deep
799
- dependencies cannot be captured this way. If a typedef or macro
800
- changes in a header file three levels of #include statements deep,
801
- this option allows the appropriate incremental build actions to occur
802
- for both test execution and release builds.
803
-
804
- This is accomplished by using the dependencies discovery mode of gcc.
805
- With this option enabled, gcc must exist in an accessible system
806
- search path.
807
-
808
- **Default**: FALSE
809
-
810
- * `generate_deep_dependencies`:
811
-
812
- When `use_deep_dependencies` is set to TRUE, Ceedling will run a separate
813
- build step to generate the deep dependencies. If you are using gcc as your
814
- primary compiler, or another compiler that can generate makefile rules as
815
- a side effect of compilation, then you can set this to FALSE to avoid the
816
- extra build step but still use the deep dependencies data when deciding
817
- which source files to rebuild.
818
-
819
- **Default**: TRUE
820
-
821
- * `test_file_prefix`:
822
-
823
- Ceedling collects test files by convention from within the test file
824
- search paths. The convention includes a unique name prefix and a file
825
- extension matching that of source files.
826
-
827
- Why not simply recognize all files in test directories as test files?
828
- By using the given convention, we have greater flexibility in what we
829
- do with C files in the test directories.
830
-
831
- **Default**: "test_"
832
-
833
- * `options_paths`:
834
-
835
- Just as you may have various build configurations for your source
836
- codebase, you may need variations of your project configuration.
837
-
838
- By specifying options paths, Ceedling will search for other project
839
- YAML files, make command line tasks available (ceedling options:variation
840
- for a variation.yml file), and merge the project configuration of
841
- these option files in with the main project file at runtime. See
842
- advanced topics.
843
-
844
- Note these Rake tasks at the command line - like verbosity or logging
845
- control - must come before the test or release task they are meant to
846
- modify.
847
-
848
- **Default**: [] (empty)
849
-
850
- * `release_build`:
851
-
852
- When enabled, a release Rake task is exposed. This configuration
853
- option requires a corresponding release compiler and linker to be
854
- defined (gcc is used as the default).
855
-
856
- More release configuration options are available in the release_build
857
- section.
858
-
859
- **Default**: FALSE
860
-
861
-
862
- Example `[:project]` YAML blurb
863
-
864
- ```yaml
865
- :project:
866
- :build_root: project_awesome/build
867
- :use_exceptions: FALSE
868
- :use_test_preprocessor: TRUE
869
- :use_deep_dependencies: TRUE
870
- :options_paths:
871
- - project/options
872
- - external/shared/options
873
- :release_build: TRUE
874
- ```
875
-
876
- Ceedling is primarily concerned with facilitating the somewhat
877
- complicated mechanics of automating unit tests. The same mechanisms
878
- are easily capable of building a final release binary artifact
879
- (i.e. non test code; the thing that is your final working software
880
- that you execute on target hardware).
881
-
882
-
883
- * `output`:
884
-
885
- The name of your release build binary artifact to be found in <build
886
- path>/artifacts/release. Ceedling sets the default artifact file
887
- extension to that as is explicitly specified in the [:extensions]
888
- section or as is system specific otherwise.
889
-
890
- **Default**: `project.exe` or `project.out`
891
-
892
- * `use_assembly`:
893
-
894
- If assembly code is present in the source tree, this option causes
895
- Ceedling to create appropriate build directories and use an assembler
896
- tool (default is the GNU tool as - override available in the [:tools]
897
- section.
898
-
899
- **Default**: FALSE
900
-
901
- * `artifacts`:
902
-
903
- By default, Ceedling copies to the <build path>/artifacts/release
904
- directory the output of the release linker and (optionally) a map
905
- file. Many toolchains produce other important output files as well.
906
- Adding a file path to this list will cause Ceedling to copy that file
907
- to the artifacts directory. The artifacts directory is helpful for
908
- organizing important build output files and provides a central place
909
- for tools such as Continuous Integration servers to point to build
910
- output. Selectively copying files prevents incidental build cruft from
911
- needlessly appearing in the artifacts directory. Note that inline Ruby
912
- string replacement is available in the artifacts paths (see discussion
913
- in the [:environment] section).
914
-
915
- **Default**: [] (empty)
916
-
917
- Example `[:release_build]` YAML blurb
918
-
919
- ```yaml
920
- :release_build:
921
- :output: top_secret.bin
922
- :use_assembly: TRUE
923
- :artifacts:
924
- - build/release/out/c/top_secret.s19
925
- ```
926
-
927
- **paths**: options controlling search paths for source and header
928
- (and assembly) files
929
-
930
- * `test`:
931
-
932
- All C files containing unit test code. Note: this is one of the
933
- handful of configuration values that must be set.
934
-
935
- **Default**: [] (empty)
936
-
937
- * `source`:
938
-
939
- All C files containing release code (code to be tested). Note: this is
940
- one of the handful of configuration values that must be set.
941
-
942
- **Default**: [] (empty)
943
-
944
- * `support`:
945
-
946
- Any C files you might need to aid your unit testing. For example, on
947
- occasion, you may need to create a header file containing a subset of
948
- function signatures matching those elsewhere in your code (e.g. a
949
- subset of your OS functions, a portion of a library API, etc.). Why?
950
- To provide finer grained control over mock function substitution or
951
- limiting the size of the generated mocks.
952
-
953
- **Default**: [] (empty)
954
-
955
- * `include`:
956
-
957
- Any header files not already in the source search path. Note there's
958
- no practical distinction between this search path and the source
959
- search path; it's merely to provide options or to support any
960
- peculiar source tree organization.
961
-
962
- **Default**: [] (empty)
963
-
964
- * `test_toolchain_include`:
965
-
966
- System header files needed by the test toolchain - should your
967
- compiler be unable to find them, finds the wrong system include search
968
- path, or you need a creative solution to a tricky technical problem.
969
- Note that if you configure your own toolchain in the [:tools] section,
970
- this search path is largely meaningless to you. However, this is a
971
- convenient way to control the system include path should you rely on
972
- the default gcc tools.
973
-
974
- **Default**: [] (empty)
975
-
976
- * `release_toolchain_include`:
977
-
978
- Same as preceding albeit related to the release toolchain.
979
-
980
- **Default**: [] (empty)
981
-
982
- * `<custom>`
983
-
984
- Any paths you specify for custom list. List is available to tool
985
- configurations and/or plugins. Note a distinction. The preceding names
986
- are recognized internally to Ceedling and the path lists are used to
987
- build collections of files contained in those paths. A custom list is
988
- just that - a custom list of paths.
989
-
990
- Notes on path grammar within the [:paths] section:
991
-
992
- * Order of search paths listed in [:paths] is preserved when used by an
993
- entry in the [:tools] section
994
-
995
- * Wherever multiple path lists are combined for use Ceedling prioritizes
996
- path groups as follows:
997
- test paths, support paths, source paths, include paths.
998
-
999
- This can be useful, for instance, in certain testing scenarios where
1000
- we desire Ceedling or the compiler to find a stand-in header file before
1001
- the actual source header file of the same name.
1002
-
1003
- * Paths:
1004
-
1005
- 1. can be absolute or relative
1006
-
1007
- 2. can be singly explicit - a single fully specified path
1008
-
1009
- 3. can include a glob operator (more on this below)
1010
-
1011
- 4. can use inline Ruby string replacement (see [:environment]
1012
- section for more)
1013
-
1014
- 5. default as an addition to a specific search list (more on this
1015
- in the examples)
1016
-
1017
- 6. can act to subtract from a glob included in the path list (more
1018
- on this in the examples)
1019
-
1020
-
1021
- [Globs](http://ruby.about.com/od/beginningruby/a/dir2.htm)
1022
- as used by Ceedling are wildcards for specifying directories
1023
- without the need to list each and every required search path.
1024
- Ceedling globs operate just as Ruby globs except that they are
1025
- limited to matching directories and not files. Glob operators
1026
- include the following * ** ? [-] {,} (note: this list is space separated
1027
- and not comma separated as commas are used within the bracket
1028
- operators).
1029
-
1030
- * `*`:
1031
-
1032
- All subdirectories of depth 1 below the parent path and including the
1033
- parent path
1034
-
1035
- * `**`:
1036
-
1037
- All subdirectories recursively discovered below the parent path and
1038
- including the parent path
1039
-
1040
- * `?`:
1041
-
1042
- Single alphanumeric character wildcard
1043
-
1044
- * `[x-y]`:
1045
-
1046
- Single alphanumeric character as found in the specified range
1047
-
1048
- * `{x,y}`:
1049
-
1050
- Single alphanumeric character from the specified list
1051
-
1052
- Example [:paths] YAML blurbs
1053
-
1054
- ```yaml
1055
- :paths:
1056
- :source: #together the following comprise all source search paths
1057
- - project/source/* #expansion yields all subdirectories of depth 1 plus parent directory
1058
- - project/lib #single path
1059
- :test: #all test search paths
1060
- - project/**/test? #expansion yields any subdirectory found anywhere in the project that
1061
- #begins with "test" and contains 5 characters
1062
-
1063
- :paths:
1064
- :source: #all source search paths
1065
- - +:project/source/** #all subdirectories recursively discovered plus parent directory
1066
- - -:project/source/os/generated #subtract os/generated directory from expansion of above glob
1067
- #note that '+:' notation is merely aesthetic; default is to add
1068
-
1069
- :test: #all test search paths
1070
- - project/test/bootloader #explicit, single search paths (searched in the order specified)
1071
- - project/test/application
1072
- - project/test/utilities
1073
-
1074
- :custom: #custom path list
1075
- - "#{PROJECT_ROOT}/other" #inline Ruby string expansion
1076
- ```
1077
-
1078
- Globs and inline Ruby string expansion can require trial and
1079
- error to arrive at your intended results. Use the `ceedling paths:*`
1080
- command line options (documented in preceding section) to verify
1081
- your settings.
1082
-
1083
- Ceedling relies on file collections automagically assembled
1084
- from paths, globs, and file extensions. File collections greatly
1085
- simplify project set up. However, sometimes you need to remove
1086
- from or add individual files to those collections.
1087
-
1088
-
1089
- * `test`:
1090
-
1091
- Modify the collection of unit test C files.
1092
-
1093
- **Default**: [] (empty)
1094
-
1095
- * `source`:
1096
-
1097
- Modify the collection of all source files used in unit test builds and release builds.
1098
-
1099
- **Default**: [] (empty)
1100
-
1101
- * `assembly`:
1102
-
1103
- Modify the (optional) collection of assembly files used in release builds.
1104
-
1105
- **Default**: [] (empty)
1106
-
1107
- * `include`:
1108
-
1109
- Modify the collection of all source header files used in unit test builds (e.g. for mocking) and release builds.
1110
-
1111
- **Default**: [] (empty)
1112
-
1113
- * `support`:
1114
-
1115
- Modify the collection of supporting C files available to unit tests builds.
1116
-
1117
- **Default**: [] (empty)
1118
-
1119
-
1120
- Note: All path grammar documented in [:paths] section applies
1121
- to [:files] path entries - albeit at the file path level and not
1122
- the directory level.
1123
-
1124
- Example [:files] YAML blurb
1125
-
1126
- ```yaml
1127
- :files:
1128
- :source:
1129
- - callbacks/comm.c # entry defaults to file addition
1130
- - +:callbacks/comm*.c # add all comm files matching glob pattern
1131
- - -:source/board/atm134.c # not our board
1132
- :test:
1133
- - -:test/io/test_output_manager.c # remove unit tests from test build
1134
- ```
1135
-
1136
- **environment:** inserts environment variables into the shell
1137
- instance executing configured tools
1138
-
1139
- Ceedling creates environment variables from any key / value
1140
- pairs in the environment section. Keys become an environment
1141
- variable name in uppercase. The values are strings assigned
1142
- to those environment variables. These value strings are either
1143
- simple string values in YAML or the concatenation of a YAML array.
1144
-
1145
- Ceedling is able to execute inline Ruby string substitution
1146
- code to set environment variables. This evaluation occurs when
1147
- the project file is first processed for any environment pair's
1148
- value string including the Ruby string substitution pattern
1149
- `#{…}`. Note that environment value strings that _begin_ with
1150
- this pattern should always be enclosed in quotes. YAML defaults
1151
- to processing unquoted text as a string; quoting text is optional.
1152
- If an environment pair's value string begins with the Ruby string
1153
- substitution pattern, YAML will interpret the string as a Ruby
1154
- comment (because of the `#`). Enclosing each environment value
1155
- string in quotes is a safe practice.
1156
-
1157
- [:environment] entries are processed in the configured order
1158
- (later entries can reference earlier entries).
1159
-
1160
- Special case: PATH handling
1161
-
1162
- In the specific case of specifying an environment key named _path_,
1163
- an array of string values will be concatenated with the appropriate
1164
- platform-specific path separation character (e.g. ':' on *nix,
1165
- ';' on Windows). All other instances of environment keys assigned
1166
- YAML arrays use simple concatenation.
1167
-
1168
- Example [:environment] YAML blurb
1169
-
1170
- ```yaml
1171
- :environment:
1172
- - :license_server: gizmo.intranet #LICENSE_SERVER set with value "gizmo.intranet"
1173
- - :license: "#{`license.exe`}" #LICENSE set to string generated from shelling out to
1174
- #execute license.exe; note use of enclosing quotes
1175
-
1176
- - :path: #concatenated with path separator (see special case above)
1177
- - Tools/gizmo/bin #prepend existing PATH with gizmo path
1178
- - "#{ENV['PATH']}" #pattern #{…} triggers ruby evaluation string substitution
1179
- #note: value string must be quoted because of '#'
1180
-
1181
- - :logfile: system/logs/thingamabob.log #LOGFILE set with path for a log file
1182
- ```
1183
-
1184
- **extension**: configure file name extensions used to collect lists of files searched in [:paths]
1185
-
1186
- * `header`:
1187
-
1188
- C header files
1189
-
1190
- **Default**: .h
1191
-
1192
- * `source`:
1193
-
1194
- C code files (whether source or test files)
1195
-
1196
- **Default**: .c
1197
-
1198
- * `assembly`:
1199
-
1200
- Assembly files (contents wholly assembly instructions)
1201
-
1202
- **Default**: .s
1203
-
1204
- * `object`:
1205
-
1206
- Resulting binary output of C code compiler (and assembler)
1207
-
1208
- **Default**: .o
1209
-
1210
- * `executable`:
1211
-
1212
- Binary executable to be loaded and executed upon target hardware
1213
-
1214
- **Default**: .exe or .out (Win or *nix)
1215
-
1216
- * `testpass`:
1217
-
1218
- Test results file (not likely to ever need a new value)
1219
-
1220
- **Default**: .pass
1221
-
1222
- * `testfail`:
1223
-
1224
- Test results file (not likely to ever need a new value)
1225
-
1226
- **Default**: .fail
1227
-
1228
- * `dependencies`:
1229
-
1230
- File containing make-style dependency rules created by gcc preprocessor
1231
-
1232
- **Default**: .d
1233
-
1234
-
1235
- Example [:extension] YAML blurb
1236
-
1237
- :extension:
1238
- :source: .cc
1239
- :executable: .bin
1240
-
1241
- **defines**: command line defines used in test and release compilation by configured tools
1242
-
1243
- * `test`:
1244
-
1245
- Defines needed for testing. Useful for:
1246
-
1247
- 1. test files containing conditional compilation statements (i.e.
1248
- tests active in only certain contexts)
1249
-
1250
- 2. testing legacy source wherein the isolation of source under test
1251
- afforded by Ceedling and its complementary tools leaves certain
1252
- symbols unset when source files are compiled in isolation
1253
-
1254
- **Default**: [] (empty)
1255
-
1256
- * `test_preprocess`:
1257
-
1258
- If [:project][:use_test_preprocessor] or
1259
- [:project][:use_deep_dependencies] is set and code is structured in a
1260
- certain way, the gcc preprocessor may need symbol definitions to
1261
- properly preprocess files to extract function signatures for mocking
1262
- and extract deep dependencies for incremental builds.
1263
-
1264
- **Default**: [] (empty)
1265
-
1266
- * `release`:
1267
-
1268
- Defines needed for the release build binary artifact.
1269
-
1270
- **Default**: [] (empty)
1271
-
1272
- * `release_preprocess`:
1273
-
1274
- If [:project][:use_deep_dependencies] is set and code is structured in
1275
- a certain way, the gcc preprocessor may need symbol definitions to
1276
- properly preprocess files for incremental release builds due to deep
1277
- dependencies.
1278
-
1279
- **Default**: [] (empty)
1280
-
1281
-
1282
- Example [:defines] YAML blurb
1283
-
1284
- ```yaml
1285
- :defines:
1286
- :test:
1287
- - UNIT_TESTING #for select cases in source to allow testing with a changed behavior or interface
1288
- - OFF=0
1289
- - ON=1
1290
- - FEATURE_X=ON
1291
- :source:
1292
- - FEATURE_X=ON
1293
- ```
1294
-
1295
-
1296
- **libraries**: command line defines used in test and release compilation by configured tools
1297
-
1298
- Ceedling allows you to pull in specific libraries for the purpose of release and test builds.
1299
- It has a few levels of support for this. Start by adding a :libraries main section in your
1300
- configuration. In this section, you can optionally have the following subsections:
1301
-
1302
- * `test`:
1303
-
1304
- Library files that should be injected into your tests when linking occurs.
1305
- These can be specified as either relative or absolute paths. These files MUST
1306
- exist when the test attempts to build.
1307
-
1308
- * `source`:
1309
-
1310
- Library files that should be injected into your release when linking occurs. These
1311
- can be specified as either relative or absolute paths. These files MUST exist when
1312
- the release attempts to build UNLESS you are using the subprojects plugin. In that
1313
- case, it will attempt to build that library for you as a dynamic dependency.
1314
-
1315
- * `system`:
1316
-
1317
- These libraries are assumed to be in the tool path somewhere and shouldn't need to be
1318
- specified. The libraries added here will be injected into releases and tests.
1319
-
1320
- * `flag`:
1321
-
1322
- This is the method of adding an argument for each library. For example, gcc really likes
1323
- it when you specify “-l${1}”
1324
-
1325
- Notes:
1326
-
1327
- * If you've specified your own link step, you are going to want to add ${4} to your argument
1328
- list in the place where library files should be added to the command call. For gcc, this is
1329
- often the very end. Other tools may vary.
1330
-
1331
-
1332
- **flags**: configure per-file compilation and linking flags
1333
-
1334
- Ceedling tools (see later [:tools] section) are used to configure
1335
- compilation and linking of test and source files. These tool
1336
- configurations are a one-size-fits-all approach. Should individual files
1337
- require special compilation or linking flags, the settings in the
1338
- [:flags] section work in conjunction with tool definitions by way of
1339
- argument substitution to achieve this.
1340
-
1341
- * `release`:
1342
-
1343
- [:compile] or [:link] flags for release build
1344
-
1345
- * `test`:
1346
-
1347
- [:compile] or [:link] flags for test build
1348
-
1349
- Notes:
1350
-
1351
- * Ceedling works with the [:release] and [:test] build contexts
1352
- as-is; plugins can add additional contexts
1353
-
1354
- * Only [:compile] and [:link] are recognized operations beneath
1355
- a context
1356
-
1357
- * File specifiers do not include a path or file extension
1358
-
1359
- * File specifiers are case sensitive (must match original file
1360
- name)
1361
-
1362
- * File specifiers do support regular expressions if encased in quotes
1363
-
1364
- * '*' is a special (optional) file specifier to provide flags
1365
- to all files not otherwise specified
1366
-
1367
-
1368
- Example [:flags] YAML blurb
1369
-
1370
- ```yaml
1371
- :flags:
1372
- :release:
1373
- :compile:
1374
- :main: # add '-Wall' to compilation of main.c
1375
- - -Wall
1376
- :fan: # add '--O2' to compilation of fan.c
1377
- - --O2
1378
- :'test_.+': # add '-pedantic' to all test-files
1379
- - -pedantic
1380
- :*: # add '-foo' to compilation of all files not main.c or fan.c
1381
- - -foo
1382
- :test:
1383
- :compile:
1384
- :main: # add '--O1' to compilation of main.c as part of test builds including main.c
1385
- - --O1
1386
- :link:
1387
- :test_main: # add '--bar --baz' to linking of test_main.exe
1388
- - --bar
1389
- - --baz
1390
- ```
1391
-
1392
- Ceedling sets values for a subset of CMock settings. All CMock
1393
- options are available to be set, but only those options set by
1394
- Ceedling in an automated fashion are documented below. See CMock
1395
- documentation.
1396
-
1397
- **cmock**: configure CMock's code generation options and set symbols used to modify CMock's compiled features
1398
- Ceedling sets values for a subset of CMock settings. All CMock options are available to be set, but only those options set by Ceedling in an automated fashion are documented below. See CMock documentation.
1399
-
1400
- * `enforce_strict_ordering`:
1401
-
1402
- Tests fail if expected call order is not same as source order
1403
-
1404
- **Default**: TRUE
1405
-
1406
- * `mock_path`:
1407
-
1408
- Path for generated mocks
1409
-
1410
- **Default**: <build path>/tests/mocks
1411
-
1412
- * `defines`:
1413
-
1414
- List of conditional compilation symbols used to configure CMock's
1415
- compiled features. See CMock documentation to understand available
1416
- options. No symbols must be set unless defaults are inappropriate for
1417
- your specific environment. All symbols are used only by Ceedling to
1418
- compile CMock C code; contents of [:defines] are ignored by CMock's
1419
- Ruby code when instantiated.
1420
-
1421
- **Default**: [] (empty)
1422
-
1423
- * `verbosity`:
1424
-
1425
- If not set, defaults to Ceedling's verbosity level
1426
-
1427
- * `plugins`:
1428
-
1429
- If [:project][:use_exceptions] is enabled, the internal plugins list is pre-populated with 'cexception'.
1430
-
1431
- Whether or not you have included [:cmock][:plugins] in your
1432
- configuration file, Ceedling automatically adds 'cexception' to the
1433
- plugin list if exceptions are enabled. To add to the list Ceedling
1434
- provides CMock, simply add [:cmock][:plugins] to your configuration
1435
- and specify your desired additional plugins.
1436
-
1437
- * `includes`:
1438
-
1439
- If [:cmock][:unity_helper] set, pre-populated with unity_helper file
1440
- name (no path).
1441
-
1442
- The [:cmock][:includes] list works identically to the plugins list
1443
- above with regard to adding additional files to be inserted within
1444
- mocks as #include statements.
1445
-
1446
-
1447
- The last four settings above are directly tied to other Ceedling
1448
- settings; hence, why they are listed and explained here. The
1449
- first setting above, [:enforce_strict_ordering], defaults
1450
- to FALSE within CMock. It is set to TRUE by default in Ceedling
1451
- as our way of encouraging you to use strict ordering. It's a teeny
1452
- bit more expensive in terms of code generated, test execution
1453
- time, and complication in deciphering test failures. However,
1454
- it's good practice. And, of course, you can always disable it
1455
- by overriding the value in the Ceedling YAML configuration file.
1456
-
1457
-
1458
- **cexception**: configure symbols used to modify CException's compiled features
1459
-
1460
- * `defines`:
1461
-
1462
- List of conditional compilation symbols used to configure CException's
1463
- features in its source and header files. See CException documentation
1464
- to understand available options. No symbols must be set unless the
1465
- defaults are inappropriate for your specific environment.
1466
-
1467
- **Default**: [] (empty)
1468
-
1469
-
1470
- **unity**: configure symbols used to modify Unity's compiled features
1471
-
1472
- * `defines`:
1473
-
1474
- List of conditional compilation symbols used to configure Unity's
1475
- features in its source and header files. See Unity documentation to
1476
- understand available options. No symbols must be set unless the
1477
- defaults are inappropriate for your specific environment. Most Unity
1478
- defines can be easily configured through the YAML file.
1479
-
1480
- **Default**: [] (empty)
1481
-
1482
- Example [:unity] YAML blurbs
1483
- ```yaml
1484
- :unity: #itty bitty processor & toolchain with limited test execution options
1485
- :defines:
1486
- - UNITY_INT_WIDTH=16 #16 bit processor without support for 32 bit instructions
1487
- - UNITY_EXCLUDE_FLOAT #no floating point unit
1488
-
1489
- :unity: #great big gorilla processor that grunts and scratches
1490
- :defines:
1491
- - UNITY_SUPPORT_64 #big memory, big counters, big registers
1492
- - UNITY_LINE_TYPE=\"unsigned int\" #apparently we're using really long test files,
1493
- - UNITY_COUNTER_TYPE=\"unsigned int\" #and we've got a ton of test cases in those test files
1494
- - UNITY_FLOAT_TYPE=\"double\" #you betcha
1495
- ```
1496
-
1497
-
1498
- Notes on Unity configuration:
1499
-
1500
- * **Verification** - Ceedling does no verification of your configuration
1501
- values. In a properly configured setup, your Unity configuration
1502
- values are processed, collected together with any test define symbols
1503
- you specify elsewhere, and then passed to your toolchain during test
1504
- compilation. Unity's conditional compilation statements, your
1505
- toolchain's preprocessor, and/or your toolchain's compiler will
1506
- complain appropriately if your specified configuration values are
1507
- incorrect, incomplete, or incompatible.
1508
-
1509
- * **Routing $stdout** - Unity defaults to using `putchar()` in C's
1510
- standard library to display test results. For more exotic environments
1511
- than a desktop with a terminal (e.g. running tests directly on a
1512
- non-PC target), you have options. For example, you could create a
1513
- routine that transmits a character via RS232 or USB. Once you have
1514
- that routine, you can replace `putchar()` calls in Unity by overriding
1515
- the function-like macro `UNITY_OUTPUT_CHAR`. Consult your toolchain
1516
- and shell documentation. Eventhough this can also be defined in the YAML file
1517
- most shell environments do not handle parentheses as command line arguments
1518
- very well. To still be able to add this functionality all necessary
1519
- options can be defined in the `unity_config.h`. Unity needs to be told to look for
1520
- the `unity_config.h` in the YAML file, though.
1521
-
1522
- Example [:unity] YAML blurbs
1523
- ```yaml
1524
- :unity:
1525
- :defines:
1526
- - UNITY_INCLUDE_CONFIG_H
1527
- ```
1528
-
1529
- Example unity_config.h
1530
- ```
1531
- #ifndef UNITY_CONFIG_H
1532
- #define UNITY_CONFIG_H
1533
-
1534
- #include "uart_output.h" //Helper library for your custom environment
1535
-
1536
- #define UNITY_INT_WIDTH 16
1537
- #define UNITY_OUTPUT_START() uart_init(F_CPU, BAUD) //Helperfunction to init UART
1538
- #define UNITY_OUTPUT_CHAR(a) uart_putchar(a) //Helperfunction to forward char via UART
1539
- #define UNITY_OUTPUT_COMPLETE() uart_complete() //Helperfunction to inform that test has ended
1540
-
1541
- #endif
1542
- ```
1543
-
1544
-
1545
- **tools**: a means for representing command line tools for use under
1546
- Ceedling's automation framework
1547
-
1548
- Ceedling requires a variety of tools to work its magic. By default,
1549
- the GNU toolchain (gcc, cpp, as) are configured and ready for
1550
- use with no additions to the project configuration YAML file.
1551
- However, as most work will require a project-specific toolchain,
1552
- Ceedling provides a generic means for specifying / overriding
1553
- tools.
1554
-
1555
- * `test_compiler`:
1556
-
1557
- Compiler for test & source-under-test code
1558
- ${1}: input source ${2}: output object ${3}: optional output list ${4}: optional output dependencies file
1559
-
1560
- **Default**: gcc
1561
-
1562
- * `test_linker`:
1563
-
1564
- Linker to generate test fixture executables
1565
- ${1}: input objects ${2}: output binary ${3}: optional output map ${4}: optional library list
1566
-
1567
- **Default**: gcc
1568
-
1569
- * `test_fixture`:
1570
-
1571
- Executable test fixture
1572
- ${1}: simulator as executable with ${1} as input binary file argument or native test executable
1573
-
1574
- **Default**: ${1}
1575
-
1576
- * `test_includes_preprocessor`:
1577
-
1578
- Extractor of #include statements
1579
- ${1}: input source file
1580
-
1581
- **Default**: cpp
1582
-
1583
- * `test_file_preprocessor`:
1584
-
1585
- Preprocessor of test files (macros, conditional compilation statements)
1586
- ${1}: input source file ${2}: preprocessed output source file
1587
-
1588
- **Default**: gcc
1589
-
1590
- * `test_dependencies_generator`:
1591
-
1592
- Discovers deep dependencies of source & test (for incremental builds)
1593
- ${1}: input source file ${2}: compiled object filepath ${3}: output dependencies file
1594
-
1595
- **Default**: gcc
1596
-
1597
- * `release_compiler`:
1598
-
1599
- Compiler for release source code
1600
- ${1}: input source ${2}: output object ${3}: optional output list ${4}: optional output dependencies file
1601
-
1602
- **Default**: gcc
1603
-
1604
- * `release_assembler`:
1605
-
1606
- Assembler for release assembly code
1607
- ${1}: input assembly source file ${2}: output object file
1608
-
1609
- **Default**: as
1610
-
1611
- * `release_linker`:
1612
-
1613
- Linker for release source code
1614
- ${1}: input objects ${2}: output binary ${3}: optional output map ${4}: optional library list
1615
-
1616
- **Default**: gcc
1617
-
1618
- * `release_dependencies_generator`:
1619
-
1620
- Discovers deep dependencies of source files (for incremental builds)
1621
- ${1}: input source file ${2}: compiled object filepath ${3}: output dependencies file
1622
-
1623
- **Default**: gcc
1624
-
1625
-
1626
- A Ceedling tool has a handful of configurable elements:
1627
-
1628
- 1. [:executable] (required) - Command line executable having
1629
- the form of:
1630
-
1631
- 2. [:arguments] (required) - List of command line arguments
1632
- and substitutions
1633
-
1634
- 3. [:name] - Simple name (e.g. "nickname") of tool beyond its
1635
- executable name (if not explicitly set then Ceedling will
1636
- form a name from the tool's YAML entry name)
1637
-
1638
- 4. [:stderr_redirect] - Control of capturing $stderr messages
1639
- {:none, :auto, :win, :unix, :tcsh}.
1640
- Defaults to :none if unspecified; create a custom entry by
1641
- specifying a simple string instead of any of the available
1642
- symbols.
1643
-
1644
- 5. [:background_exec] - Control execution as background process
1645
- {:none, :auto, :win, :unix}.
1646
- Defaults to :none if unspecified.
1647
-
1648
-
1649
- Tool Element Runtime Substitution
1650
- ---------------------------------
1651
-
1652
- To accomplish useful work on multiple files, a configured tool will most
1653
- often require that some number of its arguments or even the executable
1654
- itself change for each run. Consequently, every tool's argument list and
1655
- executable field possess two means for substitution at runtime. Ceedling
1656
- provides two kinds of inline Ruby execution and a notation for
1657
- populating elements with dynamically gathered values within the build
1658
- environment.
1659
-
1660
- Tool Element Runtime Substitution: Inline Ruby Execution
1661
- --------------------------------------------------------
1662
-
1663
- In-line Ruby execution works similarly to that demonstrated for the
1664
- [:environment] section except that substitution occurs as the tool is
1665
- executed and not at the time the configuration file is first scanned.
1666
-
1667
- * `#{...}`:
1668
-
1669
- Ruby string substitution pattern wherein the containing string is
1670
- expanded to include the string generated by Ruby code between the
1671
- braces. Multiple instances of this expansion can occur within a single
1672
- tool element entry string. Note that if this string substitution
1673
- pattern occurs at the very beginning of a string in the YAML
1674
- configuration the entire string should be enclosed in quotes (see the
1675
- [:environment] section for further explanation on this point).
1676
-
1677
- * `{...} `:
1678
-
1679
- If an entire tool element string is enclosed with braces, it signifies
1680
- that Ceedling should execute the Ruby code contained within those
1681
- braces. Say you have a collection of paths on disk and some of those
1682
- paths include spaces. Further suppose that a single tool that must use
1683
- those paths requires those spaces to be escaped, but all other uses of
1684
- those paths requires the paths to remain unchanged. You could use this
1685
- Ceedling feature to insert Ruby code that iterates those paths and
1686
- escapes those spaces in the array as used by the tool of this example.
1687
-
1688
- Tool Element Runtime Substitution: Notational Substitution
1689
- ----------------------------------------------------------
1690
-
1691
- A Ceedling tool's other form of dynamic substitution relies on a '$'
1692
- notation. These '$' operators can exist anywhere in a string and can be
1693
- decorated in any way needed. To use a literal '$', escape it as '\\$'.
1694
-
1695
- * `$`:
1696
-
1697
- Simple substitution for value(s) globally available within the runtime
1698
- (most often a string or an array).
1699
-
1700
- * `${#}`:
1701
-
1702
- When a Ceedling tool's command line is expanded from its configured
1703
- representation and used within Ceedling Ruby code, certain calls to
1704
- that tool will be made with a parameter list of substitution values.
1705
- Each numbered substitution corresponds to a position in a parameter
1706
- list. Ceedling Ruby code expects that configured compiler and linker
1707
- tools will contain ${1} and ${2} replacement arguments. In the case of
1708
- a compiler ${1} will be a C code file path, and ${2} will be the file
1709
- path of the resulting object file. For a linker ${1} will be an array
1710
- of object files to link, and ${2} will be the resulting binary
1711
- executable. For an executable test fixture ${1} is either the binary
1712
- executable itself (when using a local toolchain such as gcc) or a
1713
- binary input file given to a simulator in its arguments.
1714
-
1715
-
1716
- Example [:tools] YAML blurbs
1717
-
1718
- ```yaml
1719
- :tools:
1720
- :test_compiler:
1721
- :executable: compiler #exists in system search path
1722
- :name: 'acme test compiler'
1723
- :arguments:
1724
- - -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE #expands to -I search paths
1725
- - -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR #expands to -I search paths
1726
- - -D$: COLLECTION_DEFINES_TEST_AND_VENDOR #expands to all -D defined symbols
1727
- - --network-license #simple command line argument
1728
- - -optimize-level 4 #simple command line argument
1729
- - "#{`args.exe -m acme.prj`}" #in-line ruby sub to shell out & build string of arguments
1730
- - -c ${1} #source code input file (Ruby method call param list sub)
1731
- - -o ${2} #object file output (Ruby method call param list sub)
1732
- :test_linker:
1733
- :executable: /programs/acme/bin/linker.exe #absolute file path
1734
- :name: 'acme test linker'
1735
- :arguments:
1736
- - ${1} #list of object files to link (Ruby method call param list sub)
1737
- - -l$-lib: #inline yaml array substitution to link in foo-lib and bar-lib
1738
- - foo
1739
- - bar
1740
- - -o ${2} #executable file output (Ruby method call param list sub)
1741
- :test_fixture:
1742
- :executable: tools/bin/acme_simulator.exe #relative file path to command line simulator
1743
- :name: 'acme test fixture'
1744
- :stderr_redirect: :win #inform Ceedling what model of $stderr capture to use
1745
- :arguments:
1746
- - -mem large #simple command line argument
1747
- - -f "${1}" #binary executable input file to simulator (Ruby method call param list sub)
1748
- ```
1749
-
1750
- Resulting command line constructions from preceding example [:tools] YAML blurbs
1751
-
1752
- > compiler -I"/usr/include” -I”project/tests”
1753
- -I"project/tests/support” -I”project/source” -I”project/include”
1754
- -DTEST -DLONG_NAMES -network-license -optimize-level 4 arg-foo
1755
- arg-bar arg-baz -c project/source/source.c -o
1756
- build/tests/out/source.o
1757
-
1758
- [notes: (1.) "arg-foo arg-bar arg-baz" is a fabricated example
1759
- string collected from $stdout as a result of shell execution
1760
- of args.exe
1761
- (2.) the -c and -o arguments are
1762
- fabricated examples simulating a single compilation step for
1763
- a test; ${1} & ${2} are single files]
1764
-
1765
- > \programs\acme\bin\linker.exe thing.o unity.o
1766
- test_thing_runner.o test_thing.o mock_foo.o mock_bar.o -lfoo-lib
1767
- -lbar-lib -o build\tests\out\test_thing.exe
1768
-
1769
- [note: in this scenario ${1} is an array of all the object files
1770
- needed to link a test fixture executable]
1771
-
1772
- > tools\bin\acme_simulator.exe -mem large -f "build\tests\out\test_thing.bin 2>&1”
1773
-
1774
- [note: (1.) :executable could have simply been ${1} - if we were compiling
1775
- and running native executables instead of cross compiling (2.) we're using
1776
- $stderr redirection to allow us to capture simulator error messages to
1777
- $stdout for display at the run's conclusion]
1778
-
1779
-
1780
- Notes:
1781
-
1782
- * The upper case names are Ruby global constants that Ceedling
1783
- builds
1784
-
1785
- * "COLLECTION_" indicates that Ceedling did some work to assemble
1786
- the list. For instance, expanding path globs, combining multiple
1787
- path globs into a convenient summation, etc.
1788
-
1789
- * At present, $stderr redirection is primarily used to capture
1790
- errors from test fixtures so that they can be displayed at the
1791
- conclusion of a test run. For instance, if a simulator detects
1792
- a memory access violation or a divide by zero error, this notice
1793
- might go unseen in all the output scrolling past in a terminal.
1794
-
1795
- * The preprocessing tools can each be overridden with non-gcc
1796
- equivalents. However, this is an advanced feature not yet
1797
- documented and requires that the replacement toolchain conform
1798
- to the same conventions used by gcc.
1799
-
1800
- **Ceedling Collection Used in Compilation**:
1801
-
1802
- * `COLLECTION_PATHS_TEST`:
1803
-
1804
- All test paths
1805
-
1806
- * `COLLECTION_PATHS_SOURCE`:
1807
-
1808
- All source paths
1809
-
1810
- * `COLLECTION_PATHS_INCLUDE`:
1811
-
1812
- All include paths
1813
-
1814
- * `COLLECTION_PATHS_SUPPORT`:
1815
-
1816
- All test support paths
1817
-
1818
- * `COLLECTION_PATHS_SOURCE_AND_INCLUDE`:
1819
-
1820
- All source and include paths
1821
-
1822
- * `COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR`:
1823
-
1824
- All source and include paths + applicable vendor paths (e.g.
1825
- CException's source path if exceptions enabled)
1826
-
1827
- * `COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE`:
1828
-
1829
- All test toolchain include paths
1830
-
1831
- * `COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE`:
1832
-
1833
- All test, source, and include paths
1834
-
1835
- * `COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR`:
1836
-
1837
- All test, source, include, and applicable vendor paths (e.g. Unity's
1838
- source path plus CMock and CException's source paths if mocks and
1839
- exceptions are enabled)
1840
-
1841
- * `COLLECTION_PATHS_RELEASE_TOOLCHAIN_INCLUDE`:
1842
-
1843
- All release toolchain include paths
1844
-
1845
- * `COLLECTION_DEFINES_TEST_AND_VENDOR`:
1846
-
1847
- All symbols specified in [:defines][:test] + symbols defined for
1848
- enabled vendor tools - e.g. [:unity][:defines], [:cmock][:defines],
1849
- and [:cexception][:defines]
1850
-
1851
- * `COLLECTION_DEFINES_RELEASE_AND_VENDOR`:
1852
-
1853
- All symbols specified in [:defines][:release] plus symbols defined by
1854
- [:cexception][:defines] if exceptions are ena bled
1855
-
1856
-
1857
- Notes:
1858
-
1859
- * Other collections exist within Ceedling. However, they are
1860
- only useful for advanced features not yet documented.
1861
-
1862
- * Wherever multiple path lists are combined for use Ceedling prioritizes
1863
- path groups as follows: test paths, support paths, source paths, include
1864
- paths.
1865
- This can be useful, for instance, in certain testing scenarios
1866
- where we desire Ceedling or the compiler to find a stand-in header file
1867
- before the actual source header file of the same name.
1868
-
1869
-
1870
- **plugins**: Ceedling extensions
1871
-
1872
- * `load_paths`:
1873
-
1874
- Base paths to search for plugin subdirectories or extra ruby functionalit
1875
-
1876
- **Default**: [] (empty)
1877
-
1878
- * `enabled`:
1879
-
1880
- List of plugins to be used - a plugin's name is identical to the
1881
- subdirectory that contains it (and the name of certain files within
1882
- that subdirectory)
1883
-
1884
- **Default**: [] (empty)
1885
-
1886
-
1887
- Plugins can provide a variety of added functionality to Ceedling. In
1888
- general use, it's assumed that at least one reporting plugin will be
1889
- used to format test results. However, if no reporting plugins are
1890
- specified, Ceedling will print to `$stdout` the (quite readable) raw
1891
- test results from all test fixtures executed.
1892
-
1893
- Example [:plugins] YAML blurb
1894
-
1895
- ```yaml
1896
- :plugins:
1897
- :load_paths:
1898
- - project/tools/ceedling/plugins #home to your collection of plugin directories
1899
- - project/support #maybe home to some ruby code your custom plugins share
1900
- :enabled:
1901
- - stdout_pretty_tests_report #nice test results at your command line
1902
- - our_custom_code_metrics_report #maybe you needed line count and complexity metrics, so you
1903
- #created a plugin to scan all your code and collect that info
1904
- ```
1905
-
1906
- * `stdout_pretty_tests_report`:
1907
-
1908
- Prints to $stdout a well-formatted list of ignored and failed tests,
1909
- final test counts, and any extraneous output (e.g. printf statements
1910
- or simulator memory errors) collected from executing the test
1911
- fixtures. Meant to be used with runs at the command line.
1912
-
1913
- * `stdout_ide_tests_report`:
1914
-
1915
- Prints to $stdout simple test results formatted such that an IDE
1916
- executing test-related Rake tasks can recognize file paths and line
1917
- numbers in test failures, etc. Thus, you can click a test result in
1918
- your IDE's execution window and jump to the failure (or ignored test)
1919
- in your test file (obviously meant to be used with an [IDE like
1920
- Eclipse][ide], etc).
1921
-
1922
- [ide]: http://throwtheswitch.org/white-papers/using-with-ides.html
1923
-
1924
- * `xml_tests_report`:
1925
-
1926
- Creates an XML file of test results in the xUnit format (handy for
1927
- Continuous Integration build servers or as input to other reporting
1928
- tools). Produces a file report.xml in <build root>/artifacts/tests.
1929
-
1930
- * `bullseye`:
1931
-
1932
- Adds additional Rake tasks to execute tests with the commercial code
1933
- coverage tool provided by [Bullseye][]. See readme.txt inside the bullseye
1934
- plugin directory for configuration and use instructions. Note:
1935
- Bullseye only works with certain compilers and linkers (healthy list
1936
- of supported toolchains though).
1937
-
1938
- [bullseye]: http://www.bullseye.com
1939
-
1940
- * `gcov`:
1941
-
1942
- Adds additional Rake tasks to execute tests with the GNU code coverage
1943
- tool [gcov][]. See readme.txt inside the gcov directory for configuration
1944
- and use instructions. Only works with GNU compiler and linker.
1945
-
1946
- [gcov]: http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
1947
-
1948
- * `warnings_report`:
1949
-
1950
- Scans compiler and linker `$stdout / $stderr` output for the word
1951
- 'warning' (case insensitive). All code warnings (or tool warnings) are
1952
- logged to a file warnings.log in the appropriate `<build
1953
- root>/artifacts` directory (e.g. test/ for test tasks, `release/` for a
1954
- release build, or even `bullseye/` for bullseye runs).
1955
-
1956
- Module Generator
1957
- ========================
1958
- Ceedling includes a plugin called module_generator that will create a source, header and test file for you.
1959
- There are several possibilities to configure this plugin through your project.yml to suit your project's needs.
1960
-
1961
- Directory Structure
1962
- -------------------------------------------
1963
-
1964
- The default configuration for directory/project structure is:
1965
- ```yaml
1966
- :module_generator:
1967
- :project_root: ./
1968
- :source_root: src/
1969
- :test_root: test/
1970
- ```
1971
- You can change these variables in your project.yml file to comply with your project's directory structure.
1972
-
1973
- If you call `ceedling module:create`, it will create three files:
1974
- 1. A source file in the source_root
1975
- 2. A header file in the source_root
1976
- 3. A test file in the test_root
1977
-
1978
- If you want your header file to be in another location,
1979
- you can specify the ':inc_root:" in your project.yml file:
1980
- ```yaml
1981
- :module_generator:
1982
- :inc_root: inc/
1983
- ```
1984
- The module_generator will then create the header file in your defined ':inc_root:'.
1985
- By default, ':inc_root:' is not defined so the module_generator will use the source_root.
1986
-
1987
- Sometimes, your project can't be divided into a single src, inc, and test folder. You have several directories
1988
- with sources/..., something like this for example:
1989
- <project_root>
1990
- - myDriver
1991
- - src
1992
- - inc
1993
- - test
1994
- - myOtherDriver
1995
- - src
1996
- - inc
1997
- - test
1998
- - ...
1999
-
2000
- Don't worry, you don't have to manually create the source/header/test files.
2001
- The module_generator can accept a path to create a source_root/inc_root/test_root folder with your files:
2002
- `ceedling module:create[<module_root_path>:<module_name>]`
2003
-
2004
- F.e., applied to the above project structure:
2005
- `ceedling module:create[myOtherDriver:driver]`
2006
- This will make the module_generator run in the subdirectory 'myOtherDriver' and generate the module files
2007
- for you in that directory. So, this command will generate the following files:
2008
- 1. A source file 'driver.c' in <project_root>/myOtherDriver/<source_root>
2009
- 2. A header file 'driver.h' in <project_root>/myOtherDriver/<source_root> (or <inc_root> if specified)
2010
- 3. A test file 'test_driver.c' in <project_root>/myOtherDriver/<test_root>
2011
-
2012
- Naming
2013
- -------------------------------------------
2014
- By default, the module_generator will generate your files in lowercase.
2015
- `ceedling module:create[mydriver]` and `ceedling module:create[myDriver]`(note the uppercase) will generate the same files:
2016
- 1. mydriver.c
2017
- 2. mydriver.h
2018
- 3. test_mydriver.c
2019
-
2020
- You can configure the module_generator to use a differect naming mechanism through the project.yml:
2021
- ```yaml
2022
- :module_generator:
2023
- :naming: "camel"
2024
- ```
2025
- There are other possibilities as well (bumpy, camel, snake, caps).
2026
- Refer to the unity module generator for more info (the unity module generator is used under the hood by module_generator).
2027
-
2028
- Advanced Topics (Coming)
2029
- ========================
2030
-
2031
- Modifying Your Configuration without Modifying Your Project File: Option Files & User Files
2032
- -------------------------------------------------------------------------------------------
2033
-
2034
- Modifying your project file without modifying your project file
2035
-
2036
- Debugging and/or printf()
2037
- -------------------------
2038
-
2039
- When you gotta get your hands dirty...
2040
-
2041
- Ceedling Plays Nice with Others - Using Ceedling for Tests Alongside Another Release Build Setup
2042
- ------------------------------------------------------------------------------------------------
2043
-
2044
- You've got options.
2045
-
2046
- Adding Handy Rake Tasks for Your Project (without Fancy Pants Custom Plugins)
2047
- -----------------------------------------------------------------------------
2048
-
2049
- Simple as snot.
2050
-
2051
- Working with Non-Desktop Testing Environments
2052
- ---------------------------------------------
2053
-
2054
- For those crazy platforms lacking command line simulators and for which
2055
- cross-compiling on the desktop just ain't gonna get it done.
2056
-
2057
- Creating Custom Plugins
2058
- -----------------------
2059
-
2060
- Oh boy. This is going to take some explaining.
1
+ [All code is copyright © 2010-2012 Ceedling Project
2
+ by Mike Karlesky, Mark VanderVoord, and Greg Williams.
3
+
4
+ This Documentation Is Released Under a
5
+ Creative Commons 3.0 Attribution Share-Alike License]
6
+
7
+ What the What?
8
+
9
+ Assembling build environments for C projects - especially with
10
+ automated unit tests - is a pain. Whether it's Make or Rake or Premake
11
+ or what-have-you, set up with an all-purpose build environment
12
+ tool is tedious and requires considerable glue code to pull together
13
+ the necessary tools and libraries. Ceedling allows you to generate
14
+ an entire test and build environment for a C project from a single
15
+ YAML configuration file. Ceedling is written in Ruby and works
16
+ with the Rake build tool plus other goodness like Unity and CMock
17
+ the unit testing and mocking frameworks for C. Ceedling and
18
+ its complementary tools can support the tiniest of embedded
19
+ processors, the beefiest 64 bit power houses available, and
20
+ everything in between.
21
+
22
+ For a build project including unit tests and using the default
23
+ toolchain gcc, the configuration file could be as simple as this:
24
+
25
+ ```yaml
26
+ :project:
27
+ :build_root: project/build/
28
+ :release_build: TRUE
29
+
30
+ :paths:
31
+ :test:
32
+ - tests/**
33
+ :source:
34
+ - source/**
35
+ ```
36
+
37
+ From the command line, to build the release version of your project,
38
+ you would simply run `ceedling release`. To run all your unit tests,
39
+ you would run `ceedling test:all`. That's it!
40
+
41
+ Of course, many more advanced options allow you to configure
42
+ your project with a variety of features to meet a variety of needs.
43
+ Ceedling can work with practically any command line toolchain
44
+ and directory structure – all by way of the configuration file.
45
+ Further, because Ceedling piggy backs on Rake, you can add your
46
+ own Rake tasks to accomplish project tasks outside of testing
47
+ and release builds. A facility for plugins also allows you to
48
+ extend Ceedling's capabilities for needs such as custom code
49
+ metrics reporting and coverage testing.
50
+
51
+ What's with this Name?
52
+
53
+ Glad you asked. Ceedling is tailored for unit tested C projects
54
+ and is built upon / around Rake (Rake is a Make replacement implemented
55
+ in the Ruby scripting language). So, we've got C, our Rake, and
56
+ the fertile soil of a build environment in which to grow and tend
57
+ your project and its unit tests. Ta da - _Ceedling_.
58
+
59
+ What Do You Mean "tailored for unit tested C projects"?
60
+
61
+ Well, we like to write unit tests for our C code to make it lean and
62
+ mean (that whole [Test-Driven Development][tdd]
63
+ thing). Along the way, this style of writing C code spawned two
64
+ tools to make the job easier: a unit test framework for C called
65
+ _Unity_ and a mocking library called _CMock_. And, though it's
66
+ not directly related to testing, a C framework for exception
67
+ handling called _CException_ also came along.
68
+
69
+ [tdd]: http://en.wikipedia.org/wiki/Test-driven_development
70
+
71
+ These tools and frameworks are great, but they require quite
72
+ a bit of environment support to pull them all together in a convenient,
73
+ usable fashion. We started off with Rakefiles to assemble everything.
74
+ These ended up being quite complicated and had to be hand-edited
75
+ or created anew for each new project. Ceedling replaces all that
76
+ tedium and rework with a configuration file that ties everything
77
+ together.
78
+
79
+ Though Ceedling is tailored for unit testing, it can also go right ahead
80
+ and build your final binary release artifact for you as well. Or,
81
+ Ceedling and your tests can live alongside your existing release build
82
+ setup. That said, Ceedling is more powerful as a unit test build
83
+ environment than it is a general purpose release build environment;
84
+ complicated projects including separate bootloaders or multiple library
85
+ builds, etc. are not its strong suit.
86
+
87
+ Hold on. Back up. Ruby? Rake? YAML? Unity? CMock? CException?
88
+
89
+ Seem overwhelming? It's not bad at all, and for the benefits tests
90
+ bring us, it's all worth it.
91
+
92
+ [Ruby][] is a handy scripting
93
+ language like Perl or Python. It's a modern, full featured language
94
+ that happens to be quite handy for accomplishing tasks like code
95
+ generation or automating one's workflow while developing in
96
+ a compiled language such as C.
97
+
98
+ [Ruby]: http://www.ruby-lang.org/en/
99
+
100
+ [Rake][] is a utility written in Ruby
101
+ for accomplishing dependency tracking and task automation
102
+ common to building software. It's a modern, more flexible replacement
103
+ for [Make][]).
104
+ Rakefiles are Ruby files, but they contain build targets similar
105
+ in nature to that of Makefiles (but you can also run Ruby code in
106
+ your Rakefile).
107
+
108
+ [Rake]: http://rubyrake.org/
109
+ [Make]: http://en.wikipedia.org/wiki/Make_(software)
110
+
111
+ [YAML][] is a "human friendly data serialization standard for all
112
+ programming languages." It's kinda like a markup language, but don't
113
+ call it that. With a YAML library, you can [serialize][] data structures
114
+ to and from the file system in a textual, human readable form. Ceedling
115
+ uses a serialized data structure as its configuration input.
116
+
117
+ [YAML]: http://en.wikipedia.org/wiki/Yaml
118
+ [serialize]: http://en.wikipedia.org/wiki/Serialization
119
+
120
+ [Unity] is a [unit test framework][test] for C. It provides facilities
121
+ for test assertions, executing tests, and collecting / reporting test
122
+ results. Unity derives its name from its implementation in a single C
123
+ source file (plus two C header files) and from the nature of its
124
+ implementation - Unity will build in any C toolchain and is configurable
125
+ for even the very minimalist of processors.
126
+
127
+ [Unity]: http://github.com/ThrowTheSwitch/Unity
128
+ [test]: http://en.wikipedia.org/wiki/Unit_testing
129
+
130
+ [CMock] is a tool written in Ruby able to generate entire
131
+ [mock functions][mock] in C code from a given C header file. Mock
132
+ functions are invaluable in [interaction-based unit testing][ut].
133
+ CMock's generated C code uses Unity.
134
+
135
+ [CMock]: http://github.com/ThrowTheSwitch/CMock
136
+ [mock]: http://en.wikipedia.org/wiki/Mock_object
137
+ [ut]: http://martinfowler.com/articles/mocksArentStubs.html
138
+
139
+ [CException] is a C source and header file that provide a simple
140
+ [exception mechanism][exn] for C by way of wrapping up the
141
+ [setjmp / longjmp][setjmp] standard library calls. Exceptions are a much
142
+ cleaner and preferable alternative to managing and passing error codes
143
+ up your return call trace.
144
+
145
+ [CException]: http://github.com/ThrowTheSwitch/CException
146
+ [exn]: http://en.wikipedia.org/wiki/Exception_handling
147
+ [setjmp]: http://en.wikipedia.org/wiki/Setjmp.h
148
+
149
+ Notes
150
+ -----
151
+
152
+ * YAML support is included with Ruby - requires no special installation
153
+ or configuration.
154
+
155
+ * Unity, CMock, and CException are bundled with Ceedling, and
156
+ Ceedling is designed to glue them all together for your project
157
+ as seamlessly as possible.
158
+
159
+
160
+ Installation & Setup: What Exactly Do I Need to Get Started?
161
+ ------------------------------------------------------------
162
+
163
+ As a [Ruby gem](http://docs.rubygems.org/read/chapter/1):
164
+
165
+ 1. [Download and install Ruby](http://www.ruby-lang.org/en/downloads/)
166
+
167
+ 2. Use Ruby's command line gem package manager to install Ceedling:
168
+ `gem install ceedling`
169
+ (Unity, CMock, and CException come along with Ceedling for free)
170
+
171
+ 3. Execute Ceedling at command line to create example project
172
+ or an empty Ceedling project in your filesystem (executing
173
+ `ceedling help` first is, well, helpful).
174
+
175
+ Gem install notes:
176
+
177
+ 1. Steps 1-2 are a one time affair for your local environment.
178
+ When steps 1-2 are completed once, only step 3 is needed for
179
+ each new project.
180
+
181
+ Getting Started after Ceedling is installed:
182
+
183
+ 1. Once Ceedling is installed, you'll want to start to integrate it with new
184
+ and old projects alike. If you wanted to start to work on a new project
185
+ named `foo`, Ceedling can create the skeleton of the project using `ceedling
186
+ new foo`. Likewise if you already have a project named `bar` and you want to
187
+ integrate Ceedling into it, you would run `ceedling new bar` and Ceedling
188
+ will create any files and directories it needs to run.
189
+
190
+ 2. Now that you have Ceedling integrated with a project, you can start using it.
191
+ A good starting point to get use to Ceedling either in a new project or an
192
+ existing project is creating a new module to get use to Ceedling by issuing
193
+ the command `ceedling module:create[unicorn]`.
194
+
195
+ General notes:
196
+
197
+ 1. Certain advanced features of Ceedling rely on gcc and cpp
198
+ as preprocessing tools. In most *nix systems, these tools
199
+ are already available. For Windows environments, we recommend
200
+ the [mingw project](http://www.mingw.org/) (Minimalist
201
+ GNU for Windows). This represents an optional, additional
202
+ setup / installation step to complement the list above. Upon
203
+ installing mingw ensure your system path is updated or set
204
+ [:environment][:path] in your `project.yml` file (see
205
+ environment section later in this document).
206
+
207
+ 2. To use a project file name other than the default `project.yml`
208
+ or place the project file in a directory other than the one
209
+ in which you'll run Rake, create an environment variable
210
+ `CEEDLING_MAIN_PROJECT_FILE` with your desired project
211
+ file path.
212
+
213
+ 3. To better understand Rake conventions, Rake execution,
214
+ and Rakefiles, consult the [Rake tutorial, examples, and
215
+ user guide](http://rubyrake.org/).
216
+
217
+ 4. When using Ceedling in Windows environments, a test file name may
218
+ not include the sequences “patch” or “setup”. The Windows Installer
219
+ Detection Technology (part of UAC), requires administrator
220
+ privileges to execute file names with these strings.
221
+
222
+ Now What? How Do I Make It GO?
223
+ ------------------------------
224
+
225
+ We're getting a little ahead of ourselves here, but it's good
226
+ context on how to drive this bus. Everything is done via the command
227
+ line. We'll cover conventions and how to actually configure
228
+ your project in later sections.
229
+
230
+ To run tests, build your release artifact, etc., you will be interacting
231
+ with Rake on the command line. Ceedling works with Rake to present
232
+ you with named tasks that coordinate the file generation and
233
+ build steps needed to accomplish something useful. You can also
234
+ add your own independent Rake tasks or create plugins to extend
235
+ Ceedling (more on this later).
236
+
237
+ * `ceedling [no arguments]`:
238
+
239
+ Run the default Rake task (conveniently recognized by the name default
240
+ by Rake). Neither Rake nor Ceedling provide a default task. Rake will
241
+ abort if run without arguments when no default task is defined. You can
242
+ conveniently define a default task in the Rakefile discussed in the
243
+ preceding setup & installation section of this document.
244
+
245
+ * `ceedling -T`:
246
+
247
+ List all available Rake tasks with descriptions (Rake tasks without
248
+ descriptions are not listed). -T is a command line switch for Rake and
249
+ not the same as tasks that follow.
250
+
251
+ * `ceedling <tasks...> --trace`:
252
+
253
+ For advanced users troubleshooting a confusing build error, debug
254
+ Ceedling or a plugin, --trace provides a stack trace of dependencies
255
+ walked during task execution and any Ruby failures along the way. Note
256
+ that --trace is a command line switch for Rake and is not the same as
257
+ tasks that follow.
258
+
259
+ * `ceedling environment`:
260
+
261
+ List all configured environment variable names and string values. This
262
+ task is helpful in verifying the evaluatio of any Ruby expressions in
263
+ the [:environment] section of your config file.`: Note: Ceedling may
264
+ set some convenience environment variables by default.
265
+
266
+ * `ceedling paths:*`:
267
+
268
+ List all paths collected from [:paths] entries in your YAML config
269
+ file where * is the name of any section contained in [:paths]. This
270
+ task is helpful in verifying the expansion of path wildcards / globs
271
+ specified in the [:paths] section of your config file.
272
+
273
+ * `ceedling files:assembly`
274
+ * `ceedling files:header`
275
+ * `ceedling files:source`
276
+ * `ceedling files:test`
277
+
278
+ List all files and file counts collected from the relevant search
279
+ paths specified by the [:paths] entries of your YAML config file. The
280
+ files:assembly task will only be available if assembly support is
281
+ enabled in the [:release_build] section of your configuration file.
282
+
283
+ * `ceedling options:*`:
284
+
285
+ Load and merge configuration settings into the main project
286
+ configuration. Each task is named after a *.yml file found in the
287
+ configured options directory. See documentation for the configuration
288
+ setting [:project][:options_paths] and for options files in advanced
289
+ topics.
290
+
291
+ * `ceedling test:all`:
292
+
293
+ Run all unit tests (rebuilding anything that's changed along the way).
294
+
295
+ * `ceedling test:build_only`:
296
+
297
+ Build all unit tests, object files and executable but not run them.
298
+
299
+ * `ceedling test:delta`:
300
+
301
+ Run only those unit tests for which the source or test files have
302
+ changed (i.e. incremental build). Note: with the
303
+ [:project][:use_test_preprocessor] configuration file option set,
304
+ runner files are always regenerated limiting the total efficiency this
305
+ text execution option can afford.
306
+
307
+ * `ceedling test:*`:
308
+
309
+ Execute the named test file or the named source file that has an
310
+ accompanying test. No path. Examples: ceedling test:foo.c or ceedling
311
+ test:test_foo.c
312
+
313
+ * `ceedling test:pattern[*]`:
314
+
315
+ Execute any tests whose name and/or path match the regular expression
316
+ pattern (case sensitive). Example: ceedling "test:pattern[(I|i)nit]" will
317
+ execute all tests named for initialization testing. Note: quotes may
318
+ be necessary around the ceedling parameter to distinguish regex characters
319
+ from command line operators.
320
+
321
+ * `ceedling test:path[*]`:
322
+
323
+ Execute any tests whose path contains the given string (case
324
+ sensitive). Example: ceedling test:path[foo/bar] will execute all tests
325
+ whose path contains foo/bar. Note: both directory separator characters
326
+ / and \ are valid.
327
+
328
+ * `ceedling release`:
329
+
330
+ Build all source into a release artifact (if the release build option
331
+ is configured).
332
+
333
+ * `ceedling release:compile:*`:
334
+
335
+ Sometimes you just need to compile a single file dagnabit. Example:
336
+ ceedling release:compile:foo.c
337
+
338
+ * `ceedling release:assemble:*`:
339
+
340
+ Sometimes you just need to assemble a single file doggonit. Example:
341
+ ceedling release:assemble:foo.s
342
+
343
+ * `ceedling module:create[Filename]`:
344
+ * `ceedling module:create[<Path:>Filename]`:
345
+
346
+ It's often helpful to create a file automatically. What's better than
347
+ that? Creating a source file, a header file, and a corresponding test
348
+ file all in one step!
349
+
350
+ There are also patterns which can be specified to automatically generate
351
+ a bunch of files. Try `ceedling module:create[Poodles,mch]` for example!
352
+
353
+ The module generator has several options you can configure.
354
+ F.e. Generating the source/header/test file in a subdirectory (by adding <Path> when calling module:create).
355
+ For more info, refer to the [Module Generator](https://github.com/ThrowTheSwitch/Ceedling/blob/master/docs/CeedlingPacket.md#module-generator) section.
356
+
357
+ * `ceedling logging <tasks...>`:
358
+
359
+ Enable logging to <build path>/logs. Must come before test and release
360
+ tasks to log their steps and output. Log names are a concatenation of
361
+ project, user, and option files loaded. User and option files are
362
+ documented in the advanced topics section of this document.
363
+
364
+ * `ceedling verbosity[x] <tasks...>`:
365
+
366
+ Change the default verbosity level. [x] ranges from 0 (quiet) to 4
367
+ (obnoxious). Level [3] is the default. The verbosity task must precede
368
+ all tasks in the command line list for which output is desired to be
369
+ seen. Verbosity settings are generally most meaningful in conjunction
370
+ with test and release tasks.
371
+
372
+ * `ceedling summary`:
373
+
374
+ If plugins are enabled, this task will execute the summary method of
375
+ any plugins supporting it. This task is intended to provide a quick
376
+ roundup of build artifact metrics without re-running any part of the
377
+ build.
378
+
379
+ * `ceedling clean`:
380
+
381
+ Deletes all toolchain binary artifacts (object files, executables),
382
+ test results, and any temporary files. Clean produces no output at the
383
+ command line unless verbosity has been set to an appreciable level.
384
+
385
+ * `ceedling clobber`:
386
+
387
+ Extends clean task's behavior to also remove generated files: test
388
+ runners, mocks, preprocessor output. Clobber produces no output at the
389
+ command line unless verbosity has been set to an appreciable level.
390
+
391
+ To better understand Rake conventions, Rake execution, and
392
+ Rakefiles, consult the [Rake tutorial, examples, and user guide][guide].
393
+
394
+ [guide]: http://rubyrake.org/
395
+
396
+ At present, none of Ceedling's commands provide persistence.
397
+ That is, they must each be specified at the command line each time
398
+ they are needed. For instance, Ceedling's verbosity command
399
+ only affects output at the time it's run.
400
+
401
+ Individual test and release file tasks
402
+ are not listed in `-T` output. Because so many files may be present
403
+ it's unwieldy to list them all.
404
+
405
+ Multiple rake tasks can be executed at the command line (order
406
+ is executed as provided). For example, `ceed
407
+ clobber test:all release` will removed all generated files;
408
+ build and run all tests; and then build all source - in that order.
409
+ If any Rake task fails along the way, execution halts before the
410
+ next task.
411
+
412
+ The `clobber` task removes certain build directories in the
413
+ course of deleting generated files. In general, it's best not
414
+ to add to source control any Ceedling generated directories
415
+ below the root of your top-level build directory. That is, leave
416
+ anything Ceedling & its accompanying tools generate out of source
417
+ control (but go ahead and add the top-level build directory that
418
+ holds all that stuff). Also, since Ceedling is pretty smart about
419
+ what it rebuilds and regenerates, you needn't clobber often.
420
+
421
+ Important Conventions
422
+ =====================
423
+
424
+ Directory Structure, Filenames & Extensions
425
+ -------------------------------------------
426
+
427
+ Much of Ceedling's functionality is driven by collecting files
428
+ matching certain patterns inside the paths it's configured
429
+ to search. See the documentation for the [:extensions] section
430
+ of your configuration file (found later in this document) to
431
+ configure the file extensions Ceedling uses to match and collect
432
+ files. Test file naming is covered later in this section.
433
+
434
+ Test files and source files must be segregated by directories.
435
+ Any directory structure will do. Tests can be held in subdirectories
436
+ within source directories, or tests and source directories
437
+ can be wholly separated at the top of your project's directory
438
+ tree.
439
+
440
+ Search Path Order
441
+ -----------------
442
+
443
+ When Ceedling searches for files (e.g. looking for header files
444
+ to mock) or when it provides search paths to any of the default
445
+ gcc toolchain executables, it organizes / prioritizes its search
446
+ paths. The order is always: test paths, support paths, source
447
+ paths, and then include paths. This can be useful, for instance,
448
+ in certain testing scenarios where we desire Ceedling or a compiler
449
+ to find a stand-in header file in our support directory before
450
+ the actual source header file of the same name.
451
+
452
+ This convention only holds when Ceedling is using its default
453
+ tool configurations and / or when tests are involved. If you define
454
+ your own tools in the configuration file (see the [:tools] section
455
+ documented later in this here document), you have complete control
456
+ over what directories are searched and in what order. Further,
457
+ test and support directories are only searched when appropriate.
458
+ That is, when running a release build, test and support directories
459
+ are not used at all.
460
+
461
+ Source Files & Binary Release Artifacts
462
+ ---------------------------------------
463
+
464
+ Your binary release artifact results from the compilation and
465
+ linking of all source files Ceedling finds in the specified source
466
+ directories. At present only source files with a single (configurable)
467
+ extension are recognized. That is, *.c and *.cc files will not
468
+ both be recognized - only one or the other. See the configuration
469
+ options and defaults in the documentation for the [:extensions]
470
+ sections of your configuration file (found later in this document).
471
+
472
+ Test Files & Executable Test Fixtures
473
+ -------------------------------------
474
+
475
+ Ceedling builds each individual test file with its accompanying
476
+ source file(s) into a single, monolithic test fixture executable.
477
+ Test files are recognized by a naming convention: a (configurable)
478
+ prefix such as "`test_`" in the file name with the same file extension
479
+ as used by your C source files. See the configuration options
480
+ and defaults in the documentation for the [:project] and [:extensions]
481
+ sections of your configuration file (found later in this document).
482
+ Depending on your configuration options, Ceedling can recognize
483
+ a variety of test file naming patterns in your test search paths.
484
+ For example: `test_some_super_functionality.c`, `TestYourSourceFile.cc`,
485
+ or `testing_MyAwesomeCode.C` could each be valid test file
486
+ names. Note, however, that Ceedling can recognize only one test
487
+ file naming convention per project.
488
+
489
+ Ceedling knows what files to compile and link into each individual
490
+ test executable by way of the #include list contained in each
491
+ test file. Any C source files in the configured search directories
492
+ that correspond to the header files included in a test file will
493
+ be compiled and linked into the resulting test fixture executable.
494
+ From this same #include list, Ceedling knows which files to mock
495
+ and compile and link into the test executable (if you use mocks
496
+ in your tests). That was a lot of clauses and information in a very
497
+ few sentences; the example that follows in a bit will make it clearer.
498
+
499
+ By naming your test functions according to convention, Ceedling
500
+ will extract and collect into a runner C file calls to all your
501
+ test case functions. This runner file handles all the execution
502
+ minutiae so that your test file can be quite simple and so that
503
+ you never forget to wire up a test function to be executed. In this
504
+ generated runner lives the `main()` entry point for the resulting
505
+ test executable. There are no configuration options for the
506
+ naming convention of your test case functions. A test case function
507
+ signature must have these three elements: void return, void
508
+ parameter list, and the function name prepended with lowercase
509
+ "`test`". In other words, a test function signature should look
510
+ like this: `void test``[any name you like]``(void)`.
511
+
512
+ A commented sample test file follows on the next page. Also, see
513
+ the sample project contained in the Ceedling documentation
514
+ bundle.
515
+
516
+ ```c
517
+ // test_foo.c -----------------------------------------------
518
+ #include "unity.h" // compile/link in Unity test framework
519
+ #include "types.h" // header file with no *.c file -- no compilation/linking
520
+ #include "foo.h" // source file foo.c under test
521
+ #include "mock_bar.h" // bar.h will be found and mocked as mock_bar.c + compiled/linked in;
522
+ // foo.c includes bar.h and uses functions declared in it
523
+ #include "mock_baz.h" // baz.h will be found and mocked as mock_baz.c + compiled/linked in
524
+ // foo.c includes baz.h and uses functions declared in it
525
+
526
+
527
+ void setUp(void) {} // every test file requires this function;
528
+ // setUp() is called by the generated runner before each test case function
529
+
530
+ void tearDown(void) {} // every test file requires this function;
531
+ // tearDown() is called by the generated runner after each test case function
532
+
533
+ // a test case function
534
+ void test_Foo_Function1_should_Call_Bar_AndGrill(void)
535
+ {
536
+ Bar_AndGrill_Expect(); // setup function from mock_bar.c that instructs our
537
+ // framework to expect Bar_AndGrill() to be called once
538
+ TEST_ASSERT_EQUAL(0xFF, Foo_Function1()); // assertion provided by Unity
539
+ // Foo_Function1() calls Bar_AndGrill() & returns a byte
540
+ }
541
+
542
+ // another test case function
543
+ void test_Foo_Function2_should_Call_Baz_Tec(void)
544
+ {
545
+ Baz_Tec_ExpectAnd_Return(1); // setup function provided by mock_baz.c that instructs our
546
+ // framework to expect Baz_Tec() to be called once and return 1
547
+ TEST_ASSERT_TRUE(Foo_Function2()); // assertion provided by Unity
548
+ }
549
+
550
+ // end of test_foo.c ----------------------------------------
551
+ ```
552
+
553
+ From the test file specified above Ceedling will generate `test_foo_runner.c`;
554
+ this runner file will contain `main()` and call both of the example
555
+ test case functions.
556
+
557
+ The final test executable will be `test_foo.exe` (for Windows
558
+ machines or `test_foo.out` for *nix systems - depending on default
559
+ or configured file extensions). Based on the #include list above,
560
+ the test executable will be the output of the linker having processed
561
+ `unity.o`, `foo.o`, `mock_bar.o`, `mock_baz.o`, `test_foo.o`,
562
+ and `test_foo_runner.o`. Ceedling finds the files, generates
563
+ mocks, generates a runner, compiles all the files, and links
564
+ everything into the test executable. Ceedling will then run
565
+ the test executable and collect test results from it to be reported
566
+ to the developer at the command line.
567
+
568
+ For more on the assertions and mocks shown, consult the documentation
569
+ for Unity and CMock.
570
+
571
+ The Magic of Dependency Tracking
572
+ --------------------------------
573
+
574
+ Ceedling is pretty smart in using Rake to build up your project's
575
+ dependencies. This means that Ceedling automagically rebuilds
576
+ all the appropriate files in your project when necessary: when
577
+ your configuration changes, Ceedling or any of the other tools
578
+ are updated, or your source or test files change. For instance,
579
+ if you modify a header file that is mocked, Ceedling will ensure
580
+ that the mock is regenerated and all tests that use that mock are
581
+ rebuilt and re-run when you initiate a relevant testing task.
582
+ When you see things rebuilding, it's for a good reason. Ceedling
583
+ attempts to regenerate and rebuild only what's needed for a given
584
+ execution of a task. In the case of large projects, assembling
585
+ dependencies and acting upon them can cause some delay in executing
586
+ tasks.
587
+
588
+ With one exception, the trigger to rebuild or regenerate a file
589
+ is always a disparity in timestamps between a target file and
590
+ its source - if an input file is newer than its target dependency,
591
+ the target is rebuilt or regenerated. For example, if the C source
592
+ file from which an object file is compiled is newer than that object
593
+ file on disk, recompilation will occur (of course, if no object
594
+ file exists on disk, compilation will always occur). The one
595
+ exception to this dependency behavior is specific to your input
596
+ configuration. Only if your logical configuration changes
597
+ will a system-wide rebuild occur. Reorganizing your input configuration
598
+ or otherwise updating its file timestamp without modifying
599
+ the values within the file will not trigger a rebuild. This behavior
600
+ handles the various ways in which your input configuration can
601
+ change (discussed later in this document) without having changed
602
+ your actual project YAML file.
603
+
604
+ Ceedling needs a bit of help to accomplish its magic with deep
605
+ dependencies. Shallow dependencies are straightforward:
606
+ a mock is dependent on the header file from which it's generated,
607
+ a test file is dependent upon the source files it includes (see
608
+ the preceding conventions section), etc. Ceedling handles
609
+ these "out of the box." Deep dependencies are specifically a
610
+ C-related phenomenon and occur as a consequence of include statements
611
+ within C source files. Say a source file includes a header file
612
+ and that header file in turn includes another header file which
613
+ includes still another header file. A change to the deepest header
614
+ file should trigger a recompilation of the source file, a relinking
615
+ of all the object files comprising a test fixture, and a new execution
616
+ of that test fixture.
617
+
618
+ Ceedling can handle deep dependencies but only with the help
619
+ of a C preprocessor. Ceedling is quite capable, but a full C preprocessor
620
+ it ain't. Your project can be configured to use a C preprocessor
621
+ or not. Simple projects or large projects constructed so as to
622
+ be quite flat in their include structure generally don't need
623
+ deep dependency preprocessing - and can enjoy the benefits of
624
+ faster execution. Legacy code, on the other hand, will almost
625
+ always want to be tested with deep preprocessing enabled. Set
626
+ up of the C preprocessor is covered in the documentation for the
627
+ [:project] and [:tools] section of the configuration file (later
628
+ in this document). Ceedling contains all the configuration
629
+ necessary to use the gcc preprocessor by default. That is, as
630
+ long as gcc is in your system search path, deep preprocessing
631
+ of deep dependencies is available to you by simply enabling it
632
+ in your project configuration file.
633
+
634
+ Ceedling's Build Output
635
+ -----------------------
636
+
637
+ Ceedling requires a top-level build directory for all the stuff
638
+ that it, the accompanying test tools, and your toolchain generate.
639
+ That build directory's location is configured in the [:project]
640
+ section of your configuration file (discussed later). There
641
+ can be a ton of generated files. By and large, you can live a full
642
+ and meaningful life knowing absolutely nothing at all about
643
+ the files and directories generated below the root build directory.
644
+
645
+ As noted already, it's good practice to add your top-level build
646
+ directory to source control but nothing generated beneath it.
647
+ You'll spare yourself headache if you let Ceedling delete and
648
+ regenerate files and directories in a non-versioned corner
649
+ of your project's filesystem beneath the top-level build directory.
650
+
651
+ The `artifacts` directory is the one and only directory you may
652
+ want to know about beneath the top-level build directory. The
653
+ subdirectories beneath `artifacts` will hold your binary release
654
+ target output (if your project is configured for release builds)
655
+ and will serve as the conventional location for plugin output.
656
+ This directory structure was chosen specifically because it
657
+ tends to work nicely with Continuous Integration setups that
658
+ recognize and list build artifacts for retrieval / download.
659
+
660
+ The Almighty Project Configuration File (in Glorious YAML)
661
+ ----------------------------------------------------------
662
+
663
+ Please consult YAML documentation for the finer points of format
664
+ and to understand details of our YAML-based configuration file.
665
+ We recommend [Wikipedia's entry on YAML](http://en.wikipedia.org/wiki/Yaml)
666
+ for this. A few highlights from that reference page:
667
+
668
+ * YAML streams are encoded using the set of printable Unicode
669
+ characters, either in UTF-8 or UTF-16
670
+
671
+ * Whitespace indentation is used to denote structure; however
672
+ tab characters are never allowed as indentation
673
+
674
+ * Comments begin with the number sign ( # ), can start anywhere
675
+ on a line, and continue until the end of the line unless enclosed
676
+ by quotes
677
+
678
+ * List members are denoted by a leading hyphen ( - ) with one member
679
+ per line, or enclosed in square brackets ( [ ] ) and separated
680
+ by comma space ( , )
681
+
682
+ * Hashes are represented using the colon space ( : ) in the form
683
+ key: value, either one per line or enclosed in curly braces
684
+ ( { } ) and separated by comma space ( , )
685
+
686
+ * Strings (scalars) are ordinarily unquoted, but may be enclosed
687
+ in double-quotes ( " ), or single-quotes ( ' )
688
+
689
+ * YAML requires that colons and commas used as list separators
690
+ be followed by a space so that scalar values containing embedded
691
+ punctuation can generally be represented without needing
692
+ to be enclosed in quotes
693
+
694
+ * Repeated nodes are initially denoted by an ampersand ( & ) and
695
+ thereafter referenced with an asterisk ( * )
696
+
697
+ Notes on what follows:
698
+
699
+ * Each of the following sections represent top-level entries
700
+ in the YAML configuration file.
701
+
702
+ * Unless explicitly specified in the configuration file, default
703
+ values are used by Ceedling.
704
+
705
+ * These three settings, at minimum, must be specified:
706
+ * [:project][:build_root]
707
+ * [:paths][:source]
708
+ * [:paths][:test]
709
+
710
+ * As much as is possible, Ceedling validates your settings in
711
+ properly formed YAML.
712
+
713
+ * Improperly formed YAML will cause a Ruby error when the YAML
714
+ is parsed. This is usually accompanied by a complaint with
715
+ line and column number pointing into the project file.
716
+
717
+ * Certain advanced features rely on gcc and cpp as preprocessing
718
+ tools. In most *nix systems, these tools are already available.
719
+ For Windows environments, we recommend the [mingw project](http://www.mingw.org/)
720
+ (Minimalist GNU for Windows).
721
+
722
+ * Ceedling is primarily meant as a build tool to support automated
723
+ unit testing. All the heavy lifting is involved there. Creating
724
+ a simple binary release build artifact is quite trivial in
725
+ comparison. Consequently, most default options and the construction
726
+ of Ceedling itself is skewed towards supporting testing though
727
+ Ceedling can, of course, build your binary release artifact
728
+ as well. Note that complex binary release artifacts (e.g.
729
+ application + bootloader or multiple libraries) are beyond
730
+ Ceedling's release build ability.
731
+
732
+ Conventions / features of Ceedling-specific YAML:
733
+
734
+ * Any second tier setting keys anywhere in YAML whose names end
735
+ in `_path` or `_paths` are automagically processed like all
736
+ Ceedling-specific paths in the YAML to have consistent directory
737
+ separators (i.e. "/") and to take advantage of inline Ruby
738
+ string expansion (see [:environment] setting below for further
739
+ explanation of string expansion).
740
+
741
+ **Let's Be Careful Out There:** Ceedling performs validation
742
+ on the values you set in your configuration file (this assumes
743
+ your YAML is correct and will not fail format parsing, of course).
744
+ That said, validation is limited to only those settings Ceedling
745
+ uses and those that can be reasonably validated. Ceedling does
746
+ not limit what can exist within your configuration file. In this
747
+ way, you can take full advantage of YAML as well as add sections
748
+ and values for use in your own custom plugins (documented later).
749
+ The consequence of this is simple but important. A misspelled
750
+ configuration section name or value name is unlikely to cause
751
+ Ceedling any trouble. Ceedling will happily process that section
752
+ or value and simply use the properly spelled default maintained
753
+ internally - thus leading to unexpected behavior without warning.
754
+
755
+ project: global project settings
756
+
757
+ * `build_root`:
758
+
759
+ Top level directory into which generated path structure and files are
760
+ placed. Note: this is one of the handful of configuration values that
761
+ must be set. The specified path can be absolute or relative to your
762
+ working directory.
763
+
764
+ **Default**: (none)
765
+
766
+ * `use_exceptions`:
767
+
768
+ Configures the build environment to make use of CException. Note that
769
+ if you do not use exceptions, there's no harm in leaving this as its
770
+ default value.
771
+
772
+ **Default**: TRUE
773
+
774
+ * `use_mocks`:
775
+
776
+ Configures the build environment to make use of CMock. Note that if
777
+ you do not use mocks, there's no harm in leaving this setting as its
778
+ default value.
779
+
780
+ **Default**: TRUE
781
+
782
+ * `use_test_preprocessor`:
783
+
784
+ This option allows Ceedling to work with test files that contain
785
+ conditional compilation statements (e.g. #ifdef) and header files you
786
+ wish to mock that contain conditional preprocessor statements and/or
787
+ macros.
788
+
789
+ Ceedling and CMock are advanced tools with sophisticated parsers.
790
+ However, they do not include entire C language preprocessors.
791
+ Consequently, with this option enabled, Ceedling will use gcc's
792
+ preprocessing mode and the cpp preprocessor tool to strip down /
793
+ expand test files and headers to their applicable content which can
794
+ then be processed by Ceedling and CMock.
795
+
796
+ With this option enabled, the gcc & cpp tools must exist in an
797
+ accessible system search path and test runner files are always
798
+ regenerated.
799
+
800
+ **Default**: FALSE
801
+
802
+ * `use_deep_dependencies`:
803
+
804
+ The base rules and tasks that Ceedling creates using Rake capture most
805
+ of the dependencies within a standard project (e.g. when the source
806
+ file accompanying a test file changes, the corresponding test fixture
807
+ executable will be rebuilt when tests are re-run). However, deep
808
+ dependencies cannot be captured this way. If a typedef or macro
809
+ changes in a header file three levels of #include statements deep,
810
+ this option allows the appropriate incremental build actions to occur
811
+ for both test execution and release builds.
812
+
813
+ This is accomplished by using the dependencies discovery mode of gcc.
814
+ With this option enabled, gcc must exist in an accessible system
815
+ search path.
816
+
817
+ **Default**: FALSE
818
+
819
+ * `generate_deep_dependencies`:
820
+
821
+ When `use_deep_dependencies` is set to TRUE, Ceedling will run a separate
822
+ build step to generate the deep dependencies. If you are using gcc as your
823
+ primary compiler, or another compiler that can generate makefile rules as
824
+ a side effect of compilation, then you can set this to FALSE to avoid the
825
+ extra build step but still use the deep dependencies data when deciding
826
+ which source files to rebuild.
827
+
828
+ **Default**: TRUE
829
+
830
+ * `test_file_prefix`:
831
+
832
+ Ceedling collects test files by convention from within the test file
833
+ search paths. The convention includes a unique name prefix and a file
834
+ extension matching that of source files.
835
+
836
+ Why not simply recognize all files in test directories as test files?
837
+ By using the given convention, we have greater flexibility in what we
838
+ do with C files in the test directories.
839
+
840
+ **Default**: "test_"
841
+
842
+ * `options_paths`:
843
+
844
+ Just as you may have various build configurations for your source
845
+ codebase, you may need variations of your project configuration.
846
+
847
+ By specifying options paths, Ceedling will search for other project
848
+ YAML files, make command line tasks available (ceedling options:variation
849
+ for a variation.yml file), and merge the project configuration of
850
+ these option files in with the main project file at runtime. See
851
+ advanced topics.
852
+
853
+ Note these Rake tasks at the command line - like verbosity or logging
854
+ control - must come before the test or release task they are meant to
855
+ modify.
856
+
857
+ **Default**: [] (empty)
858
+
859
+ * `release_build`:
860
+
861
+ When enabled, a release Rake task is exposed. This configuration
862
+ option requires a corresponding release compiler and linker to be
863
+ defined (gcc is used as the default).
864
+
865
+ More release configuration options are available in the release_build
866
+ section.
867
+
868
+ **Default**: FALSE
869
+
870
+
871
+ Example `[:project]` YAML blurb
872
+
873
+ ```yaml
874
+ :project:
875
+ :build_root: project_awesome/build
876
+ :use_exceptions: FALSE
877
+ :use_test_preprocessor: TRUE
878
+ :use_deep_dependencies: TRUE
879
+ :options_paths:
880
+ - project/options
881
+ - external/shared/options
882
+ :release_build: TRUE
883
+ ```
884
+
885
+ Ceedling is primarily concerned with facilitating the somewhat
886
+ complicated mechanics of automating unit tests. The same mechanisms
887
+ are easily capable of building a final release binary artifact
888
+ (i.e. non test code; the thing that is your final working software
889
+ that you execute on target hardware).
890
+
891
+
892
+ * `output`:
893
+
894
+ The name of your release build binary artifact to be found in <build
895
+ path>/artifacts/release. Ceedling sets the default artifact file
896
+ extension to that as is explicitly specified in the [:extensions]
897
+ section or as is system specific otherwise.
898
+
899
+ **Default**: `project.exe` or `project.out`
900
+
901
+ * `use_assembly`:
902
+
903
+ If assembly code is present in the source tree, this option causes
904
+ Ceedling to create appropriate build directories and use an assembler
905
+ tool (default is the GNU tool as - override available in the [:tools]
906
+ section.
907
+
908
+ **Default**: FALSE
909
+
910
+ * `artifacts`:
911
+
912
+ By default, Ceedling copies to the <build path>/artifacts/release
913
+ directory the output of the release linker and (optionally) a map
914
+ file. Many toolchains produce other important output files as well.
915
+ Adding a file path to this list will cause Ceedling to copy that file
916
+ to the artifacts directory. The artifacts directory is helpful for
917
+ organizing important build output files and provides a central place
918
+ for tools such as Continuous Integration servers to point to build
919
+ output. Selectively copying files prevents incidental build cruft from
920
+ needlessly appearing in the artifacts directory. Note that inline Ruby
921
+ string replacement is available in the artifacts paths (see discussion
922
+ in the [:environment] section).
923
+
924
+ **Default**: [] (empty)
925
+
926
+ Example `[:release_build]` YAML blurb
927
+
928
+ ```yaml
929
+ :release_build:
930
+ :output: top_secret.bin
931
+ :use_assembly: TRUE
932
+ :artifacts:
933
+ - build/release/out/c/top_secret.s19
934
+ ```
935
+
936
+ **paths**: options controlling search paths for source and header
937
+ (and assembly) files
938
+
939
+ * `test`:
940
+
941
+ All C files containing unit test code. Note: this is one of the
942
+ handful of configuration values that must be set.
943
+
944
+ **Default**: [] (empty)
945
+
946
+ * `source`:
947
+
948
+ All C files containing release code (code to be tested). Note: this is
949
+ one of the handful of configuration values that must be set.
950
+
951
+ **Default**: [] (empty)
952
+
953
+ * `support`:
954
+
955
+ Any C files you might need to aid your unit testing. For example, on
956
+ occasion, you may need to create a header file containing a subset of
957
+ function signatures matching those elsewhere in your code (e.g. a
958
+ subset of your OS functions, a portion of a library API, etc.). Why?
959
+ To provide finer grained control over mock function substitution or
960
+ limiting the size of the generated mocks.
961
+
962
+ **Default**: [] (empty)
963
+
964
+ * `include`:
965
+
966
+ Any header files not already in the source search path. Note there's
967
+ no practical distinction between this search path and the source
968
+ search path; it's merely to provide options or to support any
969
+ peculiar source tree organization.
970
+
971
+ **Default**: [] (empty)
972
+
973
+ * `test_toolchain_include`:
974
+
975
+ System header files needed by the test toolchain - should your
976
+ compiler be unable to find them, finds the wrong system include search
977
+ path, or you need a creative solution to a tricky technical problem.
978
+ Note that if you configure your own toolchain in the [:tools] section,
979
+ this search path is largely meaningless to you. However, this is a
980
+ convenient way to control the system include path should you rely on
981
+ the default gcc tools.
982
+
983
+ **Default**: [] (empty)
984
+
985
+ * `release_toolchain_include`:
986
+
987
+ Same as preceding albeit related to the release toolchain.
988
+
989
+ **Default**: [] (empty)
990
+
991
+ * `<custom>`
992
+
993
+ Any paths you specify for custom list. List is available to tool
994
+ configurations and/or plugins. Note a distinction. The preceding names
995
+ are recognized internally to Ceedling and the path lists are used to
996
+ build collections of files contained in those paths. A custom list is
997
+ just that - a custom list of paths.
998
+
999
+ Notes on path grammar within the [:paths] section:
1000
+
1001
+ * Order of search paths listed in [:paths] is preserved when used by an
1002
+ entry in the [:tools] section
1003
+
1004
+ * Wherever multiple path lists are combined for use Ceedling prioritizes
1005
+ path groups as follows:
1006
+ test paths, support paths, source paths, include paths.
1007
+
1008
+ This can be useful, for instance, in certain testing scenarios where
1009
+ we desire Ceedling or the compiler to find a stand-in header file before
1010
+ the actual source header file of the same name.
1011
+
1012
+ * Paths:
1013
+
1014
+ 1. can be absolute or relative
1015
+
1016
+ 2. can be singly explicit - a single fully specified path
1017
+
1018
+ 3. can include a glob operator (more on this below)
1019
+
1020
+ 4. can use inline Ruby string replacement (see [:environment]
1021
+ section for more)
1022
+
1023
+ 5. default as an addition to a specific search list (more on this
1024
+ in the examples)
1025
+
1026
+ 6. can act to subtract from a glob included in the path list (more
1027
+ on this in the examples)
1028
+
1029
+ [Globs](http://ruby.about.com/od/beginningruby/a/dir2.htm)
1030
+ as used by Ceedling are wildcards for specifying directories
1031
+ without the need to list each and every required search path.
1032
+ Ceedling globs operate just as Ruby globs except that they are
1033
+ limited to matching directories and not files. Glob operators
1034
+ include the following * ** ? [-] {,} (note: this list is space separated
1035
+ and not comma separated as commas are used within the bracket
1036
+ operators).
1037
+
1038
+ * `*`:
1039
+
1040
+ All subdirectories of depth 1 below the parent path and including the
1041
+ parent path
1042
+
1043
+ * `**`:
1044
+
1045
+ All subdirectories recursively discovered below the parent path and
1046
+ including the parent path
1047
+
1048
+ * `?`:
1049
+
1050
+ Single alphanumeric character wildcard
1051
+
1052
+ * `[x-y]`:
1053
+
1054
+ Single alphanumeric character as found in the specified range
1055
+
1056
+ * `{x,y}`:
1057
+
1058
+ Single alphanumeric character from the specified list
1059
+
1060
+ Example [:paths] YAML blurbs
1061
+
1062
+ ```yaml
1063
+ :paths:
1064
+ :source: #together the following comprise all source search paths
1065
+ - project/source/* #expansion yields all subdirectories of depth 1 plus parent directory
1066
+ - project/lib #single path
1067
+ :test: #all test search paths
1068
+ - project/**/test? #expansion yields any subdirectory found anywhere in the project that
1069
+ #begins with "test" and contains 5 characters
1070
+
1071
+ :paths:
1072
+ :source: #all source search paths
1073
+ - +:project/source/** #all subdirectories recursively discovered plus parent directory
1074
+ - -:project/source/os/generated #subtract os/generated directory from expansion of above glob
1075
+ #note that '+:' notation is merely aesthetic; default is to add
1076
+
1077
+ :test: #all test search paths
1078
+ - project/test/bootloader #explicit, single search paths (searched in the order specified)
1079
+ - project/test/application
1080
+ - project/test/utilities
1081
+
1082
+ :custom: #custom path list
1083
+ - "#{PROJECT_ROOT}/other" #inline Ruby string expansion
1084
+ ```
1085
+
1086
+ Globs and inline Ruby string expansion can require trial and
1087
+ error to arrive at your intended results. Use the `ceedling paths:*`
1088
+ command line options (documented in preceding section) to verify
1089
+ your settings.
1090
+
1091
+ Ceedling relies on file collections automagically assembled
1092
+ from paths, globs, and file extensions. File collections greatly
1093
+ simplify project set up. However, sometimes you need to remove
1094
+ from or add individual files to those collections.
1095
+
1096
+
1097
+ * `test`:
1098
+
1099
+ Modify the collection of unit test C files.
1100
+
1101
+ **Default**: [] (empty)
1102
+
1103
+ * `source`:
1104
+
1105
+ Modify the collection of all source files used in unit test builds and release builds.
1106
+
1107
+ **Default**: [] (empty)
1108
+
1109
+ * `assembly`:
1110
+
1111
+ Modify the (optional) collection of assembly files used in release builds.
1112
+
1113
+ **Default**: [] (empty)
1114
+
1115
+ * `include`:
1116
+
1117
+ Modify the collection of all source header files used in unit test builds (e.g. for mocking) and release builds.
1118
+
1119
+ **Default**: [] (empty)
1120
+
1121
+ * `support`:
1122
+
1123
+ Modify the collection of supporting C files available to unit tests builds.
1124
+
1125
+ **Default**: [] (empty)
1126
+
1127
+
1128
+ Note: All path grammar documented in [:paths] section applies
1129
+ to [:files] path entries - albeit at the file path level and not
1130
+ the directory level.
1131
+
1132
+ Example [:files] YAML blurb
1133
+
1134
+ ```yaml
1135
+ :files:
1136
+ :source:
1137
+ - callbacks/comm.c # entry defaults to file addition
1138
+ - +:callbacks/comm*.c # add all comm files matching glob pattern
1139
+ - -:source/board/atm134.c # not our board
1140
+ :test:
1141
+ - -:test/io/test_output_manager.c # remove unit tests from test build
1142
+ ```
1143
+
1144
+ **environment:** inserts environment variables into the shell
1145
+ instance executing configured tools
1146
+
1147
+ Ceedling creates environment variables from any key / value
1148
+ pairs in the environment section. Keys become an environment
1149
+ variable name in uppercase. The values are strings assigned
1150
+ to those environment variables. These value strings are either
1151
+ simple string values in YAML or the concatenation of a YAML array.
1152
+
1153
+ Ceedling is able to execute inline Ruby string substitution
1154
+ code to set environment variables. This evaluation occurs when
1155
+ the project file is first processed for any environment pair's
1156
+ value string including the Ruby string substitution pattern
1157
+ `#{…}`. Note that environment value strings that _begin_ with
1158
+ this pattern should always be enclosed in quotes. YAML defaults
1159
+ to processing unquoted text as a string; quoting text is optional.
1160
+ If an environment pair's value string begins with the Ruby string
1161
+ substitution pattern, YAML will interpret the string as a Ruby
1162
+ comment (because of the `#`). Enclosing each environment value
1163
+ string in quotes is a safe practice.
1164
+
1165
+ [:environment] entries are processed in the configured order
1166
+ (later entries can reference earlier entries).
1167
+
1168
+ Special case: PATH handling
1169
+
1170
+ In the specific case of specifying an environment key named _path_,
1171
+ an array of string values will be concatenated with the appropriate
1172
+ platform-specific path separation character (e.g. ':' on *nix,
1173
+ ';' on Windows). All other instances of environment keys assigned
1174
+ YAML arrays use simple concatenation.
1175
+
1176
+ Example [:environment] YAML blurb
1177
+
1178
+ ```yaml
1179
+ :environment:
1180
+ - :license_server: gizmo.intranet #LICENSE_SERVER set with value "gizmo.intranet"
1181
+ - :license: "#{`license.exe`}" #LICENSE set to string generated from shelling out to
1182
+ #execute license.exe; note use of enclosing quotes
1183
+
1184
+ - :path: #concatenated with path separator (see special case above)
1185
+ - Tools/gizmo/bin #prepend existing PATH with gizmo path
1186
+ - "#{ENV['PATH']}" #pattern #{…} triggers ruby evaluation string substitution
1187
+ #note: value string must be quoted because of '#'
1188
+
1189
+ - :logfile: system/logs/thingamabob.log #LOGFILE set with path for a log file
1190
+ ```
1191
+
1192
+ **extension**: configure file name extensions used to collect lists of files searched in [:paths]
1193
+
1194
+ * `header`:
1195
+
1196
+ C header files
1197
+
1198
+ **Default**: .h
1199
+
1200
+ * `source`:
1201
+
1202
+ C code files (whether source or test files)
1203
+
1204
+ **Default**: .c
1205
+
1206
+ * `assembly`:
1207
+
1208
+ Assembly files (contents wholly assembly instructions)
1209
+
1210
+ **Default**: .s
1211
+
1212
+ * `object`:
1213
+
1214
+ Resulting binary output of C code compiler (and assembler)
1215
+
1216
+ **Default**: .o
1217
+
1218
+ * `executable`:
1219
+
1220
+ Binary executable to be loaded and executed upon target hardware
1221
+
1222
+ **Default**: .exe or .out (Win or *nix)
1223
+
1224
+ * `testpass`:
1225
+
1226
+ Test results file (not likely to ever need a new value)
1227
+
1228
+ **Default**: .pass
1229
+
1230
+ * `testfail`:
1231
+
1232
+ Test results file (not likely to ever need a new value)
1233
+
1234
+ **Default**: .fail
1235
+
1236
+ * `dependencies`:
1237
+
1238
+ File containing make-style dependency rules created by gcc preprocessor
1239
+
1240
+ **Default**: .d
1241
+
1242
+
1243
+ Example [:extension] YAML blurb
1244
+
1245
+ :extension:
1246
+ :source: .cc
1247
+ :executable: .bin
1248
+
1249
+ **defines**: command line defines used in test and release compilation by configured tools
1250
+
1251
+ * `test`:
1252
+
1253
+ Defines needed for testing. Useful for:
1254
+
1255
+ 1. test files containing conditional compilation statements (i.e.
1256
+ tests active in only certain contexts)
1257
+
1258
+ 2. testing legacy source wherein the isolation of source under test
1259
+ afforded by Ceedling and its complementary tools leaves certain
1260
+ symbols unset when source files are compiled in isolation
1261
+
1262
+ **Default**: [] (empty)
1263
+
1264
+ * `test_preprocess`:
1265
+
1266
+ If [:project][:use_test_preprocessor] or
1267
+ [:project][:use_deep_dependencies] is set and code is structured in a
1268
+ certain way, the gcc preprocessor may need symbol definitions to
1269
+ properly preprocess files to extract function signatures for mocking
1270
+ and extract deep dependencies for incremental builds.
1271
+
1272
+ **Default**: [] (empty)
1273
+
1274
+ * `<test_name>`:
1275
+
1276
+ Add preprocessor definitions for specified `<test_name>`. For example:
1277
+ ```yaml
1278
+ :defines:
1279
+ :test_foo_config:
1280
+ - FOO_SPECIFIC_FEATURE
1281
+ ```
1282
+ `ceedling test:foo_config` will now have `FOO_SPECIFIC_FEATURE` defined, none of the other tests will.
1283
+
1284
+ **Default**: [] (empty)
1285
+
1286
+ * `release`:
1287
+
1288
+ Defines needed for the release build binary artifact.
1289
+
1290
+ **Default**: [] (empty)
1291
+
1292
+ * `release_preprocess`:
1293
+
1294
+ If [:project][:use_deep_dependencies] is set and code is structured in
1295
+ a certain way, the gcc preprocessor may need symbol definitions to
1296
+ properly preprocess files for incremental release builds due to deep
1297
+ dependencies.
1298
+
1299
+ **Default**: [] (empty)
1300
+
1301
+ * `use_test_definition`:
1302
+
1303
+ When this option is used the `-D<test_name>` flag is added to the build option of your test file.
1304
+
1305
+ **Default**: FALSE
1306
+
1307
+ Example [:defines] YAML blurb
1308
+
1309
+ ```yaml
1310
+ :defines:
1311
+ :test:
1312
+ - UNIT_TESTING #for select cases in source to allow testing with a changed behavior or interface
1313
+ - OFF=0
1314
+ - ON=1
1315
+ - FEATURE_X=ON
1316
+ :source:
1317
+ - FEATURE_X=ON
1318
+ ```
1319
+
1320
+
1321
+ **libraries**: command line defines used in test and release compilation by configured tools
1322
+
1323
+ Ceedling allows you to pull in specific libraries for the purpose of release and test builds.
1324
+ It has a few levels of support for this. Start by adding a :libraries main section in your
1325
+ configuration. In this section, you can optionally have the following subsections:
1326
+
1327
+ * `test`:
1328
+
1329
+ Library files that should be injected into your tests when linking occurs.
1330
+ These can be specified as either relative or absolute paths. These files MUST
1331
+ exist when the test attempts to build.
1332
+
1333
+ * `source`:
1334
+
1335
+ Library files that should be injected into your release when linking occurs. These
1336
+ can be specified as either relative or absolute paths. These files MUST exist when
1337
+ the release attempts to build UNLESS you are using the subprojects plugin. In that
1338
+ case, it will attempt to build that library for you as a dynamic dependency.
1339
+
1340
+ * `system`:
1341
+
1342
+ These libraries are assumed to be in the tool path somewhere and shouldn't need to be
1343
+ specified. The libraries added here will be injected into releases and tests.
1344
+
1345
+ * `flag`:
1346
+
1347
+ This is the method of adding an argument for each library. For example, gcc really likes
1348
+ it when you specify “-l${1}”
1349
+
1350
+ Notes:
1351
+
1352
+ * If you've specified your own link step, you are going to want to add ${4} to your argument
1353
+ list in the place where library files should be added to the command call. For gcc, this is
1354
+ often the very end. Other tools may vary.
1355
+
1356
+
1357
+ **flags**: configure per-file compilation and linking flags
1358
+
1359
+ Ceedling tools (see later [:tools] section) are used to configure
1360
+ compilation and linking of test and source files. These tool
1361
+ configurations are a one-size-fits-all approach. Should individual files
1362
+ require special compilation or linking flags, the settings in the
1363
+ [:flags] section work in conjunction with tool definitions by way of
1364
+ argument substitution to achieve this.
1365
+
1366
+ * `release`:
1367
+
1368
+ [:compile] or [:link] flags for release build
1369
+
1370
+ * `test`:
1371
+
1372
+ [:compile] or [:link] flags for test build
1373
+
1374
+ Notes:
1375
+
1376
+ * Ceedling works with the [:release] and [:test] build contexts
1377
+ as-is; plugins can add additional contexts
1378
+
1379
+ * Only [:compile] and [:link] are recognized operations beneath
1380
+ a context
1381
+
1382
+ * File specifiers do not include a path or file extension
1383
+
1384
+ * File specifiers are case sensitive (must match original file
1385
+ name)
1386
+
1387
+ * File specifiers do support regular expressions if encased in quotes
1388
+
1389
+ * '*' is a special (optional) file specifier to provide flags
1390
+ to all files not otherwise specified
1391
+
1392
+
1393
+ Example [:flags] YAML blurb
1394
+
1395
+ ```yaml
1396
+ :flags:
1397
+ :release:
1398
+ :compile:
1399
+ :main: # add '-Wall' to compilation of main.c
1400
+ - -Wall
1401
+ :fan: # add '--O2' to compilation of fan.c
1402
+ - --O2
1403
+ :'test_.+': # add '-pedantic' to all test-files
1404
+ - -pedantic
1405
+ :*: # add '-foo' to compilation of all files not main.c or fan.c
1406
+ - -foo
1407
+ :test:
1408
+ :compile:
1409
+ :main: # add '--O1' to compilation of main.c as part of test builds including main.c
1410
+ - --O1
1411
+ :link:
1412
+ :test_main: # add '--bar --baz' to linking of test_main.exe
1413
+ - --bar
1414
+ - --baz
1415
+ ```
1416
+
1417
+ Ceedling sets values for a subset of CMock settings. All CMock
1418
+ options are available to be set, but only those options set by
1419
+ Ceedling in an automated fashion are documented below. See CMock
1420
+ documentation.
1421
+
1422
+ **cmock**: configure CMock's code generation options and set symbols used to modify CMock's compiled features
1423
+ Ceedling sets values for a subset of CMock settings. All CMock options are available to be set, but only those options set by Ceedling in an automated fashion are documented below. See CMock documentation.
1424
+
1425
+ * `enforce_strict_ordering`:
1426
+
1427
+ Tests fail if expected call order is not same as source order
1428
+
1429
+ **Default**: TRUE
1430
+
1431
+ * `mock_path`:
1432
+
1433
+ Path for generated mocks
1434
+
1435
+ **Default**: <build path>/tests/mocks
1436
+
1437
+ * `defines`:
1438
+
1439
+ List of conditional compilation symbols used to configure CMock's
1440
+ compiled features. See CMock documentation to understand available
1441
+ options. No symbols must be set unless defaults are inappropriate for
1442
+ your specific environment. All symbols are used only by Ceedling to
1443
+ compile CMock C code; contents of [:defines] are ignored by CMock's
1444
+ Ruby code when instantiated.
1445
+
1446
+ **Default**: [] (empty)
1447
+
1448
+ * `verbosity`:
1449
+
1450
+ If not set, defaults to Ceedling's verbosity level
1451
+
1452
+ * `plugins`:
1453
+
1454
+ If [:project][:use_exceptions] is enabled, the internal plugins list is pre-populated with 'cexception'.
1455
+
1456
+ Whether or not you have included [:cmock][:plugins] in your
1457
+ configuration file, Ceedling automatically adds 'cexception' to the
1458
+ plugin list if exceptions are enabled. To add to the list Ceedling
1459
+ provides CMock, simply add [:cmock][:plugins] to your configuration
1460
+ and specify your desired additional plugins.
1461
+
1462
+ * `includes`:
1463
+
1464
+ If [:cmock][:unity_helper] set, pre-populated with unity_helper file
1465
+ name (no path).
1466
+
1467
+ The [:cmock][:includes] list works identically to the plugins list
1468
+ above with regard to adding additional files to be inserted within
1469
+ mocks as #include statements.
1470
+
1471
+
1472
+ The last four settings above are directly tied to other Ceedling
1473
+ settings; hence, why they are listed and explained here. The
1474
+ first setting above, [:enforce_strict_ordering], defaults
1475
+ to FALSE within CMock. It is set to TRUE by default in Ceedling
1476
+ as our way of encouraging you to use strict ordering. It's a teeny
1477
+ bit more expensive in terms of code generated, test execution
1478
+ time, and complication in deciphering test failures. However,
1479
+ it's good practice. And, of course, you can always disable it
1480
+ by overriding the value in the Ceedling YAML configuration file.
1481
+
1482
+
1483
+ **cexception**: configure symbols used to modify CException's compiled features
1484
+
1485
+ * `defines`:
1486
+
1487
+ List of conditional compilation symbols used to configure CException's
1488
+ features in its source and header files. See CException documentation
1489
+ to understand available options. No symbols must be set unless the
1490
+ defaults are inappropriate for your specific environment.
1491
+
1492
+ **Default**: [] (empty)
1493
+
1494
+
1495
+ **unity**: configure symbols used to modify Unity's compiled features
1496
+
1497
+ * `defines`:
1498
+
1499
+ List of conditional compilation symbols used to configure Unity's
1500
+ features in its source and header files. See Unity documentation to
1501
+ understand available options. No symbols must be set unless the
1502
+ defaults are inappropriate for your specific environment. Most Unity
1503
+ defines can be easily configured through the YAML file.
1504
+
1505
+ **Default**: [] (empty)
1506
+
1507
+ Example [:unity] YAML blurbs
1508
+ ```yaml
1509
+ :unity: #itty bitty processor & toolchain with limited test execution options
1510
+ :defines:
1511
+ - UNITY_INT_WIDTH=16 #16 bit processor without support for 32 bit instructions
1512
+ - UNITY_EXCLUDE_FLOAT #no floating point unit
1513
+
1514
+ :unity: #great big gorilla processor that grunts and scratches
1515
+ :defines:
1516
+ - UNITY_SUPPORT_64 #big memory, big counters, big registers
1517
+ - UNITY_LINE_TYPE=\"unsigned int\" #apparently we're using really long test files,
1518
+ - UNITY_COUNTER_TYPE=\"unsigned int\" #and we've got a ton of test cases in those test files
1519
+ - UNITY_FLOAT_TYPE=\"double\" #you betcha
1520
+ ```
1521
+
1522
+
1523
+ Notes on Unity configuration:
1524
+
1525
+ * **Verification** - Ceedling does no verification of your configuration
1526
+ values. In a properly configured setup, your Unity configuration
1527
+ values are processed, collected together with any test define symbols
1528
+ you specify elsewhere, and then passed to your toolchain during test
1529
+ compilation. Unity's conditional compilation statements, your
1530
+ toolchain's preprocessor, and/or your toolchain's compiler will
1531
+ complain appropriately if your specified configuration values are
1532
+ incorrect, incomplete, or incompatible.
1533
+
1534
+ * **Routing $stdout** - Unity defaults to using `putchar()` in C's
1535
+ standard library to display test results. For more exotic environments
1536
+ than a desktop with a terminal (e.g. running tests directly on a
1537
+ non-PC target), you have options. For example, you could create a
1538
+ routine that transmits a character via RS232 or USB. Once you have
1539
+ that routine, you can replace `putchar()` calls in Unity by overriding
1540
+ the function-like macro `UNITY_OUTPUT_CHAR`. Consult your toolchain
1541
+ and shell documentation. Eventhough this can also be defined in the YAML file
1542
+ most shell environments do not handle parentheses as command line arguments
1543
+ very well. To still be able to add this functionality all necessary
1544
+ options can be defined in the `unity_config.h`. Unity needs to be told to look for
1545
+ the `unity_config.h` in the YAML file, though.
1546
+
1547
+ Example [:unity] YAML blurbs
1548
+ ```yaml
1549
+ :unity:
1550
+ :defines:
1551
+ - UNITY_INCLUDE_CONFIG_H
1552
+ ```
1553
+
1554
+ Example unity_config.h
1555
+ ```
1556
+ #ifndef UNITY_CONFIG_H
1557
+ #define UNITY_CONFIG_H
1558
+
1559
+ #include "uart_output.h" //Helper library for your custom environment
1560
+
1561
+ #define UNITY_INT_WIDTH 16
1562
+ #define UNITY_OUTPUT_START() uart_init(F_CPU, BAUD) //Helperfunction to init UART
1563
+ #define UNITY_OUTPUT_CHAR(a) uart_putchar(a) //Helperfunction to forward char via UART
1564
+ #define UNITY_OUTPUT_COMPLETE() uart_complete() //Helperfunction to inform that test has ended
1565
+
1566
+ #endif
1567
+ ```
1568
+
1569
+
1570
+ **tools**: a means for representing command line tools for use under
1571
+ Ceedling's automation framework
1572
+
1573
+ Ceedling requires a variety of tools to work its magic. By default,
1574
+ the GNU toolchain (gcc, cpp, as) are configured and ready for
1575
+ use with no additions to the project configuration YAML file.
1576
+ However, as most work will require a project-specific toolchain,
1577
+ Ceedling provides a generic means for specifying / overriding
1578
+ tools.
1579
+
1580
+ * `test_compiler`:
1581
+
1582
+ Compiler for test & source-under-test code
1583
+ ${1}: input source ${2}: output object ${3}: optional output list ${4}: optional output dependencies file
1584
+
1585
+ **Default**: gcc
1586
+
1587
+ * `test_linker`:
1588
+
1589
+ Linker to generate test fixture executables
1590
+ ${1}: input objects ${2}: output binary ${3}: optional output map ${4}: optional library list
1591
+
1592
+ **Default**: gcc
1593
+
1594
+ * `test_fixture`:
1595
+
1596
+ Executable test fixture
1597
+ ${1}: simulator as executable with ${1} as input binary file argument or native test executable
1598
+
1599
+ **Default**: ${1}
1600
+
1601
+ * `test_includes_preprocessor`:
1602
+
1603
+ Extractor of #include statements
1604
+ ${1}: input source file
1605
+
1606
+ **Default**: cpp
1607
+
1608
+ * `test_file_preprocessor`:
1609
+
1610
+ Preprocessor of test files (macros, conditional compilation statements)
1611
+ ${1}: input source file ${2}: preprocessed output source file
1612
+
1613
+ **Default**: gcc
1614
+
1615
+ * `test_dependencies_generator`:
1616
+
1617
+ Discovers deep dependencies of source & test (for incremental builds)
1618
+ ${1}: input source file ${2}: compiled object filepath ${3}: output dependencies file
1619
+
1620
+ **Default**: gcc
1621
+
1622
+ * `release_compiler`:
1623
+
1624
+ Compiler for release source code
1625
+ ${1}: input source ${2}: output object ${3}: optional output list ${4}: optional output dependencies file
1626
+
1627
+ **Default**: gcc
1628
+
1629
+ * `release_assembler`:
1630
+
1631
+ Assembler for release assembly code
1632
+ ${1}: input assembly source file ${2}: output object file
1633
+
1634
+ **Default**: as
1635
+
1636
+ * `release_linker`:
1637
+
1638
+ Linker for release source code
1639
+ ${1}: input objects ${2}: output binary ${3}: optional output map ${4}: optional library list
1640
+
1641
+ **Default**: gcc
1642
+
1643
+ * `release_dependencies_generator`:
1644
+
1645
+ Discovers deep dependencies of source files (for incremental builds)
1646
+ ${1}: input source file ${2}: compiled object filepath ${3}: output dependencies file
1647
+
1648
+ **Default**: gcc
1649
+
1650
+
1651
+ A Ceedling tool has a handful of configurable elements:
1652
+
1653
+ 1. [:executable] (required) - Command line executable having
1654
+ the form of:
1655
+
1656
+ 2. [:arguments] (required) - List of command line arguments
1657
+ and substitutions
1658
+
1659
+ 3. [:name] - Simple name (e.g. "nickname") of tool beyond its
1660
+ executable name (if not explicitly set then Ceedling will
1661
+ form a name from the tool's YAML entry name)
1662
+
1663
+ 4. [:stderr_redirect] - Control of capturing $stderr messages
1664
+ {:none, :auto, :win, :unix, :tcsh}.
1665
+ Defaults to :none if unspecified; create a custom entry by
1666
+ specifying a simple string instead of any of the available
1667
+ symbols.
1668
+
1669
+ 5. [:background_exec] - Control execution as background process
1670
+ {:none, :auto, :win, :unix}.
1671
+ Defaults to :none if unspecified.
1672
+
1673
+
1674
+ Tool Element Runtime Substitution
1675
+ ---------------------------------
1676
+
1677
+ To accomplish useful work on multiple files, a configured tool will most
1678
+ often require that some number of its arguments or even the executable
1679
+ itself change for each run. Consequently, every tool's argument list and
1680
+ executable field possess two means for substitution at runtime. Ceedling
1681
+ provides two kinds of inline Ruby execution and a notation for
1682
+ populating elements with dynamically gathered values within the build
1683
+ environment.
1684
+
1685
+ Tool Element Runtime Substitution: Inline Ruby Execution
1686
+ --------------------------------------------------------
1687
+
1688
+ In-line Ruby execution works similarly to that demonstrated for the
1689
+ [:environment] section except that substitution occurs as the tool is
1690
+ executed and not at the time the configuration file is first scanned.
1691
+
1692
+ * `#{...}`:
1693
+
1694
+ Ruby string substitution pattern wherein the containing string is
1695
+ expanded to include the string generated by Ruby code between the
1696
+ braces. Multiple instances of this expansion can occur within a single
1697
+ tool element entry string. Note that if this string substitution
1698
+ pattern occurs at the very beginning of a string in the YAML
1699
+ configuration the entire string should be enclosed in quotes (see the
1700
+ [:environment] section for further explanation on this point).
1701
+
1702
+ * `{...} `:
1703
+
1704
+ If an entire tool element string is enclosed with braces, it signifies
1705
+ that Ceedling should execute the Ruby code contained within those
1706
+ braces. Say you have a collection of paths on disk and some of those
1707
+ paths include spaces. Further suppose that a single tool that must use
1708
+ those paths requires those spaces to be escaped, but all other uses of
1709
+ those paths requires the paths to remain unchanged. You could use this
1710
+ Ceedling feature to insert Ruby code that iterates those paths and
1711
+ escapes those spaces in the array as used by the tool of this example.
1712
+
1713
+ Tool Element Runtime Substitution: Notational Substitution
1714
+ ----------------------------------------------------------
1715
+
1716
+ A Ceedling tool's other form of dynamic substitution relies on a '$'
1717
+ notation. These '$' operators can exist anywhere in a string and can be
1718
+ decorated in any way needed. To use a literal '$', escape it as '\\$'.
1719
+
1720
+ * `$`:
1721
+
1722
+ Simple substitution for value(s) globally available within the runtime
1723
+ (most often a string or an array).
1724
+
1725
+ * `${#}`:
1726
+
1727
+ When a Ceedling tool's command line is expanded from its configured
1728
+ representation and used within Ceedling Ruby code, certain calls to
1729
+ that tool will be made with a parameter list of substitution values.
1730
+ Each numbered substitution corresponds to a position in a parameter
1731
+ list. Ceedling Ruby code expects that configured compiler and linker
1732
+ tools will contain ${1} and ${2} replacement arguments. In the case of
1733
+ a compiler ${1} will be a C code file path, and ${2} will be the file
1734
+ path of the resulting object file. For a linker ${1} will be an array
1735
+ of object files to link, and ${2} will be the resulting binary
1736
+ executable. For an executable test fixture ${1} is either the binary
1737
+ executable itself (when using a local toolchain such as gcc) or a
1738
+ binary input file given to a simulator in its arguments.
1739
+
1740
+
1741
+ Example [:tools] YAML blurbs
1742
+
1743
+ ```yaml
1744
+ :tools:
1745
+ :test_compiler:
1746
+ :executable: compiler #exists in system search path
1747
+ :name: 'acme test compiler'
1748
+ :arguments:
1749
+ - -I"$": COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE #expands to -I search paths
1750
+ - -I"$": COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR #expands to -I search paths
1751
+ - -D$: COLLECTION_DEFINES_TEST_AND_VENDOR #expands to all -D defined symbols
1752
+ - --network-license #simple command line argument
1753
+ - -optimize-level 4 #simple command line argument
1754
+ - "#{`args.exe -m acme.prj`}" #in-line ruby sub to shell out & build string of arguments
1755
+ - -c ${1} #source code input file (Ruby method call param list sub)
1756
+ - -o ${2} #object file output (Ruby method call param list sub)
1757
+ :test_linker:
1758
+ :executable: /programs/acme/bin/linker.exe #absolute file path
1759
+ :name: 'acme test linker'
1760
+ :arguments:
1761
+ - ${1} #list of object files to link (Ruby method call param list sub)
1762
+ - -l$-lib: #inline yaml array substitution to link in foo-lib and bar-lib
1763
+ - foo
1764
+ - bar
1765
+ - -o ${2} #executable file output (Ruby method call param list sub)
1766
+ :test_fixture:
1767
+ :executable: tools/bin/acme_simulator.exe #relative file path to command line simulator
1768
+ :name: 'acme test fixture'
1769
+ :stderr_redirect: :win #inform Ceedling what model of $stderr capture to use
1770
+ :arguments:
1771
+ - -mem large #simple command line argument
1772
+ - -f "${1}" #binary executable input file to simulator (Ruby method call param list sub)
1773
+ ```
1774
+
1775
+ Resulting command line constructions from preceding example [:tools] YAML blurbs
1776
+
1777
+ > compiler -I"/usr/include” -I”project/tests”
1778
+ -I"project/tests/support” -I”project/source” -I”project/include”
1779
+ -DTEST -DLONG_NAMES -network-license -optimize-level 4 arg-foo
1780
+ arg-bar arg-baz -c project/source/source.c -o
1781
+ build/tests/out/source.o
1782
+
1783
+ [notes: (1.) "arg-foo arg-bar arg-baz" is a fabricated example
1784
+ string collected from $stdout as a result of shell execution
1785
+ of args.exe
1786
+ (2.) the -c and -o arguments are
1787
+ fabricated examples simulating a single compilation step for
1788
+ a test; ${1} & ${2} are single files]
1789
+
1790
+ > \programs\acme\bin\linker.exe thing.o unity.o
1791
+ test_thing_runner.o test_thing.o mock_foo.o mock_bar.o -lfoo-lib
1792
+ -lbar-lib -o build\tests\out\test_thing.exe
1793
+
1794
+ [note: in this scenario ${1} is an array of all the object files
1795
+ needed to link a test fixture executable]
1796
+
1797
+ > tools\bin\acme_simulator.exe -mem large -f "build\tests\out\test_thing.bin 2>&1”
1798
+
1799
+ [note: (1.) :executable could have simply been ${1} - if we were compiling
1800
+ and running native executables instead of cross compiling (2.) we're using
1801
+ $stderr redirection to allow us to capture simulator error messages to
1802
+ $stdout for display at the run's conclusion]
1803
+
1804
+
1805
+ Notes:
1806
+
1807
+ * The upper case names are Ruby global constants that Ceedling
1808
+ builds
1809
+
1810
+ * "COLLECTION_" indicates that Ceedling did some work to assemble
1811
+ the list. For instance, expanding path globs, combining multiple
1812
+ path globs into a convenient summation, etc.
1813
+
1814
+ * At present, $stderr redirection is primarily used to capture
1815
+ errors from test fixtures so that they can be displayed at the
1816
+ conclusion of a test run. For instance, if a simulator detects
1817
+ a memory access violation or a divide by zero error, this notice
1818
+ might go unseen in all the output scrolling past in a terminal.
1819
+
1820
+ * The preprocessing tools can each be overridden with non-gcc
1821
+ equivalents. However, this is an advanced feature not yet
1822
+ documented and requires that the replacement toolchain conform
1823
+ to the same conventions used by gcc.
1824
+
1825
+ **Ceedling Collection Used in Compilation**:
1826
+
1827
+ * `COLLECTION_PATHS_TEST`:
1828
+
1829
+ All test paths
1830
+
1831
+ * `COLLECTION_PATHS_SOURCE`:
1832
+
1833
+ All source paths
1834
+
1835
+ * `COLLECTION_PATHS_INCLUDE`:
1836
+
1837
+ All include paths
1838
+
1839
+ * `COLLECTION_PATHS_SUPPORT`:
1840
+
1841
+ All test support paths
1842
+
1843
+ * `COLLECTION_PATHS_SOURCE_AND_INCLUDE`:
1844
+
1845
+ All source and include paths
1846
+
1847
+ * `COLLECTION_PATHS_SOURCE_INCLUDE_VENDOR`:
1848
+
1849
+ All source and include paths + applicable vendor paths (e.g.
1850
+ CException's source path if exceptions enabled)
1851
+
1852
+ * `COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE`:
1853
+
1854
+ All test toolchain include paths
1855
+
1856
+ * `COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE`:
1857
+
1858
+ All test, source, and include paths
1859
+
1860
+ * `COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR`:
1861
+
1862
+ All test, source, include, and applicable vendor paths (e.g. Unity's
1863
+ source path plus CMock and CException's source paths if mocks and
1864
+ exceptions are enabled)
1865
+
1866
+ * `COLLECTION_PATHS_RELEASE_TOOLCHAIN_INCLUDE`:
1867
+
1868
+ All release toolchain include paths
1869
+
1870
+ * `COLLECTION_DEFINES_TEST_AND_VENDOR`:
1871
+
1872
+ All symbols specified in [:defines][:test] + symbols defined for
1873
+ enabled vendor tools - e.g. [:unity][:defines], [:cmock][:defines],
1874
+ and [:cexception][:defines]
1875
+
1876
+ * `COLLECTION_DEFINES_RELEASE_AND_VENDOR`:
1877
+
1878
+ All symbols specified in [:defines][:release] plus symbols defined by
1879
+ [:cexception][:defines] if exceptions are ena bled
1880
+
1881
+
1882
+ Notes:
1883
+
1884
+ * Other collections exist within Ceedling. However, they are
1885
+ only useful for advanced features not yet documented.
1886
+
1887
+ * Wherever multiple path lists are combined for use Ceedling prioritizes
1888
+ path groups as follows: test paths, support paths, source paths, include
1889
+ paths.
1890
+ This can be useful, for instance, in certain testing scenarios
1891
+ where we desire Ceedling or the compiler to find a stand-in header file
1892
+ before the actual source header file of the same name.
1893
+
1894
+
1895
+ **plugins**: Ceedling extensions
1896
+
1897
+ * `load_paths`:
1898
+
1899
+ Base paths to search for plugin subdirectories or extra ruby functionalit
1900
+
1901
+ **Default**: [] (empty)
1902
+
1903
+ * `enabled`:
1904
+
1905
+ List of plugins to be used - a plugin's name is identical to the
1906
+ subdirectory that contains it (and the name of certain files within
1907
+ that subdirectory)
1908
+
1909
+ **Default**: [] (empty)
1910
+
1911
+
1912
+ Plugins can provide a variety of added functionality to Ceedling. In
1913
+ general use, it's assumed that at least one reporting plugin will be
1914
+ used to format test results. However, if no reporting plugins are
1915
+ specified, Ceedling will print to `$stdout` the (quite readable) raw
1916
+ test results from all test fixtures executed.
1917
+
1918
+ Example [:plugins] YAML blurb
1919
+
1920
+ ```yaml
1921
+ :plugins:
1922
+ :load_paths:
1923
+ - project/tools/ceedling/plugins #home to your collection of plugin directories
1924
+ - project/support #maybe home to some ruby code your custom plugins share
1925
+ :enabled:
1926
+ - stdout_pretty_tests_report #nice test results at your command line
1927
+ - our_custom_code_metrics_report #maybe you needed line count and complexity metrics, so you
1928
+ #created a plugin to scan all your code and collect that info
1929
+ ```
1930
+
1931
+ * `stdout_pretty_tests_report`:
1932
+
1933
+ Prints to $stdout a well-formatted list of ignored and failed tests,
1934
+ final test counts, and any extraneous output (e.g. printf statements
1935
+ or simulator memory errors) collected from executing the test
1936
+ fixtures. Meant to be used with runs at the command line.
1937
+
1938
+ * `stdout_ide_tests_report`:
1939
+
1940
+ Prints to $stdout simple test results formatted such that an IDE
1941
+ executing test-related Rake tasks can recognize file paths and line
1942
+ numbers in test failures, etc. Thus, you can click a test result in
1943
+ your IDE's execution window and jump to the failure (or ignored test)
1944
+ in your test file (obviously meant to be used with an [IDE like
1945
+ Eclipse][ide], etc).
1946
+
1947
+ [ide]: http://throwtheswitch.org/white-papers/using-with-ides.html
1948
+
1949
+ * `xml_tests_report`:
1950
+
1951
+ Creates an XML file of test results in the xUnit format (handy for
1952
+ Continuous Integration build servers or as input to other reporting
1953
+ tools). Produces a file report.xml in <build root>/artifacts/tests.
1954
+
1955
+ * `bullseye`:
1956
+
1957
+ Adds additional Rake tasks to execute tests with the commercial code
1958
+ coverage tool provided by [Bullseye][]. See readme.txt inside the bullseye
1959
+ plugin directory for configuration and use instructions. Note:
1960
+ Bullseye only works with certain compilers and linkers (healthy list
1961
+ of supported toolchains though).
1962
+
1963
+ [bullseye]: http://www.bullseye.com
1964
+
1965
+ * `gcov`:
1966
+
1967
+ Adds additional Rake tasks to execute tests with the GNU code coverage
1968
+ tool [gcov][]. See readme.txt inside the gcov directory for configuration
1969
+ and use instructions. Only works with GNU compiler and linker.
1970
+
1971
+ [gcov]: http://gcc.gnu.org/onlinedocs/gcc/Gcov.html
1972
+
1973
+ * `warnings_report`:
1974
+
1975
+ Scans compiler and linker `$stdout / $stderr` output for the word
1976
+ 'warning' (case insensitive). All code warnings (or tool warnings) are
1977
+ logged to a file warnings.log in the appropriate `<build
1978
+ root>/artifacts` directory (e.g. test/ for test tasks, `release/` for a
1979
+ release build, or even `bullseye/` for bullseye runs).
1980
+
1981
+ Module Generator
1982
+ ========================
1983
+ Ceedling includes a plugin called module_generator that will create a source, header and test file for you.
1984
+ There are several possibilities to configure this plugin through your project.yml to suit your project's needs.
1985
+
1986
+ Directory Structure
1987
+ -------------------------------------------
1988
+
1989
+ The default configuration for directory/project structure is:
1990
+ ```yaml
1991
+ :module_generator:
1992
+ :project_root: ./
1993
+ :source_root: src/
1994
+ :test_root: test/
1995
+ ```
1996
+ You can change these variables in your project.yml file to comply with your project's directory structure.
1997
+
1998
+ If you call `ceedling module:create`, it will create three files:
1999
+ 1. A source file in the source_root
2000
+ 2. A header file in the source_root
2001
+ 3. A test file in the test_root
2002
+
2003
+ If you want your header file to be in another location,
2004
+ you can specify the ':inc_root:" in your project.yml file:
2005
+ ```yaml
2006
+ :module_generator:
2007
+ :inc_root: inc/
2008
+ ```
2009
+ The module_generator will then create the header file in your defined ':inc_root:'.
2010
+ By default, ':inc_root:' is not defined so the module_generator will use the source_root.
2011
+
2012
+ Sometimes, your project can't be divided into a single src, inc, and test folder. You have several directories
2013
+ with sources/..., something like this for example:
2014
+ <project_root>
2015
+ - myDriver
2016
+ - src
2017
+ - inc
2018
+ - test
2019
+ - myOtherDriver
2020
+ - src
2021
+ - inc
2022
+ - test
2023
+ - ...
2024
+
2025
+ Don't worry, you don't have to manually create the source/header/test files.
2026
+ The module_generator can accept a path to create a source_root/inc_root/test_root folder with your files:
2027
+ `ceedling module:create[<module_root_path>:<module_name>]`
2028
+
2029
+ F.e., applied to the above project structure:
2030
+ `ceedling module:create[myOtherDriver:driver]`
2031
+ This will make the module_generator run in the subdirectory 'myOtherDriver' and generate the module files
2032
+ for you in that directory. So, this command will generate the following files:
2033
+ 1. A source file 'driver.c' in <project_root>/myOtherDriver/<source_root>
2034
+ 2. A header file 'driver.h' in <project_root>/myOtherDriver/<source_root> (or <inc_root> if specified)
2035
+ 3. A test file 'test_driver.c' in <project_root>/myOtherDriver/<test_root>
2036
+
2037
+ Naming
2038
+ -------------------------------------------
2039
+ By default, the module_generator will generate your files in lowercase.
2040
+ `ceedling module:create[mydriver]` and `ceedling module:create[myDriver]`(note the uppercase) will generate the same files:
2041
+ 1. mydriver.c
2042
+ 2. mydriver.h
2043
+ 3. test_mydriver.c
2044
+
2045
+ You can configure the module_generator to use a differect naming mechanism through the project.yml:
2046
+ ```yaml
2047
+ :module_generator:
2048
+ :naming: "camel"
2049
+ ```
2050
+ There are other possibilities as well (bumpy, camel, snake, caps).
2051
+ Refer to the unity module generator for more info (the unity module generator is used under the hood by module_generator).
2052
+
2053
+
2054
+ Boilerplate header
2055
+ -------------------------------------------
2056
+ There are two ways of adding a boilerplate header comment to your generated files:
2057
+ * With a defined string in the project.yml file:
2058
+
2059
+ ```yaml
2060
+ :module_generator:
2061
+ :boilerplates:
2062
+ :src: '/* This is Boilerplate code. */'
2063
+ ```
2064
+
2065
+ Using the command **ceedling module:create[foo]** it creates the source module as follows:
2066
+
2067
+ ```c
2068
+ /* This is Boilerplate code. */
2069
+ #include "foo.h"
2070
+ ```
2071
+
2072
+ It would be the same for **:tst:** and **:inc:** adding its respective options.
2073
+
2074
+ * Defining an external file with boileplate code:
2075
+
2076
+ ```yml
2077
+ :module_generator:
2078
+ :boilerplate_files:
2079
+ :src: '<template_folder>\src_boilerplate.txt'
2080
+ :inc: '<template_folder>\inc_boilerplate.txt'
2081
+ :tst: '<template_folder>\tst_boilerplate.txt'
2082
+ ```
2083
+
2084
+ For whatever file names in whichever folder you desire.
2085
+
2086
+
2087
+ Advanced Topics (Coming)
2088
+ ========================
2089
+
2090
+ Modifying Your Configuration without Modifying Your Project File: Option Files & User Files
2091
+ -------------------------------------------------------------------------------------------
2092
+
2093
+ Modifying your project file without modifying your project file
2094
+
2095
+ Debugging and/or printf()
2096
+ -------------------------
2097
+
2098
+ When you gotta get your hands dirty...
2099
+
2100
+ Ceedling Plays Nice with Others - Using Ceedling for Tests Alongside Another Release Build Setup
2101
+ ------------------------------------------------------------------------------------------------
2102
+
2103
+ You've got options.
2104
+
2105
+ Adding Handy Rake Tasks for Your Project (without Fancy Pants Custom Plugins)
2106
+ -----------------------------------------------------------------------------
2107
+
2108
+ Simple as snot.
2109
+
2110
+ Working with Non-Desktop Testing Environments
2111
+ ---------------------------------------------
2112
+
2113
+ For those crazy platforms lacking command line simulators and for which
2114
+ cross-compiling on the desktop just ain't gonna get it done.
2115
+
2116
+ Creating Custom Plugins
2117
+ -----------------------
2118
+
2119
+ Oh boy. This is going to take some explaining.