ceedling 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (434) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/project_as_gem.yml +13 -0
  4. data/assets/project_with_guts.yml +13 -0
  5. data/bin/ceedling +91 -67
  6. data/docs/CeedlingPacket.md +61 -23
  7. data/docs/CeedlingPacket.odt +0 -0
  8. data/docs/CeedlingPacket.pdf +0 -0
  9. data/docs/ThrowTheSwitchCodingStandard.md +207 -0
  10. data/examples/temp_sensor/test/TestTemperatureCalculator.c +4 -1
  11. data/lib/ceedling/configurator.rb +14 -1
  12. data/lib/ceedling/configurator_builder.rb +2 -1
  13. data/lib/ceedling/configurator_validator.rb +12 -3
  14. data/lib/ceedling/constants.rb +3 -1
  15. data/lib/ceedling/defaults.rb +12 -1
  16. data/lib/ceedling/file_finder.rb +3 -0
  17. data/lib/ceedling/file_path_utils.rb +1 -1
  18. data/lib/ceedling/file_wrapper.rb +4 -4
  19. data/lib/ceedling/generator.rb +12 -3
  20. data/lib/ceedling/preprocessinator_helper.rb +5 -5
  21. data/lib/ceedling/preprocessinator_includes_handler.rb +10 -1
  22. data/lib/ceedling/project_config_manager.rb +1 -2
  23. data/lib/ceedling/project_file_loader.rb +27 -9
  24. data/lib/ceedling/rakefile.rb +6 -6
  25. data/lib/ceedling/release_invoker.rb +21 -6
  26. data/lib/ceedling/rules_release.rake +9 -5
  27. data/lib/ceedling/rules_tests.rake +6 -1
  28. data/lib/ceedling/setupinator.rb +1 -0
  29. data/lib/ceedling/tasks_base.rake +3 -0
  30. data/lib/ceedling/tasks_filesystem.rake +10 -7
  31. data/lib/ceedling/tasks_release.rake +3 -1
  32. data/lib/ceedling/test_includes_extractor.rb +16 -12
  33. data/lib/ceedling/test_invoker.rb +40 -0
  34. data/lib/ceedling/version.rb +3 -3
  35. data/lib/ceedling/version.rb.erb +1 -1
  36. data/plugins/command_hooks/lib/command_hooks.rb +1 -1
  37. data/plugins/fake_function_framework/examples/fff_example/src/bar.h +1 -0
  38. data/plugins/fake_function_framework/examples/fff_example/src/event_processor.c +1 -0
  39. data/plugins/fake_function_framework/lib/fff_mock_generator.rb +4 -0
  40. data/plugins/fake_function_framework/spec/{fff_mock_generator_spec.rb → fff_mock_header_generator_spec.rb} +34 -194
  41. data/plugins/fake_function_framework/spec/fff_mock_source_generator_spec.rb +149 -0
  42. data/plugins/fake_function_framework/spec/header_generator.rb +51 -0
  43. data/plugins/junit_tests_report/lib/junit_tests_report.rb +115 -0
  44. data/plugins/subprojects/README.md +63 -0
  45. data/plugins/subprojects/config/defaults.yml +33 -0
  46. data/plugins/subprojects/lib/subprojects.rb +92 -0
  47. data/plugins/subprojects/subprojects.rake +78 -0
  48. data/spec/preprocessinator_includes_handler_spec.rb +15 -5
  49. data/spec/spec_helper.rb +2 -2
  50. data/spec/spec_system_helper.rb +49 -1
  51. data/spec/system/deployment_spec.rb +29 -0
  52. data/vendor/c_exception/README.md +8 -2
  53. data/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
  54. data/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  55. data/vendor/c_exception/vendor/unity/README.md +19 -10
  56. data/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
  57. data/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
  58. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
  59. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
  60. data/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
  61. data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
  62. data/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
  63. data/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
  64. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
  65. data/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
  66. data/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  67. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  68. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  69. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  70. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  71. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  72. data/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
  73. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  74. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  75. data/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
  76. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
  77. data/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  78. data/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
  79. data/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
  80. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
  81. data/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  82. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  83. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  84. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  85. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  86. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  87. data/vendor/c_exception/vendor/unity/src/unity.c +396 -330
  88. data/vendor/c_exception/vendor/unity/src/unity.h +50 -4
  89. data/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
  90. data/vendor/c_exception/vendor/unity/test/Makefile +17 -17
  91. data/vendor/c_exception/vendor/unity/test/rakefile +63 -3
  92. data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
  93. data/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  94. data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
  95. data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
  96. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  97. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  98. data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  99. data/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
  100. data/vendor/cmock/README.md +10 -1
  101. data/vendor/cmock/config/test_environment.rb +7 -7
  102. data/vendor/cmock/docs/CMock_Summary.md +325 -128
  103. data/vendor/cmock/docs/ThrowTheSwitchCodingStandard.md +207 -0
  104. data/vendor/cmock/examples/make_example/Makefile +2 -2
  105. data/vendor/cmock/examples/temp_sensor/gcc.yml +5 -4
  106. data/vendor/cmock/examples/temp_sensor/iar_v4.yml +5 -4
  107. data/vendor/cmock/examples/temp_sensor/iar_v5.yml +5 -4
  108. data/vendor/cmock/examples/temp_sensor/rakefile.rb +11 -1
  109. data/vendor/cmock/examples/temp_sensor/rakefile_helper.rb +12 -10
  110. data/vendor/cmock/lib/cmock.rb +0 -3
  111. data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +6 -2
  112. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +2 -1
  113. data/vendor/cmock/lib/cmock_header_parser.rb +5 -6
  114. data/vendor/cmock/release/version.info +1 -1
  115. data/vendor/cmock/scripts/create_makefile.rb +4 -2
  116. data/vendor/cmock/scripts/test_summary.rb +17 -9
  117. data/vendor/cmock/src/cmock.c +1 -0
  118. data/vendor/cmock/src/cmock.h +1 -1
  119. data/vendor/cmock/src/cmock_internals.h +14 -1
  120. data/vendor/cmock/test/c/TestCMockC.yml +4 -4
  121. data/vendor/cmock/test/c/TestCMockCDynamic.yml +4 -4
  122. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_FLASH.mac +0 -0
  123. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_RAM.mac +0 -0
  124. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/SAM7_SIM.mac +0 -0
  125. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_FLASH.xcl +0 -0
  126. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/at91SAM7X256_RAM.xcl +0 -0
  127. data/vendor/cmock/{iar → test/iar}/iar_v4/Resource/ioat91sam7x256.ddf +0 -0
  128. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.dep +0 -0
  129. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewd +0 -0
  130. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.ewp +0 -0
  131. data/vendor/cmock/{iar → test/iar}/iar_v4/cmock_demo.eww +0 -0
  132. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X-EK.h +0 -0
  133. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.inc +0 -0
  134. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.rdf +0 -0
  135. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256.tcl +0 -0
  136. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/AT91SAM7X256_inc.h +0 -0
  137. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/ioat91sam7x256.h +0 -0
  138. data/vendor/cmock/{iar → test/iar}/iar_v4/incIAR/lib_AT91SAM7X256.h +0 -0
  139. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.cspy.bat +0 -0
  140. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dbgdt +0 -0
  141. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.dni +0 -0
  142. data/vendor/cmock/{iar → test/iar}/iar_v4/settings/cmock_demo.wsdt +0 -0
  143. data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup.s79 +0 -0
  144. data/vendor/cmock/{iar → test/iar}/iar_v4/srcIAR/Cstartup_SAM7.c +0 -0
  145. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_FLASH.mac +0 -0
  146. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_RAM.mac +0 -0
  147. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/SAM7_SIM.mac +0 -0
  148. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_FLASH.icf +0 -0
  149. data/vendor/cmock/{iar → test/iar}/iar_v5/Resource/at91SAM7X256_RAM.icf +0 -0
  150. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.dep +0 -0
  151. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewd +0 -0
  152. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.ewp +0 -0
  153. data/vendor/cmock/{iar → test/iar}/iar_v5/cmock_demo.eww +0 -0
  154. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X-EK.h +0 -0
  155. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/AT91SAM7X256_inc.h +0 -0
  156. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/lib_AT91SAM7X256.h +0 -0
  157. data/vendor/cmock/{iar → test/iar}/iar_v5/incIAR/project.h +0 -0
  158. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.cspy.bat +0 -0
  159. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dbgdt +0 -0
  160. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.dni +0 -0
  161. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X.wsdt +0 -0
  162. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/BasicInterrupt_SAM7X_FLASH_Debug.jlink +0 -0
  163. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.cspy.bat +0 -0
  164. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dbgdt +0 -0
  165. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.dni +0 -0
  166. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo.wsdt +0 -0
  167. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_Binary.jlink +0 -0
  168. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_FLASH_Debug.jlink +0 -0
  169. data/vendor/cmock/{iar → test/iar}/iar_v5/settings/cmock_demo_RAM_Debug.jlink +0 -0
  170. data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup.s +0 -0
  171. data/vendor/cmock/{iar → test/iar}/iar_v5/srcIAR/Cstartup_SAM7.c +0 -0
  172. data/vendor/cmock/{Rakefile → test/rakefile} +9 -9
  173. data/vendor/cmock/{rakefile_helper.rb → test/rakefile_helper.rb} +13 -13
  174. data/vendor/cmock/test/system/test_compilation/config.yml +4 -4
  175. data/vendor/cmock/test/system/test_interactions/parsing_challenges.yml +2 -0
  176. data/vendor/cmock/{targets → test/targets}/clang_strict.yml +11 -11
  177. data/vendor/cmock/{targets → test/targets}/gcc.yml +9 -9
  178. data/vendor/cmock/{targets → test/targets}/gcc_64.yml +9 -9
  179. data/vendor/cmock/{targets → test/targets}/gcc_tiny.yml +9 -9
  180. data/vendor/cmock/{targets → test/targets}/iar_arm_v4.yml +9 -9
  181. data/vendor/cmock/{targets → test/targets}/iar_arm_v5.yml +10 -10
  182. data/vendor/cmock/test/test_helper.rb +4 -8
  183. data/vendor/cmock/test/unit/cmock_config_test.rb +1 -1
  184. data/vendor/cmock/test/unit/cmock_file_writer_test.rb +1 -1
  185. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +1 -1
  186. data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +1 -1
  187. data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +3 -1
  188. data/vendor/cmock/test/unit/cmock_generator_plugin_cexception_test.rb +1 -1
  189. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +1 -1
  190. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_any_args_test.rb +1 -1
  191. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +1 -1
  192. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +1 -1
  193. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_test.rb +1 -1
  194. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +1 -1
  195. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +1 -1
  196. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +15 -2
  197. data/vendor/cmock/test/unit/cmock_plugin_manager_test.rb +6 -10
  198. data/vendor/cmock/test/unit/cmock_unityhelper_parser_test.rb +1 -1
  199. data/vendor/cmock/vendor/c_exception/README.md +8 -2
  200. data/vendor/cmock/vendor/c_exception/docs/{readme.txt → CException.md} +133 -102
  201. data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  202. data/vendor/cmock/vendor/c_exception/vendor/unity/README.md +19 -10
  203. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_prompt.rb +67 -64
  204. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/colour_reporter.rb +20 -20
  205. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +149 -142
  206. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +234 -232
  207. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parse_output.rb +220 -0
  208. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +108 -120
  209. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/test_file_filter.rb +11 -9
  210. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/type_sanitizer.rb +1 -3
  211. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.py +6 -2
  212. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_test_summary.rb +45 -57
  213. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  214. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  215. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  216. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  217. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  218. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  219. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +22 -17
  220. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  221. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  222. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_2/makefile +16 -17
  223. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile.rb +15 -15
  224. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  225. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_3/readme.txt +4 -10
  226. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/unity_config.h +14 -26
  227. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile.rb +12 -12
  228. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  229. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  230. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  231. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  232. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  233. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  234. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +396 -330
  235. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +50 -4
  236. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -84
  237. data/vendor/cmock/vendor/c_exception/vendor/unity/test/Makefile +17 -17
  238. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile +63 -3
  239. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +108 -105
  240. data/vendor/cmock/vendor/c_exception/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  241. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +0 -6
  242. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +1 -9
  243. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  244. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  245. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  246. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +1338 -151
  247. data/vendor/cmock/vendor/unity/README.md +19 -10
  248. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +67 -64
  249. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +20 -20
  250. data/vendor/cmock/vendor/unity/auto/generate_module.rb +149 -142
  251. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +234 -232
  252. data/vendor/cmock/vendor/unity/auto/parse_output.rb +220 -0
  253. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +108 -120
  254. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +11 -9
  255. data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +1 -3
  256. data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +6 -2
  257. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +45 -57
  258. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  259. data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  260. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  261. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  262. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  263. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  264. data/vendor/cmock/vendor/unity/examples/example_1/makefile +22 -17
  265. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  266. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  267. data/vendor/cmock/vendor/unity/examples/example_2/makefile +16 -17
  268. data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +15 -15
  269. data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  270. data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +4 -10
  271. data/vendor/cmock/vendor/unity/examples/unity_config.h +14 -26
  272. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +12 -12
  273. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  274. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  275. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  276. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  277. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  278. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  279. data/vendor/cmock/vendor/unity/release/version.info +1 -1
  280. data/vendor/cmock/vendor/unity/src/unity.c +396 -330
  281. data/vendor/cmock/vendor/unity/src/unity.h +50 -4
  282. data/vendor/cmock/vendor/unity/src/unity_internals.h +119 -84
  283. data/vendor/cmock/vendor/unity/test/Makefile +17 -17
  284. data/vendor/cmock/vendor/unity/test/rakefile +63 -3
  285. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +108 -105
  286. data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  287. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +0 -6
  288. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +1 -9
  289. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  290. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  291. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  292. data/vendor/cmock/vendor/unity/test/tests/testunity.c +1338 -151
  293. data/vendor/deep_merge/Rakefile +1 -1
  294. data/vendor/unity/README.md +19 -10
  295. data/vendor/unity/auto/colour_prompt.rb +67 -64
  296. data/vendor/unity/auto/colour_reporter.rb +20 -20
  297. data/vendor/unity/auto/generate_module.rb +149 -142
  298. data/vendor/unity/auto/generate_test_runner.rb +234 -232
  299. data/vendor/unity/auto/parse_output.rb +220 -0
  300. data/vendor/unity/auto/stylize_as_junit.rb +108 -120
  301. data/vendor/unity/auto/test_file_filter.rb +11 -9
  302. data/vendor/unity/auto/type_sanitizer.rb +1 -3
  303. data/vendor/unity/auto/unity_test_summary.py +6 -2
  304. data/vendor/unity/auto/unity_test_summary.rb +45 -57
  305. data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +207 -0
  306. data/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  307. data/vendor/unity/docs/UnityAssertionsReference.md +716 -0
  308. data/vendor/unity/docs/UnityConfigurationGuide.md +398 -0
  309. data/vendor/unity/docs/UnityGettingStartedGuide.md +191 -0
  310. data/vendor/unity/docs/UnityHelperScriptsGuide.md +242 -0
  311. data/vendor/unity/examples/example_1/makefile +22 -17
  312. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +1 -1
  313. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +1 -1
  314. data/vendor/unity/examples/example_2/makefile +16 -17
  315. data/vendor/unity/examples/example_3/rakefile.rb +15 -15
  316. data/vendor/unity/examples/example_3/rakefile_helper.rb +93 -100
  317. data/vendor/unity/examples/example_3/readme.txt +4 -10
  318. data/vendor/unity/examples/unity_config.h +14 -26
  319. data/vendor/unity/extras/fixture/rakefile.rb +12 -12
  320. data/vendor/unity/extras/fixture/rakefile_helper.rb +87 -88
  321. data/vendor/unity/extras/fixture/src/unity_fixture.c +15 -8
  322. data/vendor/unity/extras/fixture/src/unity_fixture.h +6 -1
  323. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +3 -0
  324. data/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +1 -0
  325. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +1 -1
  326. data/vendor/unity/release/version.info +1 -1
  327. data/vendor/unity/src/unity.c +396 -330
  328. data/vendor/unity/src/unity.h +50 -4
  329. data/vendor/unity/src/unity_internals.h +119 -84
  330. data/vendor/unity/test/Makefile +17 -17
  331. data/vendor/unity/test/rakefile +63 -3
  332. data/vendor/unity/test/rakefile_helper.rb +108 -105
  333. data/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  334. data/vendor/unity/test/targets/clang_file.yml +0 -6
  335. data/vendor/unity/test/targets/clang_strict.yml +1 -9
  336. data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +2 -0
  337. data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +2 -2
  338. data/vendor/unity/test/tests/test_generate_test_runner.rb +5 -5
  339. data/vendor/unity/test/tests/testunity.c +1338 -151
  340. metadata +102 -157
  341. data/test_graveyard/integration/paths.yml +0 -17
  342. data/test_graveyard/integration/paths_test.rb +0 -80
  343. data/test_graveyard/integration/rake_rules_aux_dependencies_test.rb +0 -75
  344. data/test_graveyard/integration/rake_rules_cmock_test.rb +0 -74
  345. data/test_graveyard/integration/rake_rules_preprocess_test.rb +0 -178
  346. data/test_graveyard/integration/rake_rules_test.rb +0 -268
  347. data/test_graveyard/integration/rake_tasks_test.rb +0 -103
  348. data/test_graveyard/integration_test_helper.rb +0 -34
  349. data/test_graveyard/rakefile_rules.rb +0 -10
  350. data/test_graveyard/rakefile_rules_aux_dependencies.rb +0 -10
  351. data/test_graveyard/rakefile_rules_cmock.rb +0 -10
  352. data/test_graveyard/rakefile_rules_preprocess.rb +0 -10
  353. data/test_graveyard/rakefile_tasks.rb +0 -10
  354. data/test_graveyard/system/file_system_dependencies.yml +0 -20
  355. data/test_graveyard/system/file_system_kitchen_sink.yml +0 -20
  356. data/test_graveyard/system/file_system_mocks.yml +0 -20
  357. data/test_graveyard/system/file_system_preprocess.yml +0 -20
  358. data/test_graveyard/system/file_system_simple.yml +0 -20
  359. data/test_graveyard/system/file_system_test.rb +0 -78
  360. data/test_graveyard/system/mocks/include/a_file.h +0 -2
  361. data/test_graveyard/system/mocks/include/other_stuff.h +0 -2
  362. data/test_graveyard/system/mocks/include/stuff.h +0 -3
  363. data/test_graveyard/system/mocks/source/a_file.c +0 -9
  364. data/test_graveyard/system/mocks/test/test_a_file.c +0 -41
  365. data/test_graveyard/system/mocks/test/test_no_file.c +0 -14
  366. data/test_graveyard/system/project_mocks.yml +0 -43
  367. data/test_graveyard/system/project_mocks_test.rb +0 -38
  368. data/test_graveyard/system/project_simple.yml +0 -36
  369. data/test_graveyard/system/project_simple_test.rb +0 -39
  370. data/test_graveyard/system/rule_mocks_test.rb +0 -44
  371. data/test_graveyard/system/rule_runners_test.rb +0 -44
  372. data/test_graveyard/system/simple/include/other_stuff.h +0 -2
  373. data/test_graveyard/system/simple/include/stuff.h +0 -3
  374. data/test_graveyard/system/simple/source/other_stuff.c +0 -6
  375. data/test_graveyard/system/simple/source/stuff.c +0 -7
  376. data/test_graveyard/system/simple/test/test_other_stuff.c +0 -30
  377. data/test_graveyard/system/simple/test/test_stuff.c +0 -51
  378. data/test_graveyard/system_test_helper.rb +0 -73
  379. data/test_graveyard/test_helper.rb +0 -93
  380. data/test_graveyard/unit/busted/configurator_builder_test.rb +0 -569
  381. data/test_graveyard/unit/busted/configurator_helper_test.rb +0 -234
  382. data/test_graveyard/unit/busted/configurator_test.rb +0 -232
  383. data/test_graveyard/unit/busted/configurator_validator_test.rb +0 -169
  384. data/test_graveyard/unit/busted/deep_merge_fix_test.rb +0 -55
  385. data/test_graveyard/unit/busted/dependinator_test.rb +0 -129
  386. data/test_graveyard/unit/busted/file_finder_helper_test.rb +0 -45
  387. data/test_graveyard/unit/busted/file_finder_test.rb +0 -114
  388. data/test_graveyard/unit/busted/file_path_utils_test.rb +0 -97
  389. data/test_graveyard/unit/busted/file_system_utils_test.rb +0 -21
  390. data/test_graveyard/unit/busted/generator_test.rb +0 -187
  391. data/test_graveyard/unit/busted/generator_test_results_test.rb +0 -129
  392. data/test_graveyard/unit/busted/generator_test_runner_test.rb +0 -475
  393. data/test_graveyard/unit/busted/preprocessinator_file_handler_test.rb +0 -39
  394. data/test_graveyard/unit/busted/preprocessinator_helper_test.rb +0 -156
  395. data/test_graveyard/unit/busted/preprocessinator_includes_handler_test.rb +0 -93
  396. data/test_graveyard/unit/busted/preprocessinator_test.rb +0 -57
  397. data/test_graveyard/unit/busted/project_file_loader_test.rb +0 -142
  398. data/test_graveyard/unit/busted/setupinator_test.rb +0 -45
  399. data/test_graveyard/unit/busted/streaminator_test.rb +0 -49
  400. data/test_graveyard/unit/busted/task_invoker_test.rb +0 -69
  401. data/test_graveyard/unit/busted/test_includes_extractor_test.rb +0 -111
  402. data/test_graveyard/unit/busted/test_invoker_helper_test.rb +0 -62
  403. data/test_graveyard/unit/busted/test_invoker_test.rb +0 -47
  404. data/test_graveyard/unit/busted/tool_executor_helper_test.rb +0 -100
  405. data/test_graveyard/unit/busted/tool_executor_test.rb +0 -351
  406. data/test_graveyard/unit/busted/verbosinator_test.rb +0 -65
  407. data/test_graveyard/unit/preprocessinator_extractor_test.rb +0 -731
  408. data/test_graveyard/unit_test_helper.rb +0 -16
  409. data/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  410. data/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  411. data/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
  412. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  413. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  414. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  415. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  416. data/vendor/cmock/docs/CMock Summary.odt +0 -0
  417. data/vendor/cmock/docs/CMock Summary.pdf +0 -0
  418. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.odt +0 -0
  419. data/vendor/cmock/vendor/c_exception/docs/CExceptionSummary.pdf +0 -0
  420. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/parseOutput.rb +0 -191
  421. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  422. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  423. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  424. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  425. data/vendor/cmock/vendor/unity/auto/parseOutput.rb +0 -191
  426. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  427. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  428. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  429. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  430. data/vendor/unity/auto/parseOutput.rb +0 -191
  431. data/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  432. data/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  433. data/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  434. data/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
