ceedling 0.28.2 → 0.28.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (253) hide show
  1. checksums.yaml +4 -4
  2. data/assets/ceedling +3 -0
  3. data/assets/ceedling.cmd +1 -0
  4. data/assets/default_gitignore +5 -0
  5. data/assets/project_with_guts.yml +1 -0
  6. data/assets/project_with_guts_gcov.yml +3 -0
  7. data/assets/test_example_file_verbose.c +12 -0
  8. data/bin/ceedling +30 -6
  9. data/docs/CeedlingPacket.md +135 -23
  10. data/docs/CeedlingPacket.odt +0 -0
  11. data/examples/blinky/rakefile.rb +2 -1
  12. data/lib/ceedling/configurator.rb +7 -5
  13. data/lib/ceedling/configurator_builder.rb +10 -7
  14. data/lib/ceedling/configurator_plugins.rb +29 -24
  15. data/lib/ceedling/configurator_setup.rb +0 -1
  16. data/lib/ceedling/defaults.rb +7 -2
  17. data/lib/ceedling/dependinator.rb +10 -2
  18. data/lib/ceedling/file_finder.rb +57 -49
  19. data/lib/ceedling/file_path_utils.rb +12 -4
  20. data/lib/ceedling/file_wrapper.rb +4 -0
  21. data/lib/ceedling/generator.rb +4 -3
  22. data/lib/ceedling/generator_test_results.rb +15 -13
  23. data/lib/ceedling/plugin_manager.rb +18 -18
  24. data/lib/ceedling/plugin_reportinator.rb +3 -2
  25. data/lib/ceedling/plugin_reportinator_helper.rb +2 -3
  26. data/lib/ceedling/preprocessinator_extractor.rb +2 -2
  27. data/lib/ceedling/preprocessinator_includes_handler.rb +5 -0
  28. data/lib/ceedling/rakefile.rb +1 -0
  29. data/lib/ceedling/release_invoker_helper.rb +5 -2
  30. data/lib/ceedling/rules_release.rake +2 -1
  31. data/lib/ceedling/rules_tests.rake +18 -9
  32. data/lib/ceedling/rules_tests_deep_dependencies.rake +2 -2
  33. data/lib/ceedling/task_invoker.rb +15 -3
  34. data/lib/ceedling/tasks_vendor.rake +3 -3
  35. data/lib/ceedling/test_invoker.rb +39 -12
  36. data/lib/ceedling/test_invoker_helper.rb +5 -1
  37. data/lib/ceedling/tool_executor.rb +8 -4
  38. data/lib/ceedling/version.rb +1 -1
  39. data/out.fail +21 -0
  40. data/plugins/beep/README.md +22 -0
  41. data/plugins/beep/lib/beep.rb +40 -0
  42. data/plugins/bullseye/bullseye.rake +43 -36
  43. data/plugins/bullseye/config/defaults.yml +4 -0
  44. data/plugins/bullseye/lib/bullseye.rb +27 -5
  45. data/plugins/command_hooks/lib/command_hooks.rb +3 -0
  46. data/plugins/gcov/README.md +34 -1
  47. data/plugins/gcov/config/defaults.yml +3 -3
  48. data/plugins/gcov/gcov.rake +7 -5
  49. data/plugins/gcov/lib/gcov.rb +3 -1
  50. data/plugins/gcov/lib/gcov_constants.rb +2 -0
  51. data/plugins/junit_tests_report/lib/junit_tests_report.rb +12 -9
  52. data/plugins/module_generator/lib/module_generator.rb +14 -1
  53. data/plugins/module_generator/module_generator.rake +21 -4
  54. data/plugins/raw_output_report/lib/raw_output_report.rb +41 -0
  55. data/spec/gcov/gcov_deployment_spec.rb +1 -1
  56. data/spec/gcov/gcov_test_cases_spec.rb +2 -2
  57. data/spec/generator_test_results_spec.rb +5 -0
  58. data/spec/preprocessinator_includes_handler_spec.rb +1 -0
  59. data/spec/spec_system_helper.rb +178 -4
  60. data/spec/support/test_example.fail +1 -0
  61. data/spec/support/test_example.pass +1 -0
  62. data/spec/support/test_example_empty.pass +1 -0
  63. data/spec/support/test_example_ignore.pass +1 -0
  64. data/spec/support/test_example_mangled.pass +1 -0
  65. data/spec/support/test_example_with_time.pass +22 -0
  66. data/spec/system/deployment_spec.rb +33 -0
  67. data/vendor/cmock/README.md +4 -3
  68. data/vendor/cmock/docs/CMock_Summary.md +1 -1
  69. data/vendor/cmock/lib/cmock_config.rb +4 -0
  70. data/vendor/cmock/lib/cmock_generator.rb +5 -2
  71. data/vendor/cmock/lib/cmock_generator_plugin_array.rb +4 -4
  72. data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +9 -11
  73. data/vendor/cmock/lib/cmock_generator_plugin_cexception.rb +0 -1
  74. data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +2 -3
  75. data/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb +2 -4
  76. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +0 -2
  77. data/vendor/cmock/lib/cmock_generator_utils.rb +16 -3
  78. data/vendor/cmock/lib/cmock_header_parser.rb +59 -34
  79. data/vendor/cmock/release/build.info +1 -1
  80. data/vendor/cmock/release/version.info +1 -1
  81. data/vendor/cmock/scripts/create_makefile.rb +17 -2
  82. data/vendor/cmock/src/cmock.c +13 -7
  83. data/vendor/cmock/test/test_helper.rb +11 -10
  84. data/vendor/cmock/test/unit/cmock_config_test.rb +4 -2
  85. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +10 -4
  86. data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +20 -12
  87. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +2 -2
  88. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +2 -2
  89. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +3 -3
  90. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +8 -6
  91. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +27 -10
  92. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +108 -20
  93. data/vendor/cmock/vendor/c_exception/Gemfile +4 -0
  94. data/vendor/cmock/vendor/c_exception/Gemfile.lock +12 -0
  95. data/vendor/cmock/vendor/c_exception/LICENSE.txt +30 -0
  96. data/vendor/cmock/vendor/c_exception/README.md +162 -0
  97. data/vendor/cmock/vendor/c_exception/Rakefile +42 -0
  98. data/vendor/cmock/vendor/c_exception/docs/CException.md +292 -0
  99. data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  100. data/vendor/cmock/vendor/c_exception/lib/CException.c +46 -0
  101. data/vendor/cmock/vendor/c_exception/lib/CException.h +110 -0
  102. data/vendor/cmock/vendor/c_exception/makefile +24 -0
  103. data/vendor/cmock/vendor/c_exception/release/build.info +2 -0
  104. data/vendor/cmock/vendor/c_exception/release/version.info +2 -0
  105. data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +46 -0
  106. data/vendor/cmock/vendor/c_exception/test/TestException.c +391 -0
  107. data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +67 -0
  108. data/vendor/cmock/vendor/unity/README.md +231 -0
  109. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +118 -0
  110. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +39 -0
  111. data/vendor/cmock/vendor/unity/auto/generate_config.yml +36 -0
  112. data/vendor/cmock/vendor/unity/auto/generate_module.rb +308 -0
  113. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +457 -0
  114. data/vendor/cmock/vendor/unity/auto/parse_output.rb +323 -0
  115. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +252 -0
  116. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +25 -0
  117. data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +6 -0
  118. data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +139 -0
  119. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +136 -0
  120. data/vendor/cmock/vendor/unity/auto/unity_to_junit.py +146 -0
  121. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +206 -0
  122. data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  123. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +779 -0
  124. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +433 -0
  125. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +192 -0
  126. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +260 -0
  127. data/vendor/cmock/vendor/unity/docs/license.txt +21 -0
  128. data/vendor/cmock/vendor/unity/examples/example_1/makefile +71 -0
  129. data/vendor/cmock/vendor/unity/examples/example_1/readme.txt +5 -0
  130. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +24 -0
  131. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +3 -0
  132. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +11 -0
  133. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +2 -0
  134. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +62 -0
  135. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +31 -0
  136. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -0
  137. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -0
  138. data/vendor/cmock/vendor/unity/examples/example_2/makefile +70 -0
  139. data/vendor/cmock/vendor/unity/examples/example_2/readme.txt +5 -0
  140. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +24 -0
  141. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +3 -0
  142. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +11 -0
  143. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +2 -0
  144. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +64 -0
  145. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +33 -0
  146. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
  147. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
  148. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
  149. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +10 -0
  150. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +12 -0
  151. data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +43 -0
  152. data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +249 -0
  153. data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +13 -0
  154. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +24 -0
  155. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +3 -0
  156. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +11 -0
  157. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +2 -0
  158. data/vendor/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +46 -0
  159. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +62 -0
  160. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +31 -0
  161. data/vendor/cmock/vendor/unity/examples/unity_config.h +247 -0
  162. data/vendor/cmock/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
  163. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +48 -0
  164. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +178 -0
  165. data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +9 -0
  166. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +436 -0
  167. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +83 -0
  168. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +51 -0
  169. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +47 -0
  170. data/vendor/cmock/vendor/unity/extras/fixture/test/Makefile +75 -0
  171. data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +22 -0
  172. data/vendor/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +39 -0
  173. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +543 -0
  174. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +57 -0
  175. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +57 -0
  176. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +17 -0
  177. data/vendor/cmock/vendor/unity/release/build.info +2 -0
  178. data/vendor/cmock/vendor/unity/release/version.info +2 -0
  179. data/vendor/cmock/vendor/unity/src/unity.c +1572 -0
  180. data/vendor/cmock/vendor/unity/src/unity.h +503 -0
  181. data/vendor/cmock/vendor/unity/src/unity_internals.h +924 -0
  182. data/vendor/cmock/vendor/unity/test/Makefile +68 -0
  183. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +61 -0
  184. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +57 -0
  185. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +55 -0
  186. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.h +15 -0
  187. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +80 -0
  188. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +76 -0
  189. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -0
  190. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -0
  191. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +89 -0
  192. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +89 -0
  193. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +77 -0
  194. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +89 -0
  195. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +89 -0
  196. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +90 -0
  197. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +67 -0
  198. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +70 -0
  199. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +58 -0
  200. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +67 -0
  201. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +70 -0
  202. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +71 -0
  203. data/vendor/cmock/vendor/unity/test/rakefile +125 -0
  204. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +260 -0
  205. data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  206. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +78 -0
  207. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +78 -0
  208. data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +49 -0
  209. data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +50 -0
  210. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +47 -0
  211. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +59 -0
  212. data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +47 -0
  213. data/vendor/cmock/vendor/unity/test/targets/hitech_picc18.yml +101 -0
  214. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +90 -0
  215. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +80 -0
  216. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +80 -0
  217. data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +94 -0
  218. data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +84 -0
  219. data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +95 -0
  220. data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +86 -0
  221. data/vendor/cmock/vendor/unity/test/testdata/CException.h +11 -0
  222. data/vendor/cmock/vendor/unity/test/testdata/Defs.h +8 -0
  223. data/vendor/cmock/vendor/unity/test/testdata/cmock.h +14 -0
  224. data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +13 -0
  225. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +186 -0
  226. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +70 -0
  227. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +195 -0
  228. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +1252 -0
  229. data/vendor/cmock/vendor/unity/test/tests/testparameterized.c +113 -0
  230. data/vendor/cmock/vendor/unity/test/tests/testunity.c +5371 -0
  231. data/vendor/unity/auto/generate_test_runner.rb +30 -10
  232. data/vendor/unity/auto/parse_output.rb +212 -109
  233. data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +9 -10
  234. data/vendor/unity/docs/UnityAssertionsReference.md +11 -2
  235. data/vendor/unity/docs/UnityConfigurationGuide.md +90 -55
  236. data/vendor/unity/docs/UnityGettingStartedGuide.md +6 -5
  237. data/vendor/unity/docs/UnityHelperScriptsGuide.md +23 -5
  238. data/vendor/unity/examples/unity_config.h +8 -0
  239. data/vendor/unity/extras/fixture/src/unity_fixture.c +4 -0
  240. data/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
  241. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
  242. data/vendor/unity/release/build.info +1 -1
  243. data/vendor/unity/release/version.info +1 -1
  244. data/vendor/unity/src/unity.c +64 -57
  245. data/vendor/unity/src/unity.h +111 -7
  246. data/vendor/unity/src/unity_internals.h +173 -73
  247. data/vendor/unity/test/Makefile +5 -1
  248. data/vendor/unity/test/testdata/testRunnerGenerator.c +4 -1
  249. data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +4 -1
  250. data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +4 -1
  251. data/vendor/unity/test/tests/testparameterized.c +5 -2
  252. data/vendor/unity/test/tests/testunity.c +34 -0
  253. metadata +150 -2
