ceedling 0.20.3 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (407) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/Gemfile.lock +1 -0
  4. data/Rakefile +1 -0
  5. data/bin/ceedling +79 -26
  6. data/lib/ceedling/configurator_plugins.rb +0 -18
  7. data/lib/ceedling/rules_cmock.rake +1 -1
  8. data/lib/ceedling/tasks_base.rake +5 -1
  9. data/lib/ceedling/tasks_tests.rake +12 -9
  10. data/lib/ceedling/version.rb +1 -1
  11. data/lib/ceedling/version.rb.erb +1 -1
  12. data/plugins/fake_function_framework/README.md +250 -0
  13. data/plugins/fake_function_framework/Rakefile +19 -0
  14. data/plugins/fake_function_framework/examples/fff_example/project.yml +71 -0
  15. data/plugins/fake_function_framework/examples/fff_example/rakefile.rb +7 -0
  16. data/plugins/fake_function_framework/examples/fff_example/src/bar.c +1 -0
  17. data/plugins/fake_function_framework/examples/fff_example/src/bar.h +13 -0
  18. data/plugins/fake_function_framework/examples/fff_example/src/custom_types.h +6 -0
  19. data/plugins/fake_function_framework/examples/fff_example/src/display.c +7 -0
  20. data/plugins/fake_function_framework/examples/fff_example/src/display.h +16 -0
  21. data/plugins/fake_function_framework/examples/fff_example/src/event_processor.c +92 -0
  22. data/plugins/fake_function_framework/examples/fff_example/src/event_processor.h +11 -0
  23. data/plugins/fake_function_framework/examples/fff_example/src/foo.c +16 -0
  24. data/plugins/fake_function_framework/examples/fff_example/src/foo.h +8 -0
  25. data/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.c +1 -0
  26. data/plugins/fake_function_framework/examples/fff_example/src/subfolder/zzz.h +6 -0
  27. data/plugins/fake_function_framework/examples/fff_example/test/test_event_processor.c +155 -0
  28. data/plugins/fake_function_framework/examples/fff_example/test/test_foo.c +47 -0
  29. data/plugins/fake_function_framework/lib/fake_function_framework.rb +87 -0
  30. data/plugins/fake_function_framework/lib/fff_mock_generator.rb +159 -0
  31. data/plugins/fake_function_framework/spec/fff_mock_generator_spec.rb +464 -0
  32. data/plugins/fake_function_framework/spec/spec_helper.rb +96 -0
  33. data/plugins/fake_function_framework/src/fff_unity_helper.h +33 -0
  34. data/plugins/fake_function_framework/vendor/fff/LICENSE +25 -0
  35. data/plugins/fake_function_framework/vendor/fff/Makefile +10 -0
  36. data/plugins/fake_function_framework/vendor/fff/README.md +454 -0
  37. data/plugins/fake_function_framework/vendor/fff/buildandtest +15 -0
  38. data/plugins/fake_function_framework/vendor/fff/examples/Makefile +7 -0
  39. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/Makefile +64 -0
  40. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.c +24 -0
  41. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.h +11 -0
  42. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.test.cpp +50 -0
  43. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/driver.test.fff.cpp +62 -0
  44. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/hardware_abstraction.h +15 -0
  45. data/plugins/fake_function_framework/vendor/fff/examples/driver_testing/registers.h +13 -0
  46. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/DISPLAY.h +17 -0
  47. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/Kata.txt +25 -0
  48. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/Makefile +67 -0
  49. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/SYSTEM.h +21 -0
  50. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI.c +48 -0
  51. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI.h +12 -0
  52. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI_test_ansic.c +183 -0
  53. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/UI_test_cpp.cpp +136 -0
  54. data/plugins/fake_function_framework/vendor/fff/examples/embedded_ui/test_suite_template.c +34 -0
  55. data/plugins/fake_function_framework/vendor/fff/fakegen.rb +420 -0
  56. data/plugins/fake_function_framework/vendor/fff/fff.h +5112 -0
  57. data/plugins/fake_function_framework/vendor/fff/gtest/Makefile +22 -0
  58. data/plugins/fake_function_framework/vendor/fff/gtest/gtest-all.cc +9118 -0
  59. data/plugins/fake_function_framework/vendor/fff/gtest/gtest-main.cc +6 -0
  60. data/plugins/fake_function_framework/vendor/fff/gtest/gtest.h +19537 -0
  61. data/plugins/fake_function_framework/vendor/fff/test/Makefile +81 -0
  62. data/plugins/fake_function_framework/vendor/fff/test/c_test_framework.h +15 -0
  63. data/plugins/fake_function_framework/vendor/fff/test/fff_test_c.c +108 -0
  64. data/plugins/fake_function_framework/vendor/fff/test/fff_test_cpp.cpp +45 -0
  65. data/plugins/fake_function_framework/vendor/fff/test/fff_test_global_c.c +76 -0
  66. data/plugins/fake_function_framework/vendor/fff/test/fff_test_global_cpp.cpp +23 -0
  67. data/plugins/fake_function_framework/vendor/fff/test/global_fakes.c +13 -0
  68. data/plugins/fake_function_framework/vendor/fff/test/global_fakes.h +37 -0
  69. data/plugins/fake_function_framework/vendor/fff/test/test_cases.include +276 -0
  70. data/plugins/gcov/README.md +9 -0
  71. data/plugins/gcov/{template.erb → assets/template.erb} +1 -1
  72. data/plugins/gcov/{defaults.yml → config/defaults.yml} +10 -1
  73. data/plugins/gcov/gcov.rake +20 -8
  74. data/plugins/gcov/{gcov.rb → lib/gcov.rb} +13 -24
  75. data/plugins/module_generator/module_generator.rake +3 -3
  76. data/plugins/warnings_report/lib/warnings_report.rb +69 -0
  77. data/plugins/xml_tests_report/lib/xml_tests_report.rb +108 -0
  78. data/spec/spec_system_helper.rb +1 -1
  79. data/vendor/c_exception/lib/CException.h +1 -1
  80. data/vendor/c_exception/vendor/unity/auto/generate_module.rb +16 -16
  81. data/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +61 -21
  82. data/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +5 -1
  83. data/vendor/c_exception/vendor/unity/auto/unity_to_junit.py +146 -0
  84. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  85. data/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  86. data/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  87. data/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  88. data/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  89. data/vendor/c_exception/vendor/unity/examples/example_1/makefile +1 -1
  90. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.c +7 -7
  91. data/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.c +2 -2
  92. data/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode.c +14 -14
  93. data/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode2.c +2 -2
  94. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +5 -5
  95. data/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +5 -5
  96. data/vendor/c_exception/vendor/unity/examples/unity_config.h +257 -0
  97. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +9 -8
  98. data/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +1 -0
  99. data/vendor/c_exception/vendor/unity/extras/fixture/test/Makefile +28 -8
  100. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +57 -17
  101. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +3 -0
  102. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +2 -3
  103. data/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +1 -1
  104. data/vendor/c_exception/vendor/unity/release/version.info +1 -1
  105. data/vendor/c_exception/vendor/unity/src/unity.c +336 -191
  106. data/vendor/c_exception/vendor/unity/src/unity.h +73 -69
  107. data/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -90
  108. data/vendor/c_exception/vendor/unity/test/Makefile +51 -0
  109. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +5 -5
  110. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +5 -5
  111. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.c +5 -5
  112. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +6 -6
  113. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +6 -6
  114. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.c +6 -6
  115. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +6 -6
  116. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +8 -8
  117. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +6 -6
  118. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +6 -6
  119. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +8 -8
  120. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +7 -7
  121. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +5 -5
  122. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +7 -7
  123. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +5 -5
  124. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +5 -5
  125. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +7 -7
  126. data/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +6 -6
  127. data/vendor/c_exception/vendor/unity/test/rakefile +5 -0
  128. data/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +9 -7
  129. data/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +1 -0
  130. data/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +3 -0
  131. data/vendor/c_exception/vendor/unity/test/targets/gcc_32.yml +1 -0
  132. data/vendor/c_exception/vendor/unity/test/targets/gcc_64.yml +1 -0
  133. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_limits.yml +1 -0
  134. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_sizeof.yml +1 -0
  135. data/vendor/c_exception/vendor/unity/test/targets/gcc_auto_stdint.yml +1 -0
  136. data/vendor/c_exception/vendor/unity/test/targets/gcc_manual_math.yml +1 -0
  137. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v4.yml +1 -0
  138. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5.yml +1 -0
  139. data/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5_3.yml +1 -0
  140. data/vendor/c_exception/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +1 -0
  141. data/vendor/c_exception/vendor/unity/test/targets/iar_cortexm3_v5.yml +1 -0
  142. data/vendor/c_exception/vendor/unity/test/targets/iar_msp430.yml +1 -0
  143. data/vendor/c_exception/vendor/unity/test/targets/iar_sh2a_v6.yml +1 -0
  144. data/vendor/c_exception/vendor/unity/test/testdata/CException.h +11 -0
  145. data/vendor/c_exception/vendor/unity/test/testdata/Defs.h +8 -0
  146. data/vendor/c_exception/vendor/unity/test/testdata/cmock.h +14 -0
  147. data/vendor/c_exception/vendor/unity/test/testdata/mockMock.h +13 -0
  148. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGenerator.c +183 -0
  149. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +65 -0
  150. data/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +192 -0
  151. data/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +1221 -71
  152. data/vendor/c_exception/vendor/unity/test/tests/testparameterized.c +1 -1
  153. data/vendor/c_exception/vendor/unity/test/tests/testunity.c +127 -5
  154. data/vendor/cmock/docs/CMock_Summary.md +1 -1
  155. data/vendor/cmock/lib/cmock_generator.rb +7 -2
  156. data/vendor/cmock/lib/cmock_header_parser.rb +29 -9
  157. data/vendor/cmock/scripts/create_mock.rb +1 -1
  158. data/vendor/cmock/test/system/test_compilation/const.h +15 -0
  159. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +4 -4
  160. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +136 -73
  161. data/vendor/cmock/vendor/c_exception/lib/CException.h +1 -1
  162. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_module.rb +16 -16
  163. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/generate_test_runner.rb +61 -21
  164. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/stylize_as_junit.rb +5 -1
  165. data/vendor/cmock/vendor/c_exception/vendor/unity/auto/unity_to_junit.py +146 -0
  166. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  167. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  168. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  169. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  170. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  171. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/makefile +1 -1
  172. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode.c +7 -7
  173. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/src/ProductionCode2.c +2 -2
  174. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode.c +14 -14
  175. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/TestProductionCode2.c +2 -2
  176. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +5 -5
  177. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +5 -5
  178. data/vendor/cmock/vendor/c_exception/vendor/unity/examples/unity_config.h +257 -0
  179. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture.c +9 -8
  180. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/src/unity_fixture_internals.h +1 -0
  181. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/Makefile +28 -8
  182. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_Test.c +57 -17
  183. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +3 -0
  184. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.c +2 -3
  185. data/vendor/cmock/vendor/c_exception/vendor/unity/extras/fixture/test/unity_output_Spy.h +1 -1
  186. data/vendor/cmock/vendor/c_exception/vendor/unity/release/version.info +1 -1
  187. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.c +336 -191
  188. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity.h +73 -69
  189. data/vendor/cmock/vendor/c_exception/vendor/unity/src/unity_internals.h +119 -90
  190. data/vendor/cmock/vendor/c_exception/vendor/unity/test/Makefile +51 -0
  191. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_cmd.c +5 -5
  192. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_def.c +5 -5
  193. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_head1.c +5 -5
  194. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_cmd.c +6 -6
  195. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_def.c +6 -6
  196. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_head1.c +6 -6
  197. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new1.c +6 -6
  198. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_new2.c +8 -8
  199. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_param.c +6 -6
  200. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run1.c +6 -6
  201. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_run2.c +8 -8
  202. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_mock_yaml.c +7 -7
  203. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_new1.c +5 -5
  204. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_new2.c +7 -7
  205. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_param.c +5 -5
  206. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_run1.c +5 -5
  207. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_run2.c +7 -7
  208. data/vendor/cmock/vendor/c_exception/vendor/unity/test/expectdata/testsample_yaml.c +6 -6
  209. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile +5 -0
  210. data/vendor/cmock/vendor/c_exception/vendor/unity/test/rakefile_helper.rb +9 -7
  211. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_file.yml +1 -0
  212. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/clang_strict.yml +3 -0
  213. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_32.yml +1 -0
  214. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_64.yml +1 -0
  215. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_auto_limits.yml +1 -0
  216. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_auto_sizeof.yml +1 -0
  217. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_auto_stdint.yml +1 -0
  218. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/gcc_manual_math.yml +1 -0
  219. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_arm_v4.yml +1 -0
  220. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5.yml +1 -0
  221. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_arm_v5_3.yml +1 -0
  222. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +1 -0
  223. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_cortexm3_v5.yml +1 -0
  224. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_msp430.yml +1 -0
  225. data/vendor/cmock/vendor/c_exception/vendor/unity/test/targets/iar_sh2a_v6.yml +1 -0
  226. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/CException.h +11 -0
  227. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/Defs.h +8 -0
  228. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/cmock.h +14 -0
  229. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/mockMock.h +13 -0
  230. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGenerator.c +183 -0
  231. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +65 -0
  232. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +192 -0
  233. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/test_generate_test_runner.rb +1221 -71
  234. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testparameterized.c +1 -1
  235. data/vendor/cmock/vendor/c_exception/vendor/unity/test/tests/testunity.c +127 -5
  236. data/vendor/cmock/vendor/unity/auto/generate_module.rb +16 -16
  237. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +61 -21
  238. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +5 -1
  239. data/vendor/cmock/vendor/unity/auto/unity_to_junit.py +146 -0
  240. data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  241. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  242. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  243. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  244. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  245. data/vendor/cmock/vendor/unity/examples/example_1/makefile +1 -1
  246. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +7 -7
  247. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +2 -2
  248. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +14 -14
  249. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +2 -2
  250. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +5 -5
  251. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +5 -5
  252. data/vendor/cmock/vendor/unity/examples/unity_config.h +257 -0
  253. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +3 -0
  254. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +5 -2
  255. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +1 -2
  256. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +1 -1
  257. data/vendor/cmock/vendor/unity/src/unity.c +329 -186
  258. data/vendor/cmock/vendor/unity/src/unity.h +73 -69
  259. data/vendor/cmock/vendor/unity/src/unity_internals.h +119 -94
  260. data/vendor/cmock/vendor/unity/test/Makefile +4 -5
  261. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +5 -5
  262. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +5 -5
  263. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +5 -5
  264. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +6 -6
  265. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +6 -6
  266. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +6 -6
  267. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +6 -6
  268. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +8 -8
  269. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +6 -6
  270. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +6 -6
  271. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +8 -8
  272. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +7 -7
  273. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +5 -5
  274. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +7 -7
  275. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +5 -5
  276. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +5 -5
  277. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +7 -7
  278. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +6 -6
  279. data/vendor/cmock/vendor/unity/test/rakefile +5 -0
  280. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +9 -7
  281. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +1 -0
  282. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +3 -0
  283. data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +1 -0
  284. data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +1 -0
  285. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +1 -0
  286. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_sizeof.yml +1 -0
  287. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +1 -0
  288. data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +1 -0
  289. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +1 -0
  290. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +1 -0
  291. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +1 -0
  292. data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +1 -0
  293. data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +1 -0
  294. data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +1 -0
  295. data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +1 -0
  296. data/vendor/cmock/vendor/unity/test/testdata/CException.h +11 -0
  297. data/vendor/cmock/vendor/unity/test/testdata/Defs.h +8 -0
  298. data/vendor/cmock/vendor/unity/test/testdata/cmock.h +14 -0
  299. data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +13 -0
  300. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +183 -0
  301. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +65 -0
  302. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +192 -0
  303. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +1221 -71
  304. data/vendor/cmock/vendor/unity/test/tests/testparameterized.c +1 -1
  305. data/vendor/cmock/vendor/unity/test/tests/testunity.c +104 -7
  306. data/vendor/deep_merge/README +94 -94
  307. data/vendor/deep_merge/Rakefile +28 -28
  308. data/vendor/deep_merge/lib/deep_merge.rb +211 -211
  309. data/vendor/deep_merge/test/test_deep_merge.rb +553 -553
  310. data/vendor/unity/auto/generate_module.rb +16 -16
  311. data/vendor/unity/auto/generate_test_runner.rb +61 -21
  312. data/vendor/unity/auto/stylize_as_junit.rb +5 -1
  313. data/vendor/unity/auto/unity_to_junit.py +146 -0
  314. data/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  315. data/vendor/unity/docs/UnityAssertionsReference.pdf +0 -0
  316. data/vendor/unity/docs/UnityConfigurationGuide.pdf +0 -0
  317. data/vendor/unity/docs/UnityGettingStartedGuide.pdf +0 -0
  318. data/vendor/unity/docs/UnityHelperScriptsGuide.pdf +0 -0
  319. data/vendor/unity/examples/example_1/makefile +1 -1
  320. data/vendor/unity/examples/example_1/src/ProductionCode.c +7 -7
  321. data/vendor/unity/examples/example_1/src/ProductionCode2.c +2 -2
  322. data/vendor/unity/examples/example_1/test/TestProductionCode.c +14 -14
  323. data/vendor/unity/examples/example_1/test/TestProductionCode2.c +2 -2
  324. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +5 -5
  325. data/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +5 -5
  326. data/vendor/unity/examples/unity_config.h +257 -0
  327. data/vendor/unity/extras/fixture/src/unity_fixture.c +3 -0
  328. data/vendor/unity/extras/fixture/test/unity_fixture_Test.c +5 -2
  329. data/vendor/unity/extras/fixture/test/unity_output_Spy.c +1 -2
  330. data/vendor/unity/extras/fixture/test/unity_output_Spy.h +1 -1
  331. data/vendor/unity/src/unity.c +329 -186
  332. data/vendor/unity/src/unity.h +73 -69
  333. data/vendor/unity/src/unity_internals.h +119 -94
  334. data/vendor/unity/test/Makefile +4 -5
  335. data/vendor/unity/test/expectdata/testsample_cmd.c +5 -5
  336. data/vendor/unity/test/expectdata/testsample_def.c +5 -5
  337. data/vendor/unity/test/expectdata/testsample_head1.c +5 -5
  338. data/vendor/unity/test/expectdata/testsample_mock_cmd.c +6 -6
  339. data/vendor/unity/test/expectdata/testsample_mock_def.c +6 -6
  340. data/vendor/unity/test/expectdata/testsample_mock_head1.c +6 -6
  341. data/vendor/unity/test/expectdata/testsample_mock_new1.c +6 -6
  342. data/vendor/unity/test/expectdata/testsample_mock_new2.c +8 -8
  343. data/vendor/unity/test/expectdata/testsample_mock_param.c +6 -6
  344. data/vendor/unity/test/expectdata/testsample_mock_run1.c +6 -6
  345. data/vendor/unity/test/expectdata/testsample_mock_run2.c +8 -8
  346. data/vendor/unity/test/expectdata/testsample_mock_yaml.c +7 -7
  347. data/vendor/unity/test/expectdata/testsample_new1.c +5 -5
  348. data/vendor/unity/test/expectdata/testsample_new2.c +7 -7
  349. data/vendor/unity/test/expectdata/testsample_param.c +5 -5
  350. data/vendor/unity/test/expectdata/testsample_run1.c +5 -5
  351. data/vendor/unity/test/expectdata/testsample_run2.c +7 -7
  352. data/vendor/unity/test/expectdata/testsample_yaml.c +6 -6
  353. data/vendor/unity/test/rakefile +5 -0
  354. data/vendor/unity/test/rakefile_helper.rb +9 -7
  355. data/vendor/unity/test/targets/clang_file.yml +1 -0
  356. data/vendor/unity/test/targets/clang_strict.yml +3 -0
  357. data/vendor/unity/test/targets/gcc_32.yml +1 -0
  358. data/vendor/unity/test/targets/gcc_64.yml +1 -0
  359. data/vendor/unity/test/targets/gcc_auto_limits.yml +1 -0
  360. data/vendor/unity/test/targets/gcc_auto_sizeof.yml +1 -0
  361. data/vendor/unity/test/targets/gcc_auto_stdint.yml +1 -0
  362. data/vendor/unity/test/targets/gcc_manual_math.yml +1 -0
  363. data/vendor/unity/test/targets/iar_arm_v4.yml +1 -0
  364. data/vendor/unity/test/targets/iar_arm_v5.yml +1 -0
  365. data/vendor/unity/test/targets/iar_arm_v5_3.yml +1 -0
  366. data/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +1 -0
  367. data/vendor/unity/test/targets/iar_cortexm3_v5.yml +1 -0
  368. data/vendor/unity/test/targets/iar_msp430.yml +1 -0
  369. data/vendor/unity/test/targets/iar_sh2a_v6.yml +1 -0
  370. data/vendor/unity/test/testdata/CException.h +11 -0
  371. data/vendor/unity/test/testdata/Defs.h +8 -0
  372. data/vendor/unity/test/testdata/cmock.h +14 -0
  373. data/vendor/unity/test/testdata/mockMock.h +13 -0
  374. data/vendor/unity/test/testdata/testRunnerGenerator.c +183 -0
  375. data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +65 -0
  376. data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +192 -0
  377. data/vendor/unity/test/tests/test_generate_test_runner.rb +1221 -71
  378. data/vendor/unity/test/tests/testparameterized.c +1 -1
  379. data/vendor/unity/test/tests/testunity.c +104 -7
  380. metadata +124 -32
  381. data/plugins/gcov/readme.txt +0 -0
  382. data/plugins/warnings_report/warnings_report.rb +0 -71
  383. data/plugins/xml_tests_report/xml_tests_report.rb +0 -110
  384. data/vendor/c_exception/vendor/unity/docs/Unity Summary.odt +0 -0
  385. data/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf +0 -0
  386. data/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +0 -224
  387. data/vendor/c_exception/vendor/unity/test/testdata/mocksample.c +0 -51
  388. data/vendor/c_exception/vendor/unity/test/testdata/sample.yml +0 -9
  389. data/vendor/c_exception/vendor/unity/test/testdata/testsample.c +0 -68
  390. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/Unity Summary.odt +0 -0
  391. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/Unity Summary.pdf +0 -0
  392. data/vendor/cmock/vendor/c_exception/vendor/unity/docs/Unity Summary.txt +0 -224
  393. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/mocksample.c +0 -51
  394. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/sample.yml +0 -9
  395. data/vendor/cmock/vendor/c_exception/vendor/unity/test/testdata/testsample.c +0 -68
  396. data/vendor/cmock/vendor/unity/docs/Unity Summary.odt +0 -0
  397. data/vendor/cmock/vendor/unity/docs/Unity Summary.pdf +0 -0
  398. data/vendor/cmock/vendor/unity/docs/Unity Summary.txt +0 -224
  399. data/vendor/cmock/vendor/unity/test/testdata/mocksample.c +0 -51
  400. data/vendor/cmock/vendor/unity/test/testdata/sample.yml +0 -9
  401. data/vendor/cmock/vendor/unity/test/testdata/testsample.c +0 -68
  402. data/vendor/unity/docs/Unity Summary.odt +0 -0
  403. data/vendor/unity/docs/Unity Summary.pdf +0 -0
  404. data/vendor/unity/docs/Unity Summary.txt +0 -224
  405. data/vendor/unity/test/testdata/mocksample.c +0 -51
  406. data/vendor/unity/test/testdata/sample.yml +0 -9
  407. data/vendor/unity/test/testdata/testsample.c +0 -68
