ceedling 0.12.2 → 0.13.0.rc1

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