@@ -1,4 +1,4 @@
1
- # ThrowTheSwitch.org Coding Standard
1
+ # ThrowTheSwitch.org Coding Standard
2
2
 
3
3
  Hi. Welcome to the coding standard for ThrowTheSwitch.org. For the most part,
4
4
  we try to follow these standards to unify our contributors' code into a cohesive
@@ -11,7 +11,7 @@ and we'll try to be polite when we notice yours.
11
11
 
12
12
  ## Why Have A Coding Standard?
13
13
 
14
- Being consistent makes code easier to understand. We've made an attempt to keep
14
+ Being consistent makes code easier to understand. We've tried to keep
15
15
  our standard simple because we also believe that we can only expect someone to
16
16
  follow something that is understandable. Please do your best.
17
17
 
@@ -51,11 +51,11 @@ much as they can, but give the user the power to override it when it's wrong.
51
51
 
52
52
  Let's talk about naming things. Programming is all about naming things. We name
53
53
  files, functions, variables, and so much more. While we're not always going to
54
- find the best name for something, we actually put quite a bit of effort into
54
+ find the best name for something, we actually put a bit of effort into
55
55
  finding *What Something WANTS to be Called*™.
56
56
 
57
- When naming things, we more or less follow this hierarchy, the first being the
58
- most important to us (but we do all four whenever possible):
57
+ When naming things, we follow this hierarchy, the first being the
58
+ most important to us (but we do all four when possible):
59
59
  1. Readable