@@ -207,6 +207,9 @@ void* unity_malloc(size_t size)
207
207
  mem = (char*)&(guard[1]);
208
208
  memcpy(&mem[size], end, sizeof(end));
209
209
 
210
+ #ifndef UNITY_FIXTURE_MALLOC_OVERRIDES_H_
211
+ free(guard);
212
+ #endif
210
213
  return (void*)mem;
211
214
  }
212
215
 
@@ -524,10 +524,13 @@ TEST(InternalMalloc, ReallocFailDoesNotFreeMem)
524
524
  void* out_of_mem = realloc(n1, UNITY_INTERNAL_HEAP_SIZE_BYTES/2 + 1);
525
525
  void* n2 = malloc(10);
526
526
  TEST_ASSERT_NOT_NULL(m);
527
- TEST_ASSERT_NULL(out_of_mem);
527
+ if (out_of_mem == NULL)
528
+ {
529
+ free(n1);
530
+ TEST_ASSERT_NULL(out_of_mem);
531
+ }
528
532
  TEST_ASSERT_NOT_EQUAL(n2, n1);
529
533
  free(n2);
530
- free(n1);
531
534
  free(m);
532
535
  #endif
533
536
  }
@@ -33,7 +33,7 @@ void UnityOutputCharSpy_Destroy(void)
33
33
  free(buffer);
