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
@@ -72,7 +72,7 @@ extern volatile CEXCEPTION_FRAME_T CExceptionFrames[];
72
72
  { \
73
73
  jmp_buf *PrevFrame, NewFrame; \
74
74
  unsigned int MY_ID = CEXCEPTION_GET_ID; \
75
- PrevFrame = CExceptionFrames[CEXCEPTION_GET_ID].pFrame; \
75
+ PrevFrame = CExceptionFrames[MY_ID].pFrame; \
76
76
  CExceptionFrames[MY_ID].pFrame = (jmp_buf*)(&NewFrame); \
77
77
  CExceptionFrames[MY_ID].Exception = CEXCEPTION_NONE; \
78
78
  CEXCEPTION_HOOK_START_TRY; \
@@ -2,7 +2,7 @@
2
2
  # Unity Project - A Test Framework 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
  # This script creates all the files with start code necessary for a new module.
8
8
  # A simple module only requires a source file, header file, and test file.
@@ -32,20 +32,20 @@ HELP_TEXT = [ "\nGENERATE MODULE\n-------- ------",
32
32
 
33
33
  #Built in patterns
34
34
  PATTERNS = { 'src' => {'' => { :inc => [] } },
35
- 'dh' => {'Driver' => { :inc => ['%1$sHardware.h'] },
36
- 'Hardware' => { :inc => [] }
35
+ 'dh' => {'Driver' => { :inc => ['%1$sHardware.h'] },
36
+ 'Hardware' => { :inc => [] }
37
37
  },
38
- 'dih' => {'Driver' => { :inc => ['%1$sHardware.h', '%1$sInterrupt.h'] },
38
+ 'dih' => {'Driver' => { :inc => ['%1$sHardware.h', '%1$sInterrupt.h'] },
39
39
  'Interrupt'=> { :inc => ['%1$sHardware.h'] },
40
- 'Hardware' => { :inc => [] }
40
+ 'Hardware' => { :inc => [] }
41
41
  },
42
- 'mch' => {'Model' => { :inc => [] },
42
+ 'mch' => {'Model' => { :inc => [] },
43
43
  'Conductor'=> { :inc => ['%1$sModel.h', '%1$sHardware.h'] },
44
- 'Hardware' => { :inc => [] }
44
+ 'Hardware' => { :inc => [] }
45
45
  },
46
- 'mvp' => {'Model' => { :inc => [] },
46
+ 'mvp' => {'Model' => { :inc => [] },
47
47
  'Presenter'=> { :inc => ['%1$sModel.h', '%1$sView.h'] },
48
- 'View' => { :inc => [] }
48
+ 'View' => { :inc => [] }
49
49
  }
50
50
  }
51
51
 
@@ -63,7 +63,7 @@ void tearDown(void)
63
63
 
64
64
  void test_%1$s_NeedToImplement(void)
65
65
  {
66
- TEST_IGNORE();
66
+ TEST_IGNORE_MESSAGE("Need to Implement %1$s");
67
67
  }
68
68
  ]
69
69
 
@@ -91,7 +91,7 @@ ARGV.each do |arg|
91
91
  when /^(\w+)/
92
92
  raise "ERROR: You can't have more than one Module name specified!" unless @module_name.nil?
93
93
  @module_name = arg
94
- when /^-(h|-help)/
94
+ when /^-(h|-help)/
95
95
  puts HELP_TEXT
96
96
  exit
97
97
  else
@@ -126,7 +126,7 @@ end
126
126
  @includes.merge!(@extra_inc) unless @extra_inc.nil?
127
127
 
128
128
  #create triad definition
129
- TRIAD = [ { :ext => '.c', :path => @path_src, :template => TEMPLATE_SRC, :inc => :src, :boilerplate => @boilerplates[:src] },
129
+ TRIAD = [ { :ext => '.c', :path => @path_src, :template => TEMPLATE_SRC, :inc => :src, :boilerplate => @boilerplates[:src] },
130
130
  { :ext => '.h', :path => @path_inc, :template => TEMPLATE_INC, :inc => :inc, :boilerplate => @boilerplates[:inc] },
131
131
  { :ext => '.c', :path => @path_tst+'Test', :template => TEMPLATE_TST, :inc => :tst, :boilerplate => @boilerplates[:tst] },
132
132
  ]
@@ -159,7 +159,7 @@ if @destroy
159
159
  file = filespec[:path]
160
160
  if File.exist?(file)
161
161
  if @update_svn
162
- `svn delete \"#{file}\" --force`
162
+ `svn delete \"#{file}\" --force`
163
163
  puts "File #{file} deleted and removed from source control"
164
164
  else
165
165
  FileUtils.remove(file)
@@ -182,13 +182,13 @@ end
182
182
  files.each_with_index do |file, i|
183
183
  File.open(file[:path], 'w') do |f|
184
184
  f.write(file[:boilerplate] % [file[:name]]) unless file[:boilerplate].nil?
185
- f.write(file[:template] % [ file[:name],
186
- file[:includes].map{|f| "#include \"#{f}\"\n"}.join,
185
+ f.write(file[:template] % [ file[:name],
186
+ file[:includes].map{|f| "#include \"#{f}\"\n"}.join,
187
187
  file[:name].upcase ]
188
188
  )
189
189
  end
190
190
  if (@update_svn)
191
- `svn add \"#{file[:path]}\"`
191
+ `svn add \"#{file[:path]}\"`
192
192
  if $?.exitstatus == 0
193
193
  puts "File #{file[:path]} created and added to source control"
194
194
  else
@@ -22,13 +22,16 @@ class UnityTestRunnerGenerator
22
22
 
23
23
  def self.default_options
24
24
  {
25
- :includes => [],
26
- :plugins => [],
27
- :framework => :unity,
28
- :test_prefix => "test|spec|should",
29
- :setup_name => "setUp",
30
- :teardown_name => "tearDown",
31
- :main_name => "main",
25
+ :includes => [],
26
+ :plugins => [],
27
+ :framework => :unity,
28
+ :test_prefix => "test|spec|should",
29
+ :setup_name => "setUp",
30
+ :teardown_name => "tearDown",
31
+ :main_name => "main", #set to :auto to automatically generate each time
32
+ :main_export_decl => "",
33
+ :cmdline_args => false,
34
+ :use_param_tests => false,
32
35
  }
33
36
  end
34
37
 
@@ -158,7 +161,7 @@ class UnityTestRunnerGenerator
158
161
  def create_header(output, mocks, testfile_includes=[])
159
162
  output.puts('/* AUTOGENERATED FILE. DO NOT EDIT. */')
160
163
  create_runtest(output, mocks)
161
- output.puts("\n//=======Automagically Detected Files To Include=====")
164
+ output.puts("\n/*=======Automagically Detected Files To Include=====*/")
162
165
  output.puts("#include \"#{@options[:framework].to_s}.h\"")
163
166
  output.puts('#include "cmock.h"') unless (mocks.empty?)
164
167
  output.puts('#include <setjmp.h>')
@@ -186,7 +189,7 @@ class UnityTestRunnerGenerator
186
189
  end
187
190
 
188
191
  def create_externs(output, tests, mocks)
189
- output.puts("\n//=======External Functions This Runner Calls=====")
192
+ output.puts("\n/*=======External Functions This Runner Calls=====*/")
190
193
  output.puts("extern void #{@options[:setup_name]}(void);")
191
194
  output.puts("extern void #{@options[:teardown_name]}(void);")
192
195
  tests.each do |test|
@@ -197,7 +200,7 @@ class UnityTestRunnerGenerator
197
200
 
198
201
  def create_mock_management(output, mock_headers)
199
202
  unless (mock_headers.empty?)
200
- output.puts("\n//=======Mock Management=====")
203
+ output.puts("\n/*=======Mock Management=====*/")
201
204
  output.puts("static void CMock_Init(void)")
202
205
  output.puts("{")
203
206
  if @options[:enforce_strict_ordering]
@@ -232,14 +235,14 @@ class UnityTestRunnerGenerator
232
235
 
233
236
  def create_suite_setup_and_teardown(output)
234
237
  unless (@options[:suite_setup].nil?)
235
- output.puts("\n//=======Suite Setup=====")
236
- output.puts("static int suite_setup(void)")
238
+ output.puts("\n/*=======Suite Setup=====*/")
239
+ output.puts("static void suite_setup(void)")
237
240
  output.puts("{")
238
241
  output.puts(@options[:suite_setup])
239
242
  output.puts("}")
240
243
  end
241
244
  unless (@options[:suite_teardown].nil?)
242
- output.puts("\n//=======Suite Teardown=====")
245
+ output.puts("\n/*=======Suite Teardown=====*/")
243
246
  output.puts("static int suite_teardown(int num_failures)")
244
247
  output.puts("{")
245
248
  output.puts(@options[:suite_teardown])
@@ -251,12 +254,13 @@ class UnityTestRunnerGenerator
251
254
  cexception = @options[:plugins].include? :cexception
252
255
  va_args1 = @options[:use_param_tests] ? ', ...' : ''
253
256
  va_args2 = @options[:use_param_tests] ? '__VA_ARGS__' : ''
254
- output.puts("\n//=======Test Runner Used To Run Each Test Below=====")
257
+ output.puts("\n/*=======Test Runner Used To Run Each Test Below=====*/")
255
258
  output.puts("#define RUN_TEST_NO_ARGS") if @options[:use_param_tests]
256
259
  output.puts("#define RUN_TEST(TestFunc, TestLineNum#{va_args1}) \\")
257
260
  output.puts("{ \\")
258
261
  output.puts(" Unity.CurrentTestName = #TestFunc#{va_args2.empty? ? '' : " \"(\" ##{va_args2} \")\""}; \\")
259
262
  output.puts(" Unity.CurrentTestLineNumber = TestLineNum; \\")
263
+ output.puts(" if (UnityTestMatches()) { \\") if (@options[:cmdline_args])
260
264
  output.puts(" Unity.NumberOfTests++; \\")
261
265
  output.puts(" CMock_Init(); \\") unless (used_mocks.empty?)
262
266
  output.puts(" UNITY_CLR_DETAILS(); \\") unless (used_mocks.empty?)
@@ -275,11 +279,12 @@ class UnityTestRunnerGenerator
275
279
  output.puts(" } \\")
276
280
  output.puts(" CMock_Destroy(); \\") unless (used_mocks.empty?)
277
281
  output.puts(" UnityConcludeTest(); \\")
282
+ output.puts(" } \\") if (@options[:cmdline_args])
278
283
  output.puts("}\n")
279
284
  end
280
285
 
281
286
  def create_reset(output, used_mocks)
282
- output.puts("\n//=======Test Reset Option=====")
287
+ output.puts("\n/*=======Test Reset Option=====*/")
283
288
  output.puts("void resetTest(void);")
284
289
  output.puts("void resetTest(void)")
285
290
  output.puts("{")
@@ -292,14 +297,49 @@ class UnityTestRunnerGenerator
292
297
  end
293
298
 
294
299
  def create_main(output, filename, tests, used_mocks)
295
- output.puts("\n\n//=======MAIN=====")
296
- if (@options[:main_name] != "main")
297
- output.puts("int #{@options[:main_name]}(void);")
300
+ output.puts("\n\n/*=======MAIN=====*/")
301
+ main_name = (@options[:main_name].to_sym == :auto) ? "main_#{filename.gsub('.c','')}" : "#{@options[:main_name]}"
302
+ if (@options[:cmdline_args])
303
+ if (main_name != "main")
304
+ output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv);")
305
+ end
306
+ output.puts("#{@options[:main_export_decl]} int #{main_name}(int argc, char** argv)")
307
+ output.puts("{")
308
+ output.puts(" int parse_status = UnityParseOptions(argc, argv);")
309
+ output.puts(" if (parse_status != 0)")
310
+ output.puts(" {")
311
+ output.puts(" if (parse_status < 0)")
312
+ output.puts(" {")
313
+ output.puts(" UnityPrint(\"#{filename.gsub('.c','')}.\");")
314
+ output.puts(" UNITY_PRINT_EOL();")
315
+ if (@options[:use_param_tests])
316
+ tests.each do |test|
317
+ if ((test[:args].nil?) or (test[:args].empty?))
318
+ output.puts(" UnityPrint(\" #{test[:test]}(RUN_TEST_NO_ARGS)\");")
319
+ output.puts(" UNITY_PRINT_EOL();")
320
+ else
321
+ test[:args].each do |args|
322
+ output.puts(" UnityPrint(\" #{test[:test]}(#{args})\");")
323
+ output.puts(" UNITY_PRINT_EOL();")
324
+ end
325
+ end
326
+ end
327
+ else
328
+ tests.each { |test| output.puts(" UnityPrint(\" #{test[:test]}\");\n UNITY_PRINT_EOL();")}
329
+ end
330
+ output.puts(" return 0;")
331
+ output.puts(" }")
332
+ output.puts(" return parse_status;")
333
+ output.puts(" }")
334
+ else
335
+ if (main_name != "main")
336
+ output.puts("#{@options[:main_export_decl]} int #{main_name}(void);")
337
+ end
338
+ output.puts("int #{main_name}(void)")
339
+ output.puts("{")
298
340
  end
299
- output.puts("int #{@options[:main_name]}(void)")
300
- output.puts("{")
301
341
  output.puts(" suite_setup();") unless @options[:suite_setup].nil?
302
- output.puts(" UnityBegin(\"#{filename.gsub(/\\/,'\\\\')}\");")
342
+ output.puts(" UnityBegin(\"#{filename.gsub(/\\/,'\\\\\\')}\");")
303
343
  if (@options[:use_param_tests])
304
344
  tests.each do |test|
305
345
  if ((test[:args].nil?) or (test[:args].empty?))
@@ -97,7 +97,11 @@ class UnityToJUnit
97
97
  #use line[0] from the test output to get the test_file path and name
98
98
  test_file_str = lines[0].gsub("\\","/")
99
99
  test_file_str = test_file_str.split(":")
100
- test_file = test_file_str[0] + ':' + test_file_str[1]
100
+ test_file = if (test_file_str.length < 2)
101
+ result_file
102
+ else
103
+ test_file_str[0] + ':' + test_file_str[1]
104
+ end
101
105
  result_output[:source][:path] = File.dirname(test_file)
102
106
  result_output[:source][:file] = File.basename(test_file)
103
107
 
@@ -0,0 +1,146 @@
1
+ import sys
2
+ import os
3
+ from glob import glob
4
+
5
+ from pyparsing import *
6
+ from junit_xml import TestSuite, TestCase
7
+
8
+
9
+ class UnityTestSummary:
10
+ def __init__(self):
11
+ self.report = ''
12
+ self.total_tests = 0
13
+ self.failures = 0
14
+ self.ignored = 0
15
+ self.targets = 0
16
+ self.root = None
17
+ self.test_suites = dict()
18
+
19
+ def run(self):
20
+ # Clean up result file names
21
+ results = []
22
+ for target in self.targets:
23
+ results.append(target.replace('\\', '/'))
24
+
25
+ # Dig through each result file, looking for details on pass/fail:
26
+ for result_file in results:
27
+ lines = list(map(lambda line: line.rstrip(), open(result_file, "r").read().split('\n')))
28
+ if len(lines) == 0:
29
+ raise Exception("Empty test result file: %s" % result_file)
30
+
31
+ # define an expression for your file reference
32
+ entry_one = Combine(
33
+ oneOf(list(alphas)) + ':/' +
34
+ Word(alphanums + '_-./'))
35
+
36
+ entry_two = Word(printables + ' ', excludeChars=':')
37
+ entry = entry_one | entry_two
38
+
39
+ delimiter = Literal(':').suppress()
40
+ tc_result_line = Group(entry.setResultsName('tc_file_name') + delimiter + entry.setResultsName(
41
+ 'tc_line_nr') + delimiter + entry.setResultsName('tc_name') + delimiter + entry.setResultsName(
42
+ 'tc_status') + Optional(
43
+ delimiter + entry.setResultsName('tc_msg'))).setResultsName("tc_line")
44
+
45
+ eol = LineEnd().suppress()
46
+ sol = LineStart().suppress()
47
+ blank_line = sol + eol
48
+
49
+ tc_summary_line = Group(Word(nums).setResultsName("num_of_tests") + "Tests" + Word(nums).setResultsName(
50
+ "num_of_fail") + "Failures" + Word(nums).setResultsName("num_of_ignore") + "Ignored").setResultsName(
51
+ "tc_summary")
52
+ tc_end_line = Or(Literal("FAIL"), Literal('Ok')).setResultsName("tc_result")
53
+
54
+ # run it and see...
55
+ pp1 = tc_result_line | Optional(tc_summary_line | tc_end_line)
56
+ pp1.ignore(blank_line | OneOrMore("-"))
57
+
58
+ result = list()
59
+ for l in lines:
60
+ result.append((pp1.parseString(l)).asDict())
61
+ # delete empty results
62
+ result = filter(None, result)
63
+
64
+ tc_list = list()
65
+ for r in result:
66
+ if 'tc_line' in r:
67
+ tmp_tc_line = r['tc_line']
68
+
69
+ # get only the file name which will be used as the classname
70
+ file_name = tmp_tc_line['tc_file_name'].split('\\').pop().split('/').pop().rsplit('.', 1)[0]
71
+ tmp_tc = TestCase(name=tmp_tc_line['tc_name'], classname=file_name)
72
+ if 'tc_status' in tmp_tc_line:
73
+ if str(tmp_tc_line['tc_status']) == 'IGNORE':
74
+ if 'tc_msg' in tmp_tc_line:
75
+ tmp_tc.add_skipped_info(message=tmp_tc_line['tc_msg'],
76
+ output=r'[File]={0}, [Line]={1}'.format(
77
+ tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr']))
78
+ else:
79
+ tmp_tc.add_skipped_info(message=" ")
80
+ elif str(tmp_tc_line['tc_status']) == 'FAIL':
81
+ if 'tc_msg' in tmp_tc_line:
82
+ tmp_tc.add_failure_info(message=tmp_tc_line['tc_msg'],
83
+ output=r'[File]={0}, [Line]={1}'.format(
84
+ tmp_tc_line['tc_file_name'], tmp_tc_line['tc_line_nr']))
85
+ else:
86
+ tmp_tc.add_failure_info(message=" ")
87
+
88
+ tc_list.append((str(result_file), tmp_tc))
89
+
90
+ for k, v in tc_list:
91
+ try:
92
+ self.test_suites[k].append(v)
93
+ except KeyError:
94
+ self.test_suites[k] = [v]
95
+ ts = []
96
+ for suite_name in self.test_suites:
97
+ ts.append(TestSuite(suite_name, self.test_suites[suite_name]))
98
+
99
+ with open('result.xml', 'w') as f:
100
+ TestSuite.to_file(f, ts, prettyprint='True', encoding='utf-8')
101
+
102
+ return self.report
103
+
104
+ def set_targets(self, target_array):
105
+ self.targets = target_array
106
+
107
+ def set_root_path(self, path):
108
+ self.root = path
109
+
110
+ @staticmethod
111
+ def usage(err_msg=None):
112
+ print("\nERROR: ")
113
+ if err_msg:
114
+ print(err_msg)
115
+ print("\nUsage: unity_test_summary.py result_file_directory/ root_path/")
116
+ print(" result_file_directory - The location of your results files.")
117
+ print(" Defaults to current directory if not specified.")
118
+ print(" Should end in / if specified.")
119
+ print(" root_path - Helpful for producing more verbose output if using relative paths.")
120
+ sys.exit(1)
121
+
122
+
123
+ if __name__ == '__main__':
124
+ uts = UnityTestSummary()
125
+ try:
126
+ # look in the specified or current directory for result files
127
+ if len(sys.argv) > 1:
128
+ targets_dir = sys.argv[1]
129
+ else:
130
+ targets_dir = './'
131
+ targets = list(map(lambda x: x.replace('\\', '/'), glob(targets_dir + '*.test*')))
132
+ if len(targets) == 0:
133
+ raise Exception("No *.testpass or *.testfail files found in '%s'" % targets_dir)
134
+ uts.set_targets(targets)
135
+
136
+ # set the root path
137
+ if len(sys.argv) > 2:
138
+ root_path = sys.argv[2]
139
+ else:
140
+ root_path = os.path.split(__file__)[0]
141
+ uts.set_root_path(root_path)
142
+
143
+ # run the summarizer
144
+ print(uts.run())
145
+ except Exception as e:
146
+ UnityTestSummary.usage(e)
@@ -26,7 +26,7 @@ endif
26
26
  UNITY_ROOT=../..
27
27
  C_COMPILER=gcc
28
28
 
29
- CFLAGS=-std=c99
29
+ CFLAGS=-std=c89
30
30
  CFLAGS += -Wall
31
31
  CFLAGS += -Wextra
32
32
  CFLAGS += -Werror
@@ -2,18 +2,18 @@
2
2
  #include "ProductionCode.h"
3
3
 
4
4
  int Counter = 0;
5
- int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; //some obnoxious array to search that is 1-based indexing instead of 0.
5
+ int NumbersToFind[9] = { 0, 34, 55, 66, 32, 11, 1, 77, 888 }; /* some obnoxious array to search that is 1-based indexing instead of 0. */
6
6
 
7
- // This function is supposed to search through NumbersToFind and find a particular number.
8
- // If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since
9
- // NumbersToFind is indexed from 1. Unfortunately it's broken
10
- // (and should therefore be caught by our tests)
7
+ /* This function is supposed to search through NumbersToFind and find a particular number.
8
+ * If it finds it, the index is returned. Otherwise 0 is returned which sorta makes sense since
9
+ * NumbersToFind is indexed from 1. Unfortunately it's broken
10
+ * (and should therefore be caught by our tests) */
11
11
  int FindFunction_WhichIsBroken(int NumberToFind)
12
12
  {
13
13
  int i = 0;
14
- while (i <= 8) //Notice I should have been in braces
14
+ while (i <= 8) /* Notice I should have been in braces */
15
15
  i++;
16
- if (NumbersToFind[i] == NumberToFind) //Yikes! I'm getting run after the loop finishes instead of during it!
16
+ if (NumbersToFind[i] == NumberToFind) /* Yikes! I'm getting run after the loop finishes instead of during it! */
17
17
  return i;
18
18
  return 0;
19
19
  }