60
60
  2. Descriptive
61
61
  3. Consistent
@@ -74,7 +74,7 @@ abbreviations (sticking to ones we feel are common).
74
74
  We like descriptive names for things, especially functions and variables.
75
75
  Finding the right name for something is an important endeavor. You might notice
76
76
  from poking around our code that this often results in names that are a little
77
- longer than the average. Guilty. We're okay with a tiny bit more typing if it
77
+ longer than the average. Guilty. We're okay with a bit more typing if it
78
78
  means our code is easier to understand.
79
79
 
80
80
  There are two exceptions to this rule that we also stick to as religiously as
@@ -82,8 +82,7 @@ possible:
82
82
 
83
83
  First, while we realize hungarian notation (and similar systems for encoding
84
84
  type information into variable names) is providing a more descriptive name, we
85
- feel that (for the average developer) it takes away from readability and
86
- therefore is to be avoided.
85
+ feel that (for the average developer) it takes away from readability and is to be avoided.
87
86
 
88
87
  Second, loop counters and other local throw-away variables often have a purpose
89
88
  which is obvious. There's no need, therefore, to get carried away with complex
@@ -128,7 +127,7 @@ the same. It will only hurt a little. We promise.
128
127
  #### Whitespace
129
128
 
130
129
  Our C-style is to use spaces and to use 4 of them per indent level. It's a nice