34
34
  }
35
35
 
36
- int UnityOutputCharSpy_OutputChar(int c)
36
+ void UnityOutputCharSpy_OutputChar(int c)
37
37
  {
38
38
  if (spy_enable)
39
39
  {
@@ -44,7 +44,6 @@ int UnityOutputCharSpy_OutputChar(int c)
44
44
  {
45
45
  putchar(c);
46
46
  }
47
- return c;
48
47
  }
49
48
 
50
49
  const char * UnityOutputCharSpy_Get(void)
@@ -10,7 +10,7 @@
10
10
 
11
11
  void UnityOutputCharSpy_Create(int s);
12
12
  void UnityOutputCharSpy_Destroy(void);
13
- int UnityOutputCharSpy_OutputChar(int c);
13
+ void UnityOutputCharSpy_OutputChar(int c);
14
14
  const char * UnityOutputCharSpy_Get(void);
15
15
  void UnityOutputCharSpy_Enable(int enable);
16
16
 
@@ -7,63 +7,64 @@
7
7
  #include "unity.h"
8
8
  #include <stddef.h>
9
9
 
10
- #ifndef UNITY_OUTPUT_CHAR_USE_PUTC
11
- //If defined as something else, make sure we declare it here so it's ready for use
12
- extern int UNITY_OUTPUT_CHAR(int);
10
+ /* If omitted from header, declare overrideable prototypes here so they're ready for use */
11
+ #ifdef UNITY_OMIT_OUTPUT_CHAR_HEADER_DECLARATION
12
+ void UNITY_OUTPUT_CHAR(int);
13
13
  #endif
14
14
 
15
+ /* Helpful macros for us to use here */
15
16
  #define UNITY_FAIL_AND_BAIL { Unity.CurrentTestFailed = 1; longjmp(Unity.AbortFrame, 1); }
16
17
  #define UNITY_IGNORE_AND_BAIL { Unity.CurrentTestIgnored = 1; longjmp(Unity.AbortFrame, 1); }
17
- /// return prematurely if we are already in failure or ignore state
18
+
19
+ /* return prematurely if we are already in failure or ignore state */
18
20
  #define UNITY_SKIP_EXECUTION { if ((Unity.CurrentTestFailed != 0) || (Unity.CurrentTestIgnored != 0)) {return;} }
19
21
 
20
22
  struct _Unity Unity;
21
23
 
22
- const char UnityStrOk[] = "OK";
23
- const char UnityStrPass[] = "PASS";
24
- const char UnityStrFail[] = "FAIL";
25
- const char UnityStrIgnore[] = "IGNORE";
26
- const char UnityStrNull[] = "NULL";
27
- const char UnityStrSpacer[] = ". ";
28
- const char UnityStrExpected[] = " Expected ";
29
- const char UnityStrWas[] = " Was ";
30
- const char UnityStrTo[] = " To ";
31
- const char UnityStrElement[] = " Element ";
32
- const char UnityStrByte[] = " Byte ";
33
- const char UnityStrMemory[] = " Memory Mismatch.";
34
- const char UnityStrDelta[] = " Values Not Within Delta ";
35
- const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless.";
36
- const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL";
37
- const char UnityStrNullPointerForActual[] = " Actual pointer was NULL";
38
- const char UnityStrNot[] = "Not ";
39
- const char UnityStrInf[] = "Infinity";
40
- const char UnityStrNegInf[] = "Negative Infinity";
41
- const char UnityStrNaN[] = "NaN";
42
- const char UnityStrDet[] = "Determinate";
43
- const char UnityStrInvalidFloatTrait[] = "Invalid Float Trait";
44
- const char UnityStrErrFloat[] = "Unity Floating Point Disabled";
45
- const char UnityStrErrDouble[] = "Unity Double Precision Disabled";
46
- const char UnityStrErr64[] = "Unity 64-bit Support Disabled";
47
- const char UnityStrBreaker[] = "-----------------------";
48
- const char UnityStrResultsTests[] = " Tests ";
49
- const char UnityStrResultsFailures[] = " Failures ";
50
- const char UnityStrResultsIgnored[] = " Ignored ";
51
- const char UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
52
- const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
24
+ static const char UnityStrOk[] = "OK";
25
+ static const char UnityStrPass[] = "PASS";
26
+ static const char UnityStrFail[] = "FAIL";
27
+ static const char UnityStrIgnore[] = "IGNORE";
28
+ static const char UnityStrNull[] = "NULL";
29
+ static const char UnityStrSpacer[] = ". ";
30
+ static const char UnityStrExpected[] = " Expected ";
31
+ static const char UnityStrWas[] = " Was ";
32
+ static const char UnityStrElement[] = " Element ";
33
+ static const char UnityStrByte[] = " Byte ";
34
+ static const char UnityStrMemory[] = " Memory Mismatch.";
35
+ static const char UnityStrDelta[] = " Values Not Within Delta ";
36
+ static const char UnityStrPointless[] = " You Asked Me To Compare Nothing, Which Was Pointless.";
37
+ static const char UnityStrNullPointerForExpected[] = " Expected pointer to be NULL";
38
+ static const char UnityStrNullPointerForActual[] = " Actual pointer was NULL";
39
+ static const char UnityStrNot[] = "Not ";
40
+ static const char UnityStrInf[] = "Infinity";
41
+ static const char UnityStrNegInf[] = "Negative Infinity";
42
+ static const char UnityStrNaN[] = "NaN";
43
+ static const char UnityStrDet[] = "Determinate";
44
+ static const char UnityStrInvalidFloatTrait[] = "Invalid Float Trait";
45
+ const char UnityStrErrFloat[] = "Unity Floating Point Disabled";
46
+ const char UnityStrErrDouble[] = "Unity Double Precision Disabled";
47
+ const char UnityStrErr64[] = "Unity 64-bit Support Disabled";
48
+ static const char UnityStrBreaker[] = "-----------------------";
49
+ static const char UnityStrResultsTests[] = " Tests ";
50
+ static const char UnityStrResultsFailures[] = " Failures ";
51
+ static const char UnityStrResultsIgnored[] = " Ignored ";
52
+ static const char UnityStrDetail1Name[] = UNITY_DETAIL1_NAME " ";
53
+ static const char UnityStrDetail2Name[] = " " UNITY_DETAIL2_NAME " ";
53
54
 
54
55
  #ifdef UNITY_FLOAT_NEEDS_ZERO
55
- // Dividing by these constants produces +/- infinity.
56
- // The rationale is given in UnityAssertFloatIsInf's body.
56
+ /* Dividing by these constants produces +/- infinity.
57
+ * The rationale is given in UnityAssertFloatIsInf's body. */
57
58
  static const _UF f_zero = 0.0f;
58
59
  #endif
59
60
 
60
- // compiler-generic print formatting masks
61
- const _U_UINT UnitySizeMask[] =
61
+ /* compiler-generic print formatting masks */
62
+ static const _U_UINT UnitySizeMask[] =
62
63
  {
63
- 255u, // 0xFF
64
- 65535u, // 0xFFFF
64
+ 255u, /* 0xFF */
65
+ 65535u, /* 0xFFFF */
65
66
  65535u,
66
- 4294967295u, // 0xFFFFFFFF
67
+ 4294967295u, /* 0xFFFFFFFF */
67
68
  4294967295u,
68
69
  4294967295u,
69
70
  4294967295u
@@ -72,9 +73,9 @@ const _U_UINT UnitySizeMask[] =
72
73
  #endif
73
74
  };
74
75
 
75
- //-----------------------------------------------
76
- // Pretty Printers & Test Result Output Handlers
77
- //-----------------------------------------------
76
+ /*-----------------------------------------------
77
+ * Pretty Printers & Test Result Output Handlers
78
+ *-----------------------------------------------*/
78
79
 
79
80
  void UnityPrint(const char* string)
80
81
  {
@@ -84,24 +85,24 @@ void UnityPrint(const char* string)
84
85
  {
85
86
  while (*pch)
86
87
  {
87
- // printable characters plus CR & LF are printed
88
+ /* printable characters plus CR & LF are printed */
88
89
  if ((*pch <= 126) && (*pch >= 32))
89
90
  {
90
91
  UNITY_OUTPUT_CHAR(*pch);
91
92
  }
92
- //write escaped carriage returns
93
+ /* write escaped carriage returns */
93
94
  else if (*pch == 13)
94
95
  {
95
96
  UNITY_OUTPUT_CHAR('\\');
96
97
  UNITY_OUTPUT_CHAR('r');
97
98
  }
98
- //write escaped line feeds
99
+ /* write escaped line feeds */
99
100
  else if (*pch == 10)
100
101
  {
101
102
  UNITY_OUTPUT_CHAR('\\');
102
103
  UNITY_OUTPUT_CHAR('n');
103
104
  }
104
- // unprintable characters are shown as codes
105
+ /* unprintable characters are shown as codes */
105
106
  else
106
107
  {
107
108
  UNITY_OUTPUT_CHAR('\\');
@@ -121,24 +122,24 @@ void UnityPrintLen(const char* string, const _UU32 length)
121
122
  {
122
123
  while (*pch && (_UU32)(pch - string) < length)
123
124
  {
124
- // printable characters plus CR & LF are printed
125
+ /* printable characters plus CR & LF are printed */
125
126
  if ((*pch <= 126) && (*pch >= 32))
126
127
  {
127
128
  UNITY_OUTPUT_CHAR(*pch);
128
129
  }
129
- //write escaped carriage returns
130
+ /* write escaped carriage returns */
130
131
  else if (*pch == 13)
131
132
  {
132
133
  UNITY_OUTPUT_CHAR('\\');
133
134
  UNITY_OUTPUT_CHAR('r');
134
135
  }
135
- //write escaped line feeds
136
+ /* write escaped line feeds */
136
137
  else if (*pch == 10)
137
138
  {
138
139
  UNITY_OUTPUT_CHAR('\\');
139
140
  UNITY_OUTPUT_CHAR('n');
140
141
  }
141
- // unprintable characters are shown as codes
142
+ /* unprintable characters are shown as codes */
142
143
  else
143
144
  {
144
145
  UNITY_OUTPUT_CHAR('\\');
@@ -149,7 +150,7 @@ void UnityPrintLen(const char* string, const _UU32 length)
149
150
  }
150
151
  }
151
152
 
152
- //-----------------------------------------------
153
+ /*-----------------------------------------------*/
153
154
  void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T style)
154
155
  {
155
156
  if ((style & UNITY_DISPLAY_RANGE_INT) == UNITY_DISPLAY_RANGE_INT)
@@ -166,63 +167,33 @@ void UnityPrintNumberByStyle(const _U_SINT number, const UNITY_DISPLAY_STYLE_T s
166
167
  }
167
168
  }
168
169
 
169
- //-----------------------------------------------
170
- /// basically do an itoa using as little ram as possible
170
+ /*-----------------------------------------------*/
171
171
  void UnityPrintNumber(const _U_SINT number_to_print)
172
172
  {
173
- _U_UINT divisor = 1;
174
- _U_UINT next_divisor;
175
- _U_UINT number;
173
+ _U_UINT number = (_U_UINT)number_to_print;
176
174
 
177
175
  if (number_to_print < 0)
178
176
  {
179
- //A negative number, including MIN negative
177
+ /* A negative number, including MIN negative */
180
178
  UNITY_OUTPUT_CHAR('-');
181
179
  number = (_U_UINT)(-number_to_print);
182
180
  }
183
- else
184
- {
185
- //Non-negative number
186
- number = (_U_UINT)number_to_print;
187
- }
188
-
189
- // figure out initial divisor
190
- while (number / divisor > 9)
191
- {
192
- next_divisor = divisor * 10;
193
- if (next_divisor > divisor)
194
- divisor = next_divisor;
195
- else
196
- break;
197
- }
198
-
199
- // now mod and print, then divide divisor
200
- do
201
- {
202
- UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
203
- divisor /= 10;
204
- }
205
- while (divisor > 0);
181
+ UnityPrintNumberUnsigned(number);
206
182
  }
207
183
 
208
- //-----------------------------------------------
209
- /// basically do an itoa using as little ram as possible
184
+ /*-----------------------------------------------
185
+ * basically do an itoa using as little ram as possible */
210
186
  void UnityPrintNumberUnsigned(const _U_UINT number)
211
187
  {
212
188
  _U_UINT divisor = 1;
213
- _U_UINT next_divisor;
214
189
 
215
- // figure out initial divisor
190
+ /* figure out initial divisor */
216
191
  while (number / divisor > 9)
217
192
  {
218
- next_divisor = divisor * 10;
219
- if (next_divisor > divisor)
220
- divisor = next_divisor;
221
- else
222
- break;
193
+ divisor *= 10;
223
194
  }
224
195
 
225
- // now mod and print, then divide divisor
196
+ /* now mod and print, then divide divisor */
226
197
  do
227
198
  {
228
199
  UNITY_OUTPUT_CHAR((char)('0' + (number / divisor % 10)));
@@ -231,7 +202,7 @@ void UnityPrintNumberUnsigned(const _U_UINT number)
231
202
  while (divisor > 0);
232
203
  }
233
204
 
234
- //-----------------------------------------------
205
+ /*-----------------------------------------------*/
235
206
  void UnityPrintNumberHex(const _U_UINT number, const char nibbles_to_print)
236
207
  {
237
208
  _U_UINT nibble;
@@ -253,7 +224,7 @@ void UnityPrintNumberHex(const _U_UINT number, const char nibbles_to_print)
253
224
  }
254
225
  }
255
226
 
256
- //-----------------------------------------------
227
+ /*-----------------------------------------------*/
257
228
  void UnityPrintMask(const _U_UINT mask, const _U_UINT number)
258
229
  {
259
230
  _U_UINT current_bit = (_U_UINT)1 << (UNITY_INT_WIDTH - 1);
@@ -280,7 +251,7 @@ void UnityPrintMask(const _U_UINT mask, const _U_UINT number)
280
251
  }
281
252
  }
282
253
 
283
- //-----------------------------------------------
254
+ /*-----------------------------------------------*/
284
255
  #ifdef UNITY_FLOAT_VERBOSE
285
256
  #include <stdio.h>
286
257
 
@@ -300,7 +271,7 @@ void UnityPrintFloat(_UF number)
300
271
  }
301
272
  #endif
302
273
 
303
- //-----------------------------------------------
274
+ /*-----------------------------------------------*/
304
275
 
305
276
  void UnityPrintFail(void);
306
277
  void UnityPrintFail(void)
@@ -314,7 +285,7 @@ void UnityPrintOk(void)
314
285
  UnityPrint(UnityStrOk);
315
286
  }
316
287
 
317
- //-----------------------------------------------
288
+ /*-----------------------------------------------*/
318
289
  static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line);
319
290
  static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
320
291
  {
@@ -331,7 +302,7 @@ static void UnityTestResultsBegin(const char* file, const UNITY_LINE_TYPE line)
331
302
  #endif
332
303
  }
333
304
 
334
- //-----------------------------------------------
305
+ /*-----------------------------------------------*/
335
306
  static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line);