@@ -6,10 +6,19 @@ CMock - Mock/stub generator for C
6
6
  Getting Started
7
7
  ================
8
8
 
9
+ If you're using Ceedling, there is no need to install CMock. It will handle it for you.
10
+ For everyone else, the simplest way is to grab it off github. You can also download it
11
+ as a zip if you prefer. The Github method looks something like this:
12
+
9
13
  > git clone --recursive https://github.com/throwtheswitch/cmock.git
10
14
  > cd cmock
11
15
  > bundle install # Ensures you have all RubyGems needed
12
- > bundle exec rake # Run all CMock library tests
16
+
17
+ If you plan to help with the development of CMock (or just want to verify that it can
18
+ perform its self tests on your system) then you can enter the test directory and then
19
+ ask it to test:
20
+
21
+ > rake # Run all CMock self tests
13
22
 
14
23
  API Documentation
15
24
  =================
@@ -2,15 +2,15 @@
2
2
  # CMock Project - Automatic Mock Generation for C
3
3
  # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams
4
4
  # [Released under MIT License. Please refer to license.txt for details]
5
- # ==========================================
5
+ # ==========================================
6
6
 
7
7
  # Setup our load path:
8
- [
9
- 'lib',
10
- 'vendor/behaviors/lib',
11
- 'vendor/hardmock/lib',
12
- 'vendor/unity/auto/',
13
- 'test/system/'
8
+ [
9
+ './lib',
10
+ './vendor/behaviors/lib',
11
+ './vendor/hardmock/lib',
12
+ './vendor/unity/auto/',
13
+ './test/system/'
14
14
  ].each do |dir|
15
15
  $LOAD_PATH.unshift( File.join( File.expand_path(File.dirname(__FILE__) + "/../"), dir) )
16
16
  end
@@ -1,15 +1,16 @@
1
- [All code is copyright © 2007-2014 Cmock Project
2
- by Mike Karlesky, Mark VanderVoord, and Greg Williams.
1
+ CMock: A Summary
2
+ ================
3
3
 
4
- This Documentation Is Released Under a Creative Commons 3.0
5
- Attribution Share-Alike License]
4
+ *[ThrowTheSwitch.org](http://throwtheswitch.org)*
6
5
 
6
+ *This documentation is released under a Creative Commons 3.0 Attribution Share-Alike License*
7
7
 
8
- What the What?
9
- ==============
8
+
9
+ What Exactly Are We Talking About Here?
10
+ ---------------------------------------
10
11
 
11
12
  CMock is a nice little tool which takes your header files and creates
12
- a Mock interface for it so that you can more easily Unit test modules
13
+ a Mock interface for it so that you can more easily unit test modules
13
14
  that touch other modules. For each function prototype in your
14
15
  header, like this one:
15
16
 
@@ -60,7 +61,29 @@ call DoesSomething enough, or too much, or with the wrong arguments,
60
61
  or in the wrong order.
61
62
 
62
63
  CMock is based on Unity, which it uses for all internal testing.
63
- It uses Ruby to do all the main work (versions 1.8.6 through 1.9.2).
64
+ It uses Ruby to do all the main work (versions 2.0.0 and above).
65
+
66
+
67
+ Installing
68
+ ==========
69
+
70
+ The first thing you need to do to install CMock is to get yourself
71
+ a copy of Ruby. If you're on linux or osx, you probably already
72
+ have it. You can prove it by typing the following:
73
+
74
+ ruby --version
75
+
76
+
77
+ If it replied in a way that implies ignorance, then you're going to
78
+ need to install it. You can go to [ruby-lang](https://ruby-lang.org)
79
+ to get the latest version. You're also going to need to do that if it
80
+ replied with a version that is older than 2.0.0. Go ahead. We'll wait.
81
+
82
+ Once you have Ruby, you have three options:
83
+
84
+ * Clone the latest [CMock repo on github](https://github.com/ThrowTheSwitch/CMock/)
85
+ * Download the latest [CMock zip from github](https://github.com/ThrowTheSwitch/CMock/)
86
+ * Install Ceedling (which has it built in!) through your commandline using `gem install ceedling`.
64
87
 
65
88
 
66
89
  Generated Mock Module Summary
@@ -76,7 +99,11 @@ Expect:
76
99
  -------
77
100
 
78
101
  Your basic staple Expects which will be used for most of your day
79
- to day CMock work.
102
+ to day CMock work. By calling this, you are telling CMock that you
103
+ expect that function to be called during your test. It also specifies
104
+ which arguments you expect it to be called with, and what return
105
+ value you want returned when that happens. You can call this function
106
+ multiple times back to back in order to queue up multiple calls.
80
107
 
81
108
  * `void func(void)` => `void func_Expect(void)`
82
109
  * `void func(params)` => `void func_Expect(expected_params)`
@@ -84,10 +111,30 @@ to day CMock work.
84
111
  * `retval func(params)` => `void func_ExpectAndReturn(expected_params, retval_to_return)`
85
112
 
86
113
 
114
+ ExpectAnyArgs:
115
+ --------------
116
+
117
+ This behaves just like the Expects calls, except that it doesn't really
118
+ care what the arguments are that the mock gets called with. It still counts
119
+ the number of times the mock is called and it still handles return values
120
+ if there are some.
121
+
122
+ * `void func(void)` => `void func_ExpectAnyArgs(void)`
123
+ * `void func(params)` => `void func_ExpectAnyArgs(void)`
124
+ * `retval func(void)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)`
125
+ * `retval func(params)` => `void func_ExpectAnyArgsAndReturn(retval_to_return)`
126
+
127
+
87
128
  Array:
88
129
  ------
89
130
 
90
- An ExpectWithArray will check as many elements as you specify.
131
+ An ExpectWithArray is another variant of Expect. Like expect, it cares about
132
+ the number of times a mock is called, the arguments it is called with, and the
133
+ values it is to return. This variant has another feature, though. For anything
134
+ that resembles a pointer or array, it breaks the argument into TWO arguments.
135
+ The first is the original pointer. The second specify the number of elements
136
+ it is to verify of that array. If you specify 1, it'll check one object. If 2,
137
+ it'll assume your pointer is pointing at the first of two elements in an array.
91
138
  If you specify zero elements, it will check just the pointer if
92
139
  `:smart` mode is configured or fail if `:compare_data` is set.
93
140
 
@@ -97,14 +144,59 @@ If you specify zero elements, it will check just the pointer if
97
144
  * `retval func(other, ptr* param)` => `void func_ExpectWithArrayAndReturn(other, ptr* param, int param_depth, retval_to_return)`
98
145
 
99
146
 
147
+ Ignore:
148
+ -------
149
+
150
+ Maybe you don't care about the number of times a particular function is called or
151
+ the actual arguments it is called with. In that case, you want to use Ignore. Ignore
152
+ only needs to be called once per test. It will then ignore any further calls to that
153
+ particular mock. The IgnoreAndReturn works similarly, except that it has the added
154
+ benefit of knowing what to return when that call happens. If the mock is called more
155
+ times than IgnoreAndReturn was called, it will keep returning the last value without
156
+ complaint. If it's called less times, it will also ignore that. You SAID you didn't
157
+ care how many times it was called, right?
158
+
159
+ * `void func(void)` => `void func_Ignore(void)`
160
+ * `void func(params)` => `void func_Ignore(void)`
161
+ * `retval func(void)` => `void func_IgnoreAndReturn(retval_to_return)`
162
+ * `retval func(params)` => `void func_IgnoreAndReturn(retval_to_return)`
163
+
164
+
165
+ Ignore Arg:
166
+ ------------
167
+
168
+ Maybe you overall want to use Expect and its similar variations, but you don't care
169
+ what is passed to a particular argument. This is particularly useful when that argument
170
+ is a pointer to a value that is supposed to be filled in by the function. You don't want
171
+ to use ExpectAnyArgs, because you still care about the other arguments. Instead, before
172
+ any of your Expect calls are made, you can call this function. It tells CMock to ignore
173
+ a particular argument for the rest of this test, for this mock function.
174
+
175
+ * `void func(params)` => `void func_IgnoreArg_paramName(void)`
176
+
177
+
178
+ ReturnThruPtr:
179
+ --------------
180
+
181
+ Another option which operates on a particular argument of a function is the ReturnThruPtr
182
+ plugin. For every argument that resembles a pointer or reference, CMock generates an
183
+ instance of this function. Just as the AndReturn functions support injecting one or more
184
+ return values into a queue, this function lets you specify one or more return values which
185
+ are queued up and copied into the space being pointed at each time the mock is called.
186
+
187
+ * `void func(param1)` => `void func_ReturnThruPtr_paramName(val_to_return)`
188
+ * => `void func_ReturnArrayThruPtr_paramName(cal_to_return, len)`
189
+ * => `void func_ReturnMemThruPtr_paramName(val_to_return, size)`
190
+
191
+
100
192
  Callback:
101
193
  ---------
102
194
 
103
- As soon as you stub a callback in a test, it will call the callback
104
- whenever the mock is encountered and return the retval returned
105
- from the callback (if any) instead of performing the usual expect
106
- checks. It can be configured to check the arguments first (like
107
- expects) or just jump directly to the callback.
195
+ If all those other options don't work, and you really need to do something custom, you
196
+ still have a choice. As soon as you stub a callback in a test, it will call the callback
197
+ whenever the mock is encountered and return the retval returned from the callback (if any)
198
+ instead of performing the usual expect checks. It can be configured to check the arguments
199
+ first (like expects) or just jump directly to the callback.
108
200
 
109
201
  * `void func(void)` => `void func_StubWithCallback(CMOCK_func_CALLBACK callback)`
110
202
  where `CMOCK_func_CALLBACK` looks like: `void func(int NumCalls)`
@@ -119,10 +211,9 @@ where `CMOCK_func_CALLBACK` looks like: `retval func(params, int NumCalls)`
119
211
  Cexception:
120
212
  -----------
121
213
 
122
- If you are using Cexception for error handling, you can use this
123
- to throw errors from inside mocks. Like Expects, it remembers
124
- which call was supposed to throw the error, and it still checks
125
- parameters.
214
+ Finally, if you are using Cexception for error handling, you can use this to throw errors
215
+ from inside mocks. Like Expects, it remembers which call was supposed to throw the error,
216
+ and it still checks parameters first.
126
217
 
127
218
  * `void func(void)` => `void func_ExpectAndThrow(value_to_throw)`
128
219
  * `void func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)`
@@ -130,43 +221,6 @@ parameters.
130
221
  * `retval func(params)` => `void func_ExpectAndThrow(expected_params, value_to_throw)`
131
222
 
132
223
 
133
- Ignore:
134
- -------
135
-
136
- This plugin supports two modes. You can use it to force CMock to
137
- ignore calls to specific functions or to just ignore the arguments
138
- passed to those functions. Either way you can specify multiple
139
- returns or a single value to always return, whichever you prefer.
140
-
141
- * `void func(void)` => `void func_Ignore(void)`
142
- * `void func(params)` => `void func_Ignore(void)`
143
- * `retval func(void)` => `void func_IgnoreAndReturn(retval_to_return)`
144
- * `retval func(params)` => `void func_IgnoreAndReturn(retval_to_return)`
145
-
146
-
147
- Ignore Args:
148
- ------------
149
-
150
- This plugin adds the ability to specify specifc arguments to ignore
151
- for a function, instead of ignoring all the arguments or the entire
152
- function call, as the Ignore plugin supports. This will create a function
153
- for each argument and each function.
154
-
155
- * `void func(params)` => `void func_IgnoreArg_paramName(void)`
156
-
157
-
158
- ReturnThruPtr:
159
- --------------
160
-
161
- This plugin adds a number of options for returning data through arguments
162
- that are pointers. This is fled separately from the Expect/Ignore call, so
163
- you will want to issue one of those calls each time as well. This will only
164
- create an extra call for arguments that are pointers. It will create one per
165
- pointer argument.
166
-
167
- * `void func(param1)` => `void func_ReturnThruPtr_paramName(val_to_return)`
168
- * => `void func_ReturnArrayThruPtr_paramName(cal_to_return, len)`
169
- * => `void func_ReturnMemThruPtr_paramName(val_to_return, size)`
170
224
 
171
225
  Running CMock
172
226
  =============
@@ -174,10 +228,11 @@ Running CMock
174
228
  CMock is a Ruby script and class. You can therefore use it directly
175
229
  from the command line, or include it in your own scripts or rakefiles.
176
230
 
231
+
177
232
  Mocking from the Command Line
178
233
  -----------------------------
179
234
 
180
- After unpacking CMock, you will find CMock.rb in the 'lib' directory.
235
+ After unpacking CMock, you will find cmock.rb in the 'lib' directory.
181
236
  This is the file that you want to run. It takes a list of header files
182
237
  to be mocked, as well as an optional yaml file for a more detailed
183
238
  configuration (see config options below).
@@ -191,6 +246,7 @@ And this will create two mocks using the default configuration:
191
246
 
192
247
  ruby cmock.rb ../mocking/stuff/is/fun.h ../try/it/yourself.h
193
248
 
249
+
194
250
  Mocking From Scripts or Rake
195
251
  ----------------------------
196
252
 
@@ -201,6 +257,7 @@ three ways.
201
257
 
202
258
  You may specify nothing, allowing it to run with default settings:
203
259
 
260
+ require 'cmock.rb'
204
261
  cmock = CMock.new
205
262
 
206
263
  You may specify a YAML file containing the configuration options
@@ -212,7 +269,9 @@ You may specify the options explicitly:
212
269
 
213
270
  cmock = Cmock.new(:plugins => [:cexception, :ignore], :mock_path => 'my/mocks/')
214
271
 
272
+
215
273
  Config Options:
274
+ ---------------
216
275
 
217
276
  The following configuration options can be specified in the
218
277
  yaml file or directly when instantiating.
@@ -229,81 +288,141 @@ Defined in the yaml file, they look more like this:
229
288
  - __intrinsic
230
289
  :when_ptr: :compare
231
290
 
291
+ In all cases, you can just include the things that you want to override
292
+ from the defaults. We've tried to specify what the defaults are below.
232
293
 
233
294
  * `:attributes`:
234
295
  These are attributes that CMock should ignore for you for testing
235
296
  purposes. Custom compiler extensions and externs are handy things to
236
- put here.
297
+ put here. If your compiler is choking on some extended syntax, this
298
+ is often a good place to look.
299
+
300
+ * defaults: ['__ramfunc', '__irq', '__fiq', 'register', 'extern']
301
+ * **note:** this option will reinsert these attributes onto the mock's calls.
302
+ If that isn't what you are looking for, check out :strippables.
303
+
304
+ * `:c_calling_conventions`:
305
+ Similarly, CMock may need to understand which C calling conventions
306
+ might show up in your codebase. If it encounters something it doesn't
307
+ recognize, it's not going to mock it. We have the most common covered,
308
+ but there are many compilers out there, and therefore many other options.
309
+
310
+ * defaults: ['__stdcall', '__cdecl', '__fastcall']
311
+ * **note:** this option will reinsert these attributes onto the mock's calls.
312
+ If that isn't what you are looking for, check out :strippables.
237
313
 
238
314
  * `:callback_after_arg_check`:
239
- Tell `:callback` plugin to do the normal argument checking before it
240
- calls the callback function. This defaults to false, where the
241
- callback function is called instead of the argument verification.
315
+ Tell `:callback` plugin to do the normal argument checking **before** it
316
+ calls the callback function by setting this to true. WHen false, the
317
+ callback function is called **instead** of the argument verification.
318
+
319
+ * default: false
242
320
 
243
321
  * `:callback_include_count`:
244
322
  Tell `:callback` plugin to include an extra parameter to specify the
245
323
  number of times the callback has been called. If set to false, the
246
324
  callback has the same interface as the mocked function. This can be
247
325
  handy when you're wanting to use callback as a stub.
326
+
327
+ * default: true
248
328
 
249
329
  * `:cexception_include`:
250
- Tell `:cexception` plugin where to find CException.h... only need to
251
- define if it's not in your build path already.
330
+ Tell `:cexception` plugin where to find CException.h... You only need to
331
+ define this if it's not in your build path already... which it usually
332
+ will be for the purpose of your builds.
333
+
334
+ * default: *nil*
252
335
 
253
336
  * `:enforce_strict_ordering`:
254
337
  CMock always enforces the order that you call a particular function,
255
338
  so if you expect GrabNabber(int size) to be called three times, it
256
339
  will verify that the sizes are in the order you specified. You might
257
- also want to make sure that all different functions are called in a
340
+ *also* want to make sure that all different functions are called in a
258
341
  particular order. If so, set this to true.
342
+
343
+ * default: false
259
344
 
260
345
  * `:framework`:
261
346
  Currently the only option is `:unity.` Eventually if we support other
262
347
  unity test frameworks (or if you write one for us), they'll get added
263
348
  here.
349
+
350
+ : default: :unity
264
351
 
265
352
  * `:includes`:
266
353
  An array of additional include files which should be added to the
267
354
  mocks. Useful for global types and definitions used in your project.
268
355
  There are more specific versions if you care WHERE in the mock files
269
- the includes get placed. You can define any or all of
270
- `:includes_h_pre_orig_header,` `:includes_h_post_orig_header, `
271
- `:includes_c_pre_header,` `:includes_c_post_header
356
+ the includes get placed. You can define any or all of these options.
357
+
358
+ * `:includes`
359
+ * `:includes_h_pre_orig_header`
360
+ * `:includes_h_post_orig_header`
361
+ * `:includes_c_pre_header`
362
+ * `:includes_c_post_header`
363
+ * default: nil #for all 5 options
272
364
 
273
365
  * `:memcmp_if_unknown`:
274
- This is true by default. When true, CMock will just do a memory
275
- comparison of types that it doesn't recognize (not standard types, not
276
- in `:treat_as,` and not in a unity helper). If you instead want it to
277
- throw an error, just set this to false.
278
-
366
+ C developers create a lot of types, either through typedef or preprocessor
367
+ macros. CMock isn't going to automatically know what you were thinking all
368
+ the time (though it tries its best). If it comes across a type it doesn't
369
+ recognize, you have a choice on how you want it to handle it. It can either
370
+ perform a raw memory comparison and report any differences, or it can fail
371
+ with a meaningful message. Either way, this feature will only happen after
372
+ all other mechanisms have failed (The thing encountered isn't a standard
373
+ type. It isn't in the :treat_as list. It isn't in a custom unity_helper).
374
+
375
+ * default: true
376
+
279
377
  * `:mock_path`:
280
378
  The directory where you would like the mock files generated to be
281
379
  placed.
380
+
381
+ * default: mocks
282
382
 
283
383
  * `:mock_prefix`:
284
- The prefix to append to your mock files. Defaults to “Mock”, so a file
285
- “USART.h” will get a mock called “MockUSART.c
384
+ The prefix to prepend to your mock files. For example, if it's “Mock”, a file
385
+ “USART.h” will get a mock called “MockUSART.c”. This CAN be used with a suffix
386
+ at the same time.
387
+
388
+ * default: Mock
286
389
 
287
390
  * `:mock_suffix`:
288
- The suffix to append to your mock files. Defaults to “”.
289
-
290
- * `:weak`:
291
- When set to some value, the generated mocks are defined as weak symbols using the configured format. Defaults to ''.
292
- Set to '__attribute ((weak))' for weak mocks when using GCC. Set to any non-empty string for weak mocks when using IAR.
293
-
294
- * `:subdir`:
295
- Relative subdir for your mocks. Set this to e.g. "sys" in order to
296
- create mock for `sys/types.h` in `:mock_path`/sys/
391
+ The suffix to append to your mock files. For example, it it's "_Mock", a file
392
+ "USART.h" will get a mock called "USART_Mock.h". This CAN be used with a prefix
393
+ at the same time.
394
+
395
+ * default: ""
297
396
 
298
397
  * `:plugins`:
299
- An array of which plugins to enable. 'expect' is always active. Also
300
- available currently are `:ignore,` `:ignore_arg,` `:array,`
301
- `:cexception,` `:callback,` and `:return_thru_ptr`
398
+ An array of which plugins to enable. ':expect' is always active. Also
399
+ available currently:
400
+
401
+ * `:ignore`
402
+ * `:ignore_arg`
403
+ * `:expect_any_args`
404
+ * `:array`
405
+ * `:cexception`
406
+ * `:callback`
407
+ * `:return_thru_ptr`
302
408
 
303
409
  * `:strippables`:
304
- An array containing a list of items to remove from the mocked header.
305
- For example, use `:strippables: ['(?:functionName\s*\(+.*?\)+)']`
306
- to prevent a function from being mocked.
410
+ An array containing a list of items to remove from the header
411
+ before deciding what should be mocked. This can be something simple
412
+ like a compiler extension CMock wouldn't recognize, or could be a
413
+ regex to reject certain function name patterns. This is a great way to
414
+ get rid of compiler extensions when your test compiler doesn't support
415
+ them. For example, use `:strippables: ['(?:functionName\s*\(+.*?\)+)']`
416
+ to prevent a function `functionName` from being mocked. By default, it
417
+ is ignoring all gcc attribute extensions.
418
+
419
+ * default: ['(?:__attribute__\s*\(+.*?\)+)']
420
+
421
+ * `:subdir`:
422
+ This is a relative subdirectory for your mocks. Set this to e.g. "sys" in
423
+ order to create a mock for `sys/types.h` in `(:mock_path)/sys/`.
424
+
425
+ * default: ""
307
426
 
308
427
  * `:treat_as`:
309
428
  The `:treat_as` list is a shortcut for when you have created typedefs
@@ -313,36 +432,105 @@ Defined in the yaml file, they look more like this:
313
432
  did that one for you). Maybe you have a type that is a pointer to an
314
433
  array of unsigned characters? No problem, just add 'UINT8_T*' =>
315
434
  'HEX8*'
435
+
436
+ * NOTE: unlike the other options, your specifications MERGE with the
437
+ default list. Therefore, if you want to override something, you must
438
+ reassign it to something else (or to *nil* if you don't want it)
439
+
440
+ * default:
441
+ * 'int': 'INT'
442
+ * 'char': 'INT8'
443
+ * 'short': 'INT16'
444
+ * 'long': 'INT'
445
+ * 'int8': 'INT8'
446
+ * 'int16': 'INT16'
447
+ * 'int32': 'INT'
448
+ * 'int8_t': 'INT8'
449
+ * 'int16_t': 'INT16'
450
+ * 'int32_t': 'INT'
451
+ * 'INT8_T': 'INT8'
452
+ * 'INT16_T': 'INT16'
453
+ * 'INT32_T': 'INT'
454
+ * 'bool': 'INT'
455
+ * 'bool_t': 'INT'
456
+ * 'BOOL': 'INT'
457
+ * 'BOOL_T': 'INT'
458
+ * 'unsigned int': 'HEX32'
459
+ * 'unsigned long': 'HEX32'
460
+ * 'uint32': 'HEX32'
461
+ * 'uint32_t': 'HEX32'
462
+ * 'UINT32': 'HEX32'
463
+ * 'UINT32_T': 'HEX32'
464
+ * 'void*': 'HEX8_ARRAY'
465
+ * 'unsigned short': 'HEX16'
466
+ * 'uint16': 'HEX16'
467
+ * 'uint16_t': 'HEX16'
468
+ * 'UINT16': 'HEX16'
469
+ * 'UINT16_T': 'HEX16'
470
+ * 'unsigned char': 'HEX8'
471
+ * 'uint8': 'HEX8'
472
+ * 'uint8_t': 'HEX8'
473
+ * 'UINT8': 'HEX8'
474
+ * 'UINT8_T': 'HEX8'
475
+ * 'char*': 'STRING'
476
+ * 'pCHAR': 'STRING'
477
+ * 'cstring': 'STRING'
478
+ * 'CSTRING': 'STRING'
479
+ * 'float': 'FLOAT'
480
+ * 'double': 'FLOAT'
316
481
 
317
482
  * `:treat_as_void`:
318
483
  We've seen "fun" legacy systems typedef 'void' with a custom type,
319
484
  like MY_VOID. Add any instances of those to this list to help CMock
320
485
  understand how to deal with your code.
486
+
487
+ * default: []
321
488
 
322
489
  * `:treat_externs`:
323
- Set to `:include` to mock externed functions or `:exclude` to ignore
324
- them (the default).
490
+ This specifies how you want CMock to handle functions that have been
491
+ marked as extern in the header file. Should it mock them?
492
+
493
+ * `:include` will mock externed functions
494
+ * `:exclude` will ignore externed functions (default).
325
495
 
326
496
  * `:unity_helper_path`:
327
497
  If you have created a header with your own extensions to unity to
328
498
  handle your own types, you can set this argument to that path. CMock
329
499
  will then automagically pull in your helpers and use them. The only
330
500
  trick is that you make sure you follow the naming convention:
331
- UNITY_TEST_ASSERT_EQUAL_YourType
501
+ `UNITY_TEST_ASSERT_EQUAL_YourType`. If it finds macros of the right
502
+ shape that match that pattern, it'll use them.
503
+
504
+ * default: []
332
505
 
333
506
  * `:verbosity`:
334
- 0 for errors only. 1 for errors and warnings. 2 for normal. 3 for
335
- verbose
507
+ How loud shoudl CMock be?
508
+
509
+ * 0 for errors only
510
+ * 1 for errors and warnings
511
+ * 2 for normal (default)
512
+ * 3 for verbose
513
+
514
+ * `:weak`:
515
+ When set this to some value, the generated mocks are defined as weak
516
+ symbols using the configured format. This allows them to be overridden
517
+ in particular tests.
518
+
519
+ * Set to '__attribute ((weak))' for weak mocks when using GCC.
520
+ * Set to any non-empty string for weak mocks when using IAR.
521
+ * default: ""
336
522
 
337
523
  * `:when_no_prototypes`:
338
524
  When you give CMock a header file and ask it to create a mock out of
339
525
  it, it usually contains function prototypes (otherwise what was the
340
526
  point?). You can control what happens when this isn't true. You can
341
- set this to `:warn,` `:ignore,` or `:error
527
+ set this to `:warn,` `:ignore,` or `:error`
528
+
529
+ * default: :warn
342
530
 
343
531
  * `:when_ptr`:
344
532
  You can customize how CMock deals with pointers (c strings result in
345
- string comparisons... we're talking about other pointers here). Your
533
+ string comparisons... we're talking about **other** pointers here). Your
346
534
  options are `:compare_ptr` to just verify the pointers are the same,
347
535
  `:compare_data` or `:smart` to verify that the data is the same.
348
536
  `:compare_data` and `:smart` behaviors will change slightly based on
@@ -350,42 +538,51 @@ Defined in the yaml file, they look more like this:
350
538
  single element of what is being pointed to. So if you have a pointer
351
539
  to a struct called ORGAN_T, it will compare one ORGAN_T (whatever that
352
540
  is).
541
+
542
+ * default: :smart
353
543
 
354
544
 
355
545
  Compiled Options:
356
546
  -----------------
357
547
 
358
548
  A number of #defines also exist for customizing the cmock experience.
359
-
360
- CMOCK_MEM_STATIC or CMOCK_MEM_DYNAMIC
361
-
362
- Define one of these to determine if you want to dynamically add
363
- memory during tests as required from the heap. If static, you
364
- can control the total footprint of Cmock. If dynamic, you will
365
- need to make sure you make some heap space available for Cmock.
366
-
367
- CMOCK_MEM_SIZE
368
-
369
- In static mode this is the total amount of memory you are allocating
370
- to Cmock. In Dynamic mode this is the size of each chunk allocated
371
- at once (larger numbers grab more memory but require less mallocs).
372
-
373
- CMOCK_MEM_ALIGN
374
-
375
- The way to align your data to. Not everything is as flexible as
376
- a PC, as most embedded designers know. This defaults to 2, meaning
377
- align to the closest 2^2 -> 4 bytes (32 bits). You can turn off alignment
378
- by setting 0, force alignment to the closest uint16 with 1 or even
379
- to the closest uint64 with 3.
380
-
381
- CMOCK_MEM_PTR_AS_INT
382
-
383
- This is used internally to hold pointers... it needs to be big
384
- enough. On most processors a pointer is the same as an unsigned
385
- long... but maybe that's not true for yours?
386
-
387
- CMOCK_MEM_INDEX_TYPE
388
-
389
- This needs to be something big enough to point anywhere in Cmock's
390
- memory space... usually it's an unsigned int.
549
+ Feel free to pass these into your compiler or whatever is most
550
+ convenient. CMock will otherwise do its best to guess what you want
551
+ based on other settings, particularly Unity's settings.
552
+
553
+ * `CMOCK_MEM_STATIC` or `CMOCK_MEM_DYNAMIC`
554
+ Define one of these to determine if you want to dynamically add
555
+ memory during tests as required from the heap. If static, you
556
+ can control the total footprint of Cmock. If dynamic, you will
557
+ need to make sure you make some heap space available for Cmock.
558
+
559
+ * `CMOCK_MEM_SIZE`
560
+ In static mode this is the total amount of memory you are allocating
561
+ to Cmock. In Dynamic mode this is the size of each chunk allocated
562
+ at once (larger numbers grab more memory but require less mallocs).
563
+
564
+ * `CMOCK_MEM_ALIGN`
565
+ The way to align your data to. Not everything is as flexible as
566
+ a PC, as most embedded designers know. This defaults to 2, meaning
567
+ align to the closest 2^2 -> 4 bytes (32 bits). You can turn off alignment
568
+ by setting 0, force alignment to the closest uint16 with 1 or even
569
+ to the closest uint64 with 3.
570
+
571
+ * `CMOCK_MEM_PTR_AS_INT`
572
+ This is used internally to hold pointers... it needs to be big
573
+ enough. On most processors a pointer is the same as an unsigned
574
+ long... but maybe that's not true for yours?
575
+
576
+ * `CMOCK_MEM_INDEX_TYPE`
577
+ This needs to be something big enough to point anywhere in Cmock's
578
+ memory space... usually it's an unsigned int.
579
+
580
+ Examples
581
+ ========
582
+
583
+ You can look in the examples directory for a couple of examples on how
584
+ you might tool CMock into your build process. You may also want to consider
585
+ using [Ceedling](https://throwtheswitch.org/Ceedling). Please note that
586
+ these examples are meant to show how the build process works. They have
587
+ failing tests ON PURPOSE to show what that would look like. Don't be alarmed. ;)
391
588