131
- power-of-2 number that looks decent on a wide screen. We have no more reason
130
+ power-of-2 number that looks decent on a wide-screen. We have no more reason
132
131
  than that. We break that rule when we have lines that wrap (macros or function
133
132
  arguments or whatnot). When that happens, we like to indent further to line
134
133
  things up in nice tidy columns.
@@ -200,7 +199,7 @@ that happens, we like to indent further to line things up in nice tidy columns.
200
199
 
201
200
  ## Documentation
202
201
 
203
- Egad. Really? We use markdown and we like pdf files because they can be made to
202
+ Egad. Really? We use mark down and we like pdf files because they can be made to
204
203
  look nice while still being portable. Good enough?
205
204
 
206
205
 
@@ -80,7 +80,7 @@ marked as an optional parameter because some assertions only need a single
80
80
  "actual" parameter (e.g. null check).
81
81
  "Size/count" refers to string lengths, number of array elements, etc.
82
82
 
83
- Many of Unity's assertions are apparent duplications in that the same data type
83
+ Many of Unity's assertions are clear duplications in that the same data type
84
84
  is handled by several assertions. The differences among these are in how failure
85
85
  messages are presented. For instance, a `_HEX` variant of an assertion prints
86
86
  the expected and actual values of that assertion formatted as hexadecimal.
@@ -104,6 +104,15 @@ becomes messageified like thus...
104
104
 
105
105
  TEST_ASSERT_X_MESSAGE( {modifiers}, {expected}, actual, {size/count}, message )
106
106
 
107
+ Notes:
108
+ - The `_MESSAGE` variants intentionally do not support `printf` style formatting
109
+ since many embedded projects don't support or avoid `printf` for various reasons.
110
+ It is possible to use `sprintf` before the assertion to assemble a complex fail
111
+ message, if necessary.
112
+ - If you want to output a counter value within an assertion fail message (e.g. from
113
+ a loop) , building up an array of results and then using one of the `_ARRAY`
114
+ assertions (see below) might be a handy alternative to `sprintf`.
115
+
107
116
 
108
117
  #### TEST_ASSERT_X_ARRAY Variants
109
118
 
@@ -694,7 +703,7 @@ point value.
694
703
 
695
704
  So what happens when it's zero? Zero - even more than other floating point
696
705
  values - can be represented many different ways. It doesn't matter if you have
697
- 0 x 20or 0 x 263.It's still zero, right? Luckily, if you
706
+ 0 x 20 or 0 x 263.It's still zero, right? Luckily, if you
698
707
  subtract these values from each other, they will always produce a difference of
699
708
  zero, which will still fall between 0 plus or minus a delta of 0. So it still
700
709
  works!
@@ -1,4 +1,4 @@
1
- # Unity Configuration Guide
1
+ # Unity Configuration Guide
2
2
 