336
307
  static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
337
308
  {
@@ -344,7 +315,7 @@ static void UnityTestResultsFailBegin(const UNITY_LINE_TYPE line)
344
315
  UNITY_OUTPUT_CHAR(':');
345
316
  }
346
317
 
347
- //-----------------------------------------------
318
+ /*-----------------------------------------------*/
348
319
  void UnityConcludeTest(void)
349
320
  {
350
321
  if (Unity.CurrentTestIgnored)
@@ -364,9 +335,10 @@ void UnityConcludeTest(void)
364
335
  Unity.CurrentTestFailed = 0;
365
336
  Unity.CurrentTestIgnored = 0;
366
337
  UNITY_PRINT_EOL();
338
+ UNITY_FLUSH_CALL();
367
339
  }
368
340
 
369
- //-----------------------------------------------
341
+ /*-----------------------------------------------*/
370
342
  static void UnityAddMsgIfSpecified(const char* msg);
371
343
  static void UnityAddMsgIfSpecified(const char* msg)
372
344
  {
@@ -390,7 +362,7 @@ static void UnityAddMsgIfSpecified(const char* msg)
390
362
  }
391
363
  }
392
364
 
393
- //-----------------------------------------------
365
+ /*-----------------------------------------------*/
394
366
  static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual);