3
3
  ## C Standards, Compilers and Microcontrollers
4
4
 
@@ -19,7 +19,7 @@ definitions. A couple are macros with arguments. They live inside the
19
19
  unity_internals.h header file. We don't necessarily recommend opening that file
20
20
  unless you really need to. That file is proof that a cross-platform library is
21
21
  challenging to build. From a more positive perspective, it is also proof that a
22
- great deal of complexity can be centralized primarily to one place in order to
22
+ great deal of complexity can be centralized primarily to one place to
23
23
  provide a more consistent and simple experience elsewhere.
24
24
 
25
25
 
@@ -58,7 +58,7 @@ sizes. It starts off by trying to do it automatically.
58
58
  ##### `UNITY_EXCLUDE_STDINT_H`
59
59
 
60
60
  The first thing that Unity does to guess your types is check `stdint.h`.
61
- This file includes defines like `UINT_MAX` that Unity can make use of to
61
+ This file includes defines like `UINT_MAX` that Unity can use to
62
62
  learn a lot about your system. It's possible you don't want it to do this
63
63
  (um. why not?) or (more likely) it's possible that your system doesn't
64
64
  support `stdint.h`. If that's the case, you're going to want to define this.
@@ -79,18 +79,7 @@ _Example:_
79
79
  #define UNITY_EXCLUDE_LIMITS_H
80
80
 
81
81
 
82
- ##### `UNITY_EXCLUDE_SIZEOF`
83
-
84
- The third and final attempt to guess your types is to use the `sizeof()`
85
- operator. Even if the first two options don't work, this one covers most cases.
86
- There _is_ a rare compiler or two out there that doesn't support sizeof() in the
87
- preprocessing stage, though. For these, you have the ability to disable this
88
- feature as well.
89
-
90
- _Example:_
91
- #define UNITY_EXCLUDE_SIZEOF
92
-
93
- If you've disabled all of the automatic options above, you're going to have to
82
+ If you've disabled both of the automatic options above, you're going to have to
94
83
  do the configuration yourself. Don't worry. Even this isn't too bad... there are
95
84
  just a handful of defines that you are going to specify if you don't like the
96
85
  defaults.
@@ -127,7 +116,7 @@ _Example:_
127
116
  #define UNITY_POINTER_WIDTH 64
128
117
 
129
118
 
130
- ##### `UNITY_INCLUDE_64`
119
+ ##### `UNITY_SUPPORT_64`
131
120
 
132
121
  Unity will automatically include 64-bit support if it auto-detects it, or if
133
122
  your `int`, `long`, or pointer widths are greater than 32-bits. Define this to
@@ -136,7 +125,7 @@ can be a significant size and speed impact to enabling 64-bit support on small
136
125
  targets, so don't define it if you don't need it.
137
126
 
138
127
  _Example:_
139
- #define UNITY_INCLUDE_64
128
+ #define UNITY_SUPPORT_64
140
129
 
141
130
 
142
131
  ### Floating Point Types
@@ -170,24 +159,20 @@ _Example:_
170
159
  #define UNITY_INCLUDE_DOUBLE
171
160
 
172
161
 
173
- ##### `UNITY_FLOAT_VERBOSE`
174
-
175
- ##### `UNITY_DOUBLE_VERBOSE`
162
+ ##### `UNITY_EXCLUDE_FLOAT_PRINT`
176
163
 
177
164
  Unity aims for as small of a footprint as possible and avoids most standard