395
367
  static void UnityPrintExpectedAndActualStrings(const char* expected, const char* actual)
396
368
  {
@@ -418,7 +390,7 @@ static void UnityPrintExpectedAndActualStrings(const char* expected, const char*
418
390
  }
419
391
  }
420
392
 
421
- //-----------------------------------------------
393
+ /*-----------------------------------------------*/
422
394
  static void UnityPrintExpectedAndActualStringsLen(const char* expected, const char* actual, const _UU32 length)
423
395
  {
424
396
  UnityPrint(UnityStrExpected);
@@ -447,17 +419,17 @@ static void UnityPrintExpectedAndActualStringsLen(const char* expected, const ch
447
419
 
448
420
 
449
421
 
450
- //-----------------------------------------------
451
- // Assertion & Control Helpers
452
- //-----------------------------------------------
422
+ /*-----------------------------------------------
423
+ * Assertion & Control Helpers
424
+ *-----------------------------------------------*/
453
425
 
454
426
  static int UnityCheckArraysForNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_PTR actual, const UNITY_LINE_TYPE lineNumber, const char* msg)
455
427
  {
456
- //return true if they are both NULL
428
+ /* return true if they are both NULL */
457
429
  if ((expected == NULL) && (actual == NULL))
458
430
  return 1;
459
431
 
460
- //throw error if just expected is NULL
432
+ /* throw error if just expected is NULL */
461
433
  if (expected == NULL)
462
434
  {
463
435
  UnityTestResultsFailBegin(lineNumber);
@@ -466,7 +438,7 @@ static int UnityCheckArraysForNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_P
466
438
  UNITY_FAIL_AND_BAIL;
467
439
  }
468
440
 
469
- //throw error if just actual is NULL
441
+ /* throw error if just actual is NULL */
470
442
  if (actual == NULL)
471
443
  {
472
444
  UnityTestResultsFailBegin(lineNumber);
@@ -475,13 +447,13 @@ static int UnityCheckArraysForNull(UNITY_INTERNAL_PTR expected, UNITY_INTERNAL_P
475
447
  UNITY_FAIL_AND_BAIL;
476
448
  }
477
449
 
478
- //return false if neither is NULL
450
+ /* return false if neither is NULL */
479
451
  return 0;
480
452
  }
481
453
 
482
- //-----------------------------------------------
483
- // Assertion Functions
484
- //-----------------------------------------------
454
+ /*-----------------------------------------------
455
+ * Assertion Functions
456
+ *-----------------------------------------------*/
485
457
 
486
458
  void UnityAssertBits(const _U_SINT mask,
487
459
  const _U_SINT expected,
@@ -503,7 +475,7 @@ void UnityAssertBits(const _U_SINT mask,
503
475
  }
504
476
  }
505
477
 
506
- //-----------------------------------------------
478
+ /*-----------------------------------------------*/
507
479
  void UnityAssertEqualNumber(const _U_SINT expected,
508
480
  const _U_SINT actual,
509
481
  const char* msg,
@@ -524,7 +496,14 @@ void UnityAssertEqualNumber(const _U_SINT expected,
524
496
  }
525
497
  }
526
498
 
527
- //-----------------------------------------------
499
+ #define UnityPrintPointlessAndBail() \
500
+ { \
501
+ UnityTestResultsFailBegin(lineNumber); \
502
+ UnityPrint(UnityStrPointless); \
503
+ UnityAddMsgIfSpecified(msg); \
504
+ UNITY_FAIL_AND_BAIL; }
505
+
506
+ /*-----------------------------------------------*/
528
507
  void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
529
508
  UNITY_INTERNAL_PTR actual,
530
509
  const _UU32 num_elements,
@@ -540,18 +519,15 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
540
519
 
541
520
  if (elements == 0)
542
521
  {
543
- UnityTestResultsFailBegin(lineNumber);
544
- UnityPrint(UnityStrPointless);
545
- UnityAddMsgIfSpecified(msg);
546
- UNITY_FAIL_AND_BAIL;
522
+ UnityPrintPointlessAndBail();
547
523
  }
548
524
 
549
525
  if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1)
550
526
  return;
551
527
 
552
- // If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case
553
- // as UNITY_DISPLAY_STYLE_INT includes a flag for UNITY_DISPLAY_RANGE_AUTO, which the width-specific
554
- // variants do not. Therefore remove this flag.
528
+ /* If style is UNITY_DISPLAY_STYLE_INT, we'll fall into the default case rather than the INT16 or INT32 (etc) case
529
+ * as UNITY_DISPLAY_STYLE_INT includes a flag for UNITY_DISPLAY_RANGE_AUTO, which the width-specific
530
+ * variants do not. Therefore remove this flag. */
555
531
  switch(style & (UNITY_DISPLAY_STYLE_T)(~UNITY_DISPLAY_RANGE_AUTO))
556
532
  {
557
533
  case UNITY_DISPLAY_STYLE_HEX8:
@@ -641,7 +617,7 @@ void UnityAssertEqualIntArray(UNITY_INTERNAL_PTR expected,
641
617
  }
642
618
  }
643
619
 
644
- //-----------------------------------------------
620
+ /*-----------------------------------------------*/
645
621
  #ifndef UNITY_EXCLUDE_FLOAT
646
622
  void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
647
623
  UNITY_PTR_ATTRIBUTE const _UF* actual,
@@ -658,10 +634,7 @@ void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
658
634
 
659
635
  if (elements == 0)
660
636
  {
661
- UnityTestResultsFailBegin(lineNumber);
662
- UnityPrint(UnityStrPointless);
663
- UnityAddMsgIfSpecified(msg);
664
- UNITY_FAIL_AND_BAIL;
637
+ UnityPrintPointlessAndBail();
665
638
  }
666
639
 
667
640
  if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1)