178
- library calls (some embedded platforms don't have a standard library!). Because
165
+ library calls (some embedded platforms dont have a standard library!). Because
179
166
  of this, its routines for printing integer values are minimalist and hand-coded.
180
- To keep Unity universal, though, we chose to _not_ develop our own floating
181
- point print routines. Instead, the display of floating point values during a
182
- failure are optional. By default, Unity will not print the actual results of
183
- floating point assertion failure. So a failed assertion will produce a message
184
- like `"Values Not Within Delta"`. If you would like verbose failure messages for
185
- floating point assertions, use these options to give more explicit failure
186
- messages (e.g. `"Expected 4.56 Was 4.68"`). Note that this feature requires the
187
- use of `sprintf` so might not be desirable in all cases.
167
+ Therefore, the display of floating point values during a failure are optional.
168
+ By default, Unity will print the actual results of floating point assertion
169
+ failure (e.g. ”Expected 4.56 Was 4.68”). To not include this extra support, you
170
+ can use this define to instead respond to a failed assertion with a message like
171
+ Values Not Within Delta”. If you would like verbose failure messages for floating
172
+ point assertions, use these options to give more explicit failure messages.
188
173
 
189
174
  _Example:_
190
- #define UNITY_DOUBLE_VERBOSE
175
+ #define UNITY_EXCLUDE_FLOAT_PRINT
191
176
 
192
177
 
193
178
  ##### `UNITY_FLOAT_TYPE`
@@ -237,7 +222,7 @@ In addition to the options listed above, there are a number of other options
237
222
  which will come in handy to customize Unity's behavior for your specific
238
223
  toolchain. It is possible that you may not need to touch any of these... but
239
224
  certain platforms, particularly those running in simulators, may need to jump
240
- through extra hoops to operate properly. These macros will help in those
225
+ through extra hoops to run properly. These macros will help in those
241
226
  situations.
242
227
 
243
228
 
@@ -263,7 +248,8 @@ _Example:_
263
248
  Say you are forced to run your test suite on an embedded processor with no
264
249
  `stdout` option. You decide to route your test result output to a custom serial
265
250
  `RS232_putc()` function you wrote like thus:
266
-
251
+ #include "RS232_header.h"
252
+ ...
267
253
  #define UNITY_OUTPUT_CHAR(a) RS232_putc(a)
268
254
  #define UNITY_OUTPUT_START() RS232_config(115200,1,8,0)
269
255
  #define UNITY_OUTPUT_FLUSH() RS232_flush()
@@ -271,31 +257,35 @@ Say you are forced to run your test suite on an embedded processor with no
271
257
 
272
258
  _Note:_
273
259
  `UNITY_OUTPUT_FLUSH()` can be set to the standard out flush function simply by
274
- specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required. If you
275
- specify a custom flush function instead with `UNITY_OUTPUT_FLUSH` directly, it
276
- will declare an instance of your function by default. If you want to disable
277
- this behavior, add `UNITY_OMIT_OUTPUT_FLUSH_HEADER_DECLARATION`.
278
-
279
-
280
- ##### `UNITY_SUPPORT_WEAK`
281
-
282
- For some targets, Unity can make the otherwise required `setUp()` and
283
- `tearDown()` functions optional. This is a nice convenience for test writers
284
- since `setUp` and `tearDown` don't often actually _do_ anything. If you're using
285
- gcc or clang, this option is automatically defined for you. Other compilers can
286
- also support this behavior, if they support a C feature called weak functions. A
287
- weak function is a function that is compiled into your executable _unless_ a
288
- non-weak version of the same function is defined elsewhere. If a non-weak
289
- version is found, the weak version is ignored as if it never existed. If your
290
- compiler supports this feature, you can let Unity know by defining
291
- `UNITY_SUPPORT_WEAK` as the function attributes that would need to be applied to
292
- identify a function as weak. If your compiler lacks support for weak functions,
293
- you will always need to define `setUp` and `tearDown` functions (though they can
294
- be and often will be just empty). The most common options for this feature are:
260
+ specifying `UNITY_USE_FLUSH_STDOUT`. No other defines are required.
261
+
262
+
263
+ ##### `UNITY_WEAK_ATTRIBUTE`
264
+
265
+ ##### `UNITY_WEAK_PRAGMA`
266
+
267
+ ##### `UNITY_NO_WEAK`
268
+
269
+ For some targets, Unity can make the otherwise required setUp() and tearDown()
270
+ functions optional. This is a nice convenience for test writers since setUp and
271
+ tearDown don’t often actually do anything. If you’re using gcc or clang, this
272
+ option is automatically defined for you. Other compilers can also support this
273
+ behavior, if they support a C feature called weak functions. A weak function is
274
+ a function that is compiled into your executable unless a non-weak version of
275
+ the same function is defined elsewhere. If a non-weak version is found, the weak
276
+ version is ignored as if it never existed. If your compiler supports this feature,
277
+ you can let Unity know by defining UNITY_WEAK_ATTRIBUTE or UNITY_WEAK_PRAGMA as
278
+ the function attributes that would need to be applied to identify a function as
279
+ weak. If your compiler lacks support for weak functions, you will always need to
280
+ define setUp and tearDown functions (though they can be and often will be just
281
+ empty). You can also force Unity to NOT use weak functions by defining
282
+ UNITY_NO_WEAK. The most common options for this feature are:
295
283
 
296
284
  _Example:_
297
- #define UNITY_SUPPORT_WEAK weak
298
- #define UNITY_SUPPORT_WEAK __attribute__((weak))
285
+ #define UNITY_WEAK_ATTRIBUTE weak
286
+ #define UNITY_WEAK_ATTRIBUTE __attribute__((weak))
287
+ #define UNITY_WEAK_PRAGMA
288
+ #define UNITY_NO_WEAK
299
289
 
300
290
 
301
291
  ##### `UNITY_PTR_ATTRIBUTE`
@@ -309,6 +299,51 @@ _Example:_
309
299
  #define UNITY_PTR_ATTRIBUTE near
310
300
 
311
301
 
302
+ ##### `UNITY_PRINT_EOL`
303
+
304
+ By default, Unity outputs \n at the end of each line of output. This is easy
305
+ to parse by the scripts, by Ceedling, etc, but it might not be ideal for YOUR
306
+ system. Feel free to override this and to make it whatever you wish.
307
+
308
+ _Example:_
309
+ #define UNITY_PRINT_EOL { UNITY_OUTPUT_CHAR('\r'); UNITY_OUTPUT_CHAR('\n') }
310
+
311
+
312
+
313
+ ##### `UNITY_EXCLUDE_DETAILS`
314
+
315
+ This is an option for if you absolutely must squeeze every byte of memory out of
316
+ your system. Unity stores a set of internal scratchpads which are used to pass
317
+ extra detail information around. It's used by systems like CMock in order to
318
+ report which function or argument flagged an error. If you're not using CMock and
319
+ you're not using these details for other things, then you can exclude them.
320
+
321
+ _Example:_
322
+ #define UNITY_EXCLUDE_DETAILS
323
+
324
+
325
+
326
+ ##### `UNITY_EXCLUDE_SETJMP`
327
+
328
+ If your embedded system doesn't support the standard library setjmp, you can
329
+ exclude Unity's reliance on this by using this define. This dropped dependence
330
+ comes at a price, though. You will be unable to use custom helper functions for
331
+ your tests, and you will be unable to use tools like CMock. Very likely, if your
332
+ compiler doesn't support setjmp, you wouldn't have had the memory space for those
333
+ things anyway, though... so this option exists for those situations.
334
+
335
+ _Example:_
336
+ #define UNITY_EXCLUDE_SETJMP
337
+
338
+ ##### `UNITY_OUTPUT_COLOR`
339
+
340
+ If you want to add color using ANSI escape codes you can use this define.
341
+ t
342
+ _Example:_
343
+ #define UNITY_OUTPUT_COLOR
344
+
345
+
346
+
312
347
  ## Getting Into The Guts
313
348
 
314
349
  There will be cases where the options above aren't quite going to get everything
@@ -11,7 +11,7 @@ functional. The core Unity test framework is three files: a single C file and a
11
11
  couple header files. These team up to provide functions and macros to make
12
12
  testing easier.
13
13
 
14
- Unity was designed to be cross platform. It works hard to stick with C standards
14
+ Unity was designed to be cross-platform. It works hard to stick with C standards
15
15
  while still providing support for the many embedded C compilers that bend the
16
16
  rules. Unity has been used with many compilers, including GCC, IAR, Clang,
17
17
  Green Hills, Microchip, and MS Visual Studio. It's not much work to get it to
@@ -100,10 +100,11 @@ find setUp or tearDown when it links, you'll know you need to at least include
100
100
  an empty function for these.
101
101
 
102
102
  The majority of the file will be a series of test functions. Test functions
103
- follow the convention of starting with the word "test" or "spec". You don't HAVE
103
+ follow the convention of starting with the word "test_" or "spec_". You don't HAVE
104
104
  to name them this way, but it makes it clear what functions are tests for other
105
- developers. Test functions take no arguments and return nothing. All test
106
- accounting is handled internally in Unity.
105
+ developers. Also, the automated scripts that come with Unity or Ceedling will default
106
+ to looking for test functions to be prefixed this way. Test functions take no arguments
107
+ and return nothing. All test accounting is handled internally in Unity.
107
108
 
108
109
  Finally, at the bottom of your test file, you will write a `main()` function.
109
110
  This function will call `UNITY_BEGIN()`, then `RUN_TEST` for each test, and
@@ -148,7 +149,7 @@ int main(void) {
148
149
  }
149
150
  ```
150
151
 
151
- It's possible that you will require more customization than this, eventually.
152
+ It's possible that you will need more customization than this, eventually.
152
153
  For that sort of thing, you're going to want to look at the configuration guide.
153
154
  This should be enough to get you going, though.
154
155
 
@@ -3,7 +3,7 @@
3
3
  ## With a Little Help From Our Friends
4
4
 
5
5
  Sometimes what it takes to be a really efficient C programmer is a little non-C.
6
- The Unity project includes a couple Ruby scripts for making your life just a tad
6
+ The Unity project includes a couple of Ruby scripts for making your life just a tad
7
7
  easier. They are completely optional. If you choose to use them, you'll need a
8
8
  copy of Ruby, of course. Just install whatever the latest version is, and it is
9
9
  likely to work. You can find Ruby at [ruby-lang.org](https://ruby-labg.org/).
@@ -105,7 +105,7 @@ UnityTestRunnerGenerator.new.run(testfile, runner_name, options)
105
105
 
106
106
  If you have multiple files to generate in a build script (such as a Rakefile),
107
107
  you might want to instantiate a generator object with your options and call it
108
- to generate each runner thereafter. Like thus:
108
+ to generate each runner afterwards. Like thus:
109
109
 
110
110
  ```Ruby
111
111
  gen = UnityTestRunnerGenerator.new(options)
@@ -124,7 +124,7 @@ demonstrates using a Ruby hash.
124
124
 
125
125
  ##### `:includes`
126
126
 
127
- This option specifies an array of file names to be ?#include?'d at the top of
127
+ This option specifies an array of file names to be `#include`'d at the top of
128
128
  your runner C file. You might use it to reference custom types or anything else
129
129
  universally needed in your generated runners.
130
130
 
@@ -133,11 +133,23 @@ universally needed in your generated runners.
133
133
 
134
134
  Define this option with C code to be executed _before any_ test cases are run.
135
135
 
136
+ Alternatively, if your C compiler supports weak symbols, you can leave this
137
+ option unset and instead provide a `void suiteSetUp(void)` function in your test
138
+ suite. The linker will look for this symbol and fall back to a Unity-provided
139
+ stub if it is not found.
140
+
136
141
 
137
142
  ##### `:suite_teardown`
138
143
 
139
- Define this option with C code to be executed ?after all?test cases have
140
- finished.
144
+ Define this option with C code to be executed _after all_ test cases have
145
+ finished. An integer variable `num_failures` is available for diagnostics.
146
+ The code should end with a `return` statement; the value returned will become
147
+ the exit code of `main`. You can normally just return `num_failures`.
148
+
149
+ Alternatively, if your C compiler supports weak symbols, you can leave this
150
+ option unset and instead provide a `int suiteTearDown(int num_failures)`
151
+ function in your test suite. The linker will look for this symbol and fall
152
+ back to a Unity-provided stub if it is not found.
141
153
 
142
154
 
143
155
  ##### `:enforce_strict_ordering`
@@ -147,6 +159,12 @@ CMock (see CMock documentation). This generates extra variables required for
147
159
  everything to run smoothly. If you provide the same YAML to the generator as
148
160
  used in CMock's configuration, you've already configured the generator properly.
149
161
 
162
+ ##### `:mock_prefix` and `:mock_suffix`
163
+
164
+ Unity automatically generates calls to Init, Verify and Destroy for every file
165
+ included in the main test file that starts with the given mock prefix and ends
166
+ with the given mock suffix, file extension not included. By default, Unity
167
+ assumes a `Mock` prefix and no suffix.
150
168
 
151
169
  ##### `:plugins`
152
170
 
@@ -236,4 +236,12 @@
236
236
  /* #define UNITY_PTR_ATTRIBUTE __attribute__((far)) */
237
237
  /* #define UNITY_PTR_ATTRIBUTE near */
238
238
 
239
+ /* Print execution time of each test when executed in verbose mode
240
+ *
241
+ * Example:
242
+ *
243
+ * TEST - PASS (10 ms)
244
+ */
245
+ /* #define UNITY_INCLUDE_EXEC_TIME */
246
+
239
247
  #endif /* UNITY_CONFIG_H */
@@ -93,6 +93,8 @@ void UnityTestRunner(unityfunction* setup,
93
93
  UnityMalloc_StartTest();
94
94
  UnityPointer_Init();
95
95
 
96
+ UNITY_EXEC_TIME_START();
97
+
96
98
  if (TEST_PROTECT())
97
99
  {
98
100
  setup();
@@ -418,6 +420,8 @@ void UnityConcludeFixtureTest(void)
418
420
  if (UnityFixture.Verbose)
419
421
  {
420
422
  UnityPrint(" PASS");
423
+ UNITY_EXEC_TIME_STOP();
424
+ UNITY_PRINT_EXEC_TIME();
421
425
  UNITY_PRINT_EOL();
422
426
  }
423
427
  }
@@ -78,6 +78,6 @@ int UnityMain(int argc, const char* argv[], void (*runAllTests)(void));
78
78
  #endif
79
79
 
80
80
  /* You must compile with malloc replacement, as defined in unity_fixture_malloc_overrides.h */
81
- void UnityMalloc_MakeMallocFailAfterCount(int count);
81
+ void UnityMalloc_MakeMallocFailAfterCount(int countdown);
82
82
 
83
83
  #endif /* UNITY_FIXTURE_H_ */