@@ -671,13 +644,13 @@ void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
671
644
  {
672
645
  diff = *ptr_expected - *ptr_actual;
673
646
  if (diff < 0.0f)
674
- diff = 0.0f - diff;
647
+ diff = 0.0f - diff;
675
648
  tol = UNITY_FLOAT_PRECISION * *ptr_expected;
676
649
  if (tol < 0.0f)
677
650
  tol = 0.0f - tol;
678
651
 
679
- //This first part of this condition will catch any NaN or Infinite values
680
- if ((diff * 0.0f != 0.0f) || (diff > tol))
652
+ /* This first part of this condition will catch any NaN or Infinite values */
653
+ if (isnan(diff) || isinf(diff) || (diff > tol))
681
654
  {
682
655
  UnityTestResultsFailBegin(lineNumber);
683
656
  UnityPrint(UnityStrElement);
@@ -698,7 +671,7 @@ void UnityAssertEqualFloatArray(UNITY_PTR_ATTRIBUTE const _UF* expected,
698
671
  }
699
672
  }
700
673
 
701
- //-----------------------------------------------
674
+ /*-----------------------------------------------*/
702
675
  void UnityAssertFloatsWithin(const _UF delta,
703
676
  const _UF expected,
704
677
  const _UF actual,
@@ -719,8 +692,8 @@ void UnityAssertFloatsWithin(const _UF delta,
719
692
  pos_delta = 0.0f - pos_delta;
720
693
  }
721
694
 
722
- //This first part of this condition will catch any NaN or Infinite values
723
- if ((diff * 0.0f != 0.0f) || (pos_delta < diff))
695
+ /* This first part of this condition will catch any NaN or Infinite values */
696
+ if (isnan(diff) || isinf(diff) || (pos_delta < diff))
724
697
  {
725
698
  UnityTestResultsFailBegin(lineNumber);
726
699
  #ifdef UNITY_FLOAT_VERBOSE
@@ -736,7 +709,7 @@ void UnityAssertFloatsWithin(const _UF delta,
736
709
  }
737
710
  }
738
711
 
739
- //-----------------------------------------------
712
+ /*-----------------------------------------------*/
740
713
  void UnityAssertFloatSpecial(const _UF actual,
741
714
  const char* msg,
742
715
  const UNITY_LINE_TYPE lineNumber,
@@ -751,8 +724,8 @@ void UnityAssertFloatSpecial(const _UF actual,
751
724
 
752
725
  switch(style)
753
726
  {
754
- //To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
755
- //We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise
727
+ /* To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
728
+ * We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise */
756
729
  case UNITY_FLOAT_IS_INF:
757
730
  case UNITY_FLOAT_IS_NOT_INF:
758
731
  is_trait = isinf(actual) & ispos(actual);
@@ -762,13 +735,13 @@ void UnityAssertFloatSpecial(const _UF actual,
762
735
  is_trait = isinf(actual) & isneg(actual);
763
736
  break;
764
737
 
765
- //NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN.
738
+ /* NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. */
766
739
  case UNITY_FLOAT_IS_NAN:
767
740
  case UNITY_FLOAT_IS_NOT_NAN:
768
741
  is_trait = isnan(actual);
769
742
  break;
770
743
 
771
- //A determinate number is non infinite and not NaN. (therefore the opposite of the two above)
744
+ /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
772
745
  case UNITY_FLOAT_IS_DET:
773
746
  case UNITY_FLOAT_IS_NOT_DET:
774
747
  if (isinf(actual) | isnan(actual))
@@ -803,9 +776,9 @@ void UnityAssertFloatSpecial(const _UF actual,
803
776
  }
804
777
  }
805
778
 
806
- #endif //not UNITY_EXCLUDE_FLOAT
779
+ #endif /* not UNITY_EXCLUDE_FLOAT */
807
780
 
808
- //-----------------------------------------------
781
+ /*-----------------------------------------------*/
809
782
  #ifndef UNITY_EXCLUDE_DOUBLE
810
783
  void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
811
784
  UNITY_PTR_ATTRIBUTE const _UD* actual,
@@ -822,10 +795,7 @@ void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
822
795
 
823
796
  if (elements == 0)
824
797
  {
825
- UnityTestResultsFailBegin(lineNumber);
826
- UnityPrint(UnityStrPointless);
827
- UnityAddMsgIfSpecified(msg);
828
- UNITY_FAIL_AND_BAIL;
798
+ UnityPrintPointlessAndBail();
829
799
  }
830
800
 
831
801
  if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1)
@@ -840,8 +810,8 @@ void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
840
810
  if (tol < 0.0)
841
811
  tol = 0.0 - tol;
842
812
 
843
- //This first part of this condition will catch any NaN or Infinite values
844
- if ((diff * 0.0 != 0.0) || (diff > tol))
813
+ /* This first part of this condition will catch any NaN or Infinite values */
814
+ if (isnan(diff) || isinf(diff) || (diff > tol))
845
815
  {
846
816
  UnityTestResultsFailBegin(lineNumber);
847
817
  UnityPrint(UnityStrElement);
@@ -862,7 +832,7 @@ void UnityAssertEqualDoubleArray(UNITY_PTR_ATTRIBUTE const _UD* expected,
862
832
  }
863
833
  }
864
834
 
865
- //-----------------------------------------------
835
+ /*-----------------------------------------------*/
866
836
  void UnityAssertDoublesWithin(const _UD delta,
867
837
  const _UD expected,
868
838
  const _UD actual,
@@ -883,8 +853,8 @@ void UnityAssertDoublesWithin(const _UD delta,
883
853
  pos_delta = 0.0 - pos_delta;
884
854
  }
885
855
 
886
- //This first part of this condition will catch any NaN or Infinite values
887
- if ((diff * 0.0 != 0.0) || (pos_delta < diff))
856
+ /* This first part of this condition will catch any NaN or Infinite values */
857
+ if (isnan(diff) || isinf(diff) || (pos_delta < diff))
888
858
  {
889
859
  UnityTestResultsFailBegin(lineNumber);
890
860
  #ifdef UNITY_DOUBLE_VERBOSE
@@ -900,7 +870,7 @@ void UnityAssertDoublesWithin(const _UD delta,
900
870
  }
901
871
  }
902
872
 
903
- //-----------------------------------------------
873
+ /*-----------------------------------------------*/
904
874
 
905
875
  void UnityAssertDoubleSpecial(const _UD actual,
906
876
  const char* msg,
@@ -916,8 +886,8 @@ void UnityAssertDoubleSpecial(const _UD actual,
916
886
 
917
887
  switch(style)
918
888
  {
919
- //To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
920
- //We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise
889
+ /* To determine Inf / Neg Inf, we compare to an Inf / Neg Inf value we create on the fly
890
+ * We are using a variable to hold the zero value because some compilers complain about dividing by zero otherwise */
921
891
  case UNITY_FLOAT_IS_INF:
922
892
  case UNITY_FLOAT_IS_NOT_INF:
923
893
  is_trait = isinf(actual) & ispos(actual);
@@ -927,13 +897,13 @@ void UnityAssertDoubleSpecial(const _UD actual,
927
897
  is_trait = isinf(actual) & isneg(actual);
928
898
  break;
929
899
 
930
- //NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN.
900
+ /* NaN is the only floating point value that does NOT equal itself. Therefore if Actual == Actual, then it is NOT NaN. */
931
901
  case UNITY_FLOAT_IS_NAN:
932
902
  case UNITY_FLOAT_IS_NOT_NAN:
933
903
  is_trait = isnan(actual);
934
904
  break;
935
905
 
936
- //A determinate number is non infinite and not NaN. (therefore the opposite of the two above)
906
+ /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
937
907
  case UNITY_FLOAT_IS_DET:
938
908
  case UNITY_FLOAT_IS_NOT_DET:
939
909
  if (isinf(actual) | isnan(actual))
@@ -969,9 +939,9 @@ void UnityAssertDoubleSpecial(const _UD actual,
969
939
  }
970
940
 
971
941
 
972
- #endif // not UNITY_EXCLUDE_DOUBLE
942
+ #endif /* not UNITY_EXCLUDE_DOUBLE */
973
943
 
974
- //-----------------------------------------------
944
+ /*-----------------------------------------------*/
975
945
  void UnityAssertNumbersWithin( const _U_UINT delta,
976
946
  const _U_SINT expected,
977
947
  const _U_SINT actual,
@@ -1010,7 +980,7 @@ void UnityAssertNumbersWithin( const _U_UINT delta,
1010
980
  }
1011
981
  }
1012
982
 
1013
- //-----------------------------------------------
983
+ /*-----------------------------------------------*/
1014
984
  void UnityAssertEqualString(const char* expected,
1015
985
  const char* actual,
1016
986
  const char* msg,
@@ -1020,7 +990,7 @@ void UnityAssertEqualString(const char* expected,
1020
990
 
1021
991
  UNITY_SKIP_EXECUTION;
1022
992
 
1023
- // if both pointers not null compare the strings
993
+ /* if both pointers not null compare the strings */
1024
994
  if (expected && actual)
1025
995
  {
1026
996
  for (i = 0; expected[i] || actual[i]; i++)
@@ -1033,7 +1003,7 @@ void UnityAssertEqualString(const char* expected,
1033
1003
  }
1034
1004
  }
1035
1005
  else
1036
- { // handle case of one pointers being null (if both null, test should pass)
1006
+ { /* handle case of one pointers being null (if both null, test should pass) */
1037
1007
  if (expected != actual)
1038
1008
  {
1039
1009
  Unity.CurrentTestFailed = 1;
@@ -1049,7 +1019,7 @@ void UnityAssertEqualString(const char* expected,
1049
1019
  }
1050
1020
  }
1051
1021
 
1052
- //-----------------------------------------------
1022
+ /*-----------------------------------------------*/
1053
1023
  void UnityAssertEqualStringLen(const char* expected,
1054
1024
  const char* actual,
1055
1025
  const _UU32 length,
@@ -1060,7 +1030,7 @@ void UnityAssertEqualStringLen(const char* expected,
1060
1030
 
1061
1031
  UNITY_SKIP_EXECUTION;
1062
1032
 
1063
- // if both pointers not null compare the strings
1033
+ /* if both pointers not null compare the strings */
1064
1034
  if (expected && actual)
1065
1035
  {
1066
1036
  for (i = 0; (expected[i] || actual[i]) && i < length; i++)
@@ -1073,7 +1043,7 @@ void UnityAssertEqualStringLen(const char* expected,
1073
1043
  }
1074
1044
  }
1075
1045
  else
1076
- { // handle case of one pointers being null (if both null, test should pass)
1046
+ { /* handle case of one pointers being null (if both null, test should pass) */
1077
1047
  if (expected != actual)
1078
1048
  {
1079
1049
  Unity.CurrentTestFailed = 1;
@@ -1090,7 +1060,7 @@ void UnityAssertEqualStringLen(const char* expected,
1090
1060
  }
1091
1061
 
1092
1062
 
1093
- //-----------------------------------------------
1063
+ /*-----------------------------------------------*/
1094
1064
  void UnityAssertEqualStringArray( const char** expected,
1095
1065
  const char** actual,
1096
1066
  const _UU32 num_elements,
@@ -1101,13 +1071,10 @@ void UnityAssertEqualStringArray( const char** expected,
1101
1071
 
1102
1072
  UNITY_SKIP_EXECUTION;
1103
1073
 
1104
- // if no elements, it's an error
1074
+ /* if no elements, it's an error */
1105
1075
  if (num_elements == 0)
1106
1076
  {
1107
- UnityTestResultsFailBegin(lineNumber);
1108
- UnityPrint(UnityStrPointless);
1109
- UnityAddMsgIfSpecified(msg);
1110
- UNITY_FAIL_AND_BAIL;
1077
+ UnityPrintPointlessAndBail();
1111
1078
  }
1112
1079
 
1113
1080
  if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1)
@@ -1115,7 +1082,7 @@ void UnityAssertEqualStringArray( const char** expected,
1115
1082
 
1116
1083
  do
1117
1084
  {
1118
- // if both pointers not null compare the strings
1085
+ /* if both pointers not null compare the strings */
1119
1086
  if (expected[j] && actual[j])
1120
1087
  {
1121
1088
  for (i = 0; expected[j][i] || actual[j][i]; i++)
@@ -1128,7 +1095,7 @@ void UnityAssertEqualStringArray( const char** expected,
1128
1095
  }
1129
1096
  }
1130
1097
  else
1131
- { // handle case of one pointers being null (if both null, test should pass)
1098
+ { /* handle case of one pointers being null (if both null, test should pass) */
1132
1099
  if (expected[j] != actual[j])
1133
1100
  {
1134
1101
  Unity.CurrentTestFailed = 1;
@@ -1150,7 +1117,7 @@ void UnityAssertEqualStringArray( const char** expected,
1150
1117
  } while (++j < num_elements);
1151
1118
  }
1152
1119
 
1153
- //-----------------------------------------------
1120
+ /*-----------------------------------------------*/
1154
1121
  void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
1155
1122
  UNITY_INTERNAL_PTR actual,
1156
1123
  const _UU32 length,
@@ -1167,10 +1134,7 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
1167
1134
 
1168
1135
  if ((elements == 0) || (length == 0))
1169
1136
  {
1170
- UnityTestResultsFailBegin(lineNumber);
1171
- UnityPrint(UnityStrPointless);
1172
- UnityAddMsgIfSpecified(msg);
1173
- UNITY_FAIL_AND_BAIL;
1137
+ UnityPrintPointlessAndBail();
1174
1138
  }
1175
1139
 
1176
1140
  if (UnityCheckArraysForNull((UNITY_INTERNAL_PTR)expected, (UNITY_INTERNAL_PTR)actual, lineNumber, msg) == 1)
@@ -1178,7 +1142,7 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
1178
1142
 
1179
1143
  while (elements--)
1180
1144
  {
1181
- /////////////////////////////////////
1145
+ /* /////////////////////////////////// */
1182
1146
  bytes = length;
1183
1147
  while (bytes--)
1184
1148
  {
@@ -1203,14 +1167,14 @@ void UnityAssertEqualMemory( UNITY_INTERNAL_PTR expected,
1203
1167
  ptr_exp = (UNITY_INTERNAL_PTR)((_UP)ptr_exp + 1);
1204
1168
  ptr_act = (UNITY_INTERNAL_PTR)((_UP)ptr_act + 1);
1205
1169
  }
1206
- /////////////////////////////////////
1170
+ /* /////////////////////////////////// */
1207
1171
 
1208
1172
  }
1209
1173
  }
1210
1174
 
1211
- //-----------------------------------------------
1212
- // Control Functions
1213
- //-----------------------------------------------
1175
+ /*-----------------------------------------------
1176
+ * Control Functions
1177
+ *-----------------------------------------------*/
1214
1178
 
1215
1179
  void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
1216
1180
  {
@@ -1245,7 +1209,7 @@ void UnityFail(const char* msg, const UNITY_LINE_TYPE line)
1245
1209
  UNITY_FAIL_AND_BAIL;
1246
1210
  }
1247
1211
 
1248
- //-----------------------------------------------
1212
+ /*-----------------------------------------------*/
1249
1213
  void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
1250
1214
  {
1251
1215
  UNITY_SKIP_EXECUTION;
@@ -1261,7 +1225,7 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
1261
1225
  UNITY_IGNORE_AND_BAIL;
1262
1226
  }
1263
1227
 
1264
- //-----------------------------------------------
1228
+ /*-----------------------------------------------*/
1265
1229
  #if defined(UNITY_WEAK_ATTRIBUTE)
1266
1230
  UNITY_WEAK_ATTRIBUTE void setUp(void) { }
1267
1231
  UNITY_WEAK_ATTRIBUTE void tearDown(void) { }
@@ -1271,7 +1235,7 @@ void UnityIgnore(const char* msg, const UNITY_LINE_TYPE line)
1271
1235
  # pragma weak tearDown
1272
1236
  void tearDown(void) { }
1273
1237
  #endif
1274
- //-----------------------------------------------
1238
+ /*-----------------------------------------------*/
1275
1239
  void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int FuncLineNum)
1276
1240
  {
1277
1241
  Unity.CurrentTestName = FuncName;
@@ -1290,7 +1254,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
1290
1254
  UnityConcludeTest();
1291
1255
  }
1292
1256
 
1293
- //-----------------------------------------------
1257
+ /*-----------------------------------------------*/
1294
1258
  void UnityBegin(const char* filename)
1295
1259
  {
1296
1260
  Unity.TestFile = filename;
@@ -1306,7 +1270,7 @@ void UnityBegin(const char* filename)
1306
1270
  UNITY_OUTPUT_START();
1307
1271
  }
1308
1272
 
1309
- //-----------------------------------------------
1273
+ /*-----------------------------------------------*/
1310
1274
  int UnityEnd(void)
1311
1275
  {
1312
1276
  UNITY_PRINT_EOL();
@@ -1326,10 +1290,189 @@ int UnityEnd(void)
1326
1290
  else
1327
1291
  {
1328
1292
  UnityPrintFail();
1293
+ #ifdef UNITY_DIFFERENTIATE_FINAL_FAIL
1294
+ UNITY_OUTPUT_CHAR('E'); UNITY_OUTPUT_CHAR('D');
1295
+ #endif
1329
1296
  }
1330
1297
  UNITY_PRINT_EOL();
1298
+ UNITY_FLUSH_CALL();
1331
1299
  UNITY_OUTPUT_COMPLETE();
1332
1300
  return (int)(Unity.TestFailures);
1333
1301
  }
1334
1302
 
1335
- //-----------------------------------------------
1303
+ /*-----------------------------------------------
1304
+ * Command Line Argument Support
1305
+ *-----------------------------------------------*/
1306
+ #ifdef UNITY_USE_COMMAND_LINE_ARGS
1307
+
1308
+ char* UnityOptionIncludeNamed = NULL;
1309
+ char* UnityOptionExcludeNamed = NULL;
1310
+ int UnityVerbosity = 1;
1311
+
1312
+ int UnityParseOptions(int argc, char** argv)
1313
+ {
1314
+ UnityOptionIncludeNamed = NULL;
1315
+ UnityOptionExcludeNamed = NULL;
1316
+
1317
+ for (int i = 1; i < argc; i++)
1318
+ {
1319
+ if (argv[i][0] == '-')
1320
+ {
1321
+ switch(argv[i][1])
1322
+ {
1323
+ case 'l': /* list tests */
1324
+ return -1;
1325
+ case 'n': /* include tests with name including this string */
1326
+ case 'f': /* an alias for -n */
1327
+ if (argv[i][2] == '=')
1328
+ UnityOptionIncludeNamed = &argv[i][3];
1329
+ else if (++i < argc)
1330
+ UnityOptionIncludeNamed = argv[i];
1331
+ else
1332
+ {
1333
+ UnityPrint("ERROR: No Test String to Include Matches For");
1334
+ UNITY_PRINT_EOL();
1335
+ return 1;
1336
+ }
1337
+ break;
1338
+ case 'q': /* quiet */
1339
+ UnityVerbosity = 0;
1340
+ break;
1341
+ case 'v': /* verbose */
1342
+ UnityVerbosity = 2;
1343
+ break;
1344
+ case 'x': /* exclude tests with name including this string */
1345
+ if (argv[i][2] == '=')
1346
+ UnityOptionExcludeNamed = &argv[i][3];
1347
+ else if (++i < argc)
1348
+ UnityOptionExcludeNamed = argv[i];
1349
+ else
1350
+ {
1351
+ UnityPrint("ERROR: No Test String to Exclude Matches For");
1352
+ UNITY_PRINT_EOL();
1353
+ return 1;
1354
+ }
1355
+ break;
1356
+ default:
1357
+ UnityPrint("ERROR: Unknown Option ");
1358
+ UNITY_OUTPUT_CHAR(argv[i][1]);
1359
+ UNITY_PRINT_EOL();
1360
+ return 1;
1361
+ }
1362
+ }
1363
+ }
1364
+
1365
+ return 0;
1366
+ }
1367
+
1368
+ int IsStringInBiggerString(const char* longstring, const char* shortstring)
1369
+ {
1370
+ char* lptr = (char*)longstring;
1371
+ char* sptr = (char*)shortstring;
1372
+ char* lnext = lptr;
1373
+
1374
+ if (*sptr == '*')
1375
+ return 1;
1376
+
1377
+ while (*lptr)
1378
+ {
1379
+ lnext = lptr + 1;
1380
+
1381
+ /* If they current bytes match, go on to the next bytes */
1382
+ while (*lptr && *sptr && (*lptr == *sptr))
1383
+ {
1384
+ lptr++;
1385
+ sptr++;
1386
+
1387
+ /* We're done if we match the entire string or up to a wildcard */
1388
+ if (*sptr == '*')
1389
+ return 1;
1390
+ if (*sptr == ',')
1391
+ return 1;
1392
+ if (*sptr == '"')
1393
+ return 1;
1394
+ if (*sptr == '\'')
1395
+ return 1;
1396
+ if (*sptr == ':')
1397
+ return 2;
1398
+ if (*sptr == 0)
1399
+ return 1;
1400
+ }
1401
+
1402
+ /* Otherwise we start in the long pointer 1 character further and try again */
1403
+ lptr = lnext;
1404
+ sptr = (char*)shortstring;
1405
+ }
1406
+ return 0;
1407
+ }
1408
+
1409
+ int UnityStringArgumentMatches(const char* str)
1410
+ {
1411
+ int retval;
1412
+ const char* ptr1;
1413
+ const char* ptr2;
1414
+ const char* ptrf;
1415
+
1416
+ //Go through the options and get the substrings for matching one at a time
1417
+ ptr1 = str;
1418
+ while (ptr1[0] != 0)
1419
+ {
1420
+ if ((ptr1[0] == '"') || (ptr1[0] == '\''))
1421
+ ptr1++;
1422
+
1423
+ //look for the start of the next partial
1424
+ ptr2 = ptr1;
1425
+ ptrf = 0;
1426
+ do {
1427
+ ptr2++;
1428
+ if ((ptr2[0] == ':') && (ptr2[1] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','))
1429
+ ptrf = &ptr2[1];
1430
+ } while ((ptr2[0] != 0) && (ptr2[0] != '\'') && (ptr2[0] != '"') && (ptr2[0] != ','));
1431
+ while ((ptr2[0] != 0) && ((ptr2[0] == ':') || (ptr2[0] == '\'') || (ptr2[0] == '"') || (ptr2[0] == ',')))
1432
+ ptr2++;
1433
+
1434
+ //done if complete filename match
1435
+ retval = IsStringInBiggerString(Unity.TestFile, ptr1);
1436
+ if (retval == 1)
1437
+ return retval;
1438
+
1439
+ //done if testname match after filename partial match
1440
+ if ((retval == 2) && (ptrf != 0))
1441
+ {
1442
+ if (IsStringInBiggerString(Unity.CurrentTestName, ptrf))
1443
+ return 1;
1444
+ }
1445
+
1446
+ //done if complete testname match
1447
+ if (IsStringInBiggerString(Unity.CurrentTestName, ptr1) == 1)
1448
+ return 1;
1449
+
1450
+ ptr1 = ptr2;
1451
+ }
1452
+
1453
+ //we couldn't find a match for any substrings
1454
+ return 0;
1455
+ }
1456
+
1457
+ int UnityTestMatches(void)
1458
+ {
1459
+ /* Check if this test name matches the included test pattern */
1460
+ int retval;
1461
+ if (UnityOptionIncludeNamed)
1462
+ {
1463
+ retval = UnityStringArgumentMatches(UnityOptionIncludeNamed);
1464
+ }
1465
+ else
1466
+ retval = 1;
1467
+
1468
+ /* Check if this test name matches the excluded test pattern */
1469
+ if (UnityOptionExcludeNamed)
1470
+ {
1471
+ if (UnityStringArgumentMatches(UnityOptionExcludeNamed))
1472
+ retval = 0;
1473
+ }
1474
+ return retval;
1475
+ }
1476
+
1477
+ #endif /* UNITY_USE_COMMAND_LINE_ARGS */
1478
+ /*-----------------------------------------------*/