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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76c3dcdc10485c56db2c7327e5f9efac6295863c
4
- data.tar.gz: 36798430e42c735498bcaca6b7a93c031b1c3adb
3
+ metadata.gz: fef79035eb5bbe9732905e831e227da8e2a8b788
4
+ data.tar.gz: 6c9c2c4b267ecec0395ef6c0028a4595f12dc8a7
5
5
  SHA512:
6
- metadata.gz: 4b950c43a03327774484752588af61ced5f7b96e6f0421442f0f007e9ebfb644703250e4859b6317bcceca7fe7ce11a39d6b989b44e67366cd2bf25b33134015
7
- data.tar.gz: 9be1131263be5c666088cae3c37e0452e7e7cbfd9b2bf91e400a36fe7890b4a5165fd3a888e37f39c7911a091b92ca0a0664d3592bcf0e9ef74993599202ffb5
6
+ metadata.gz: 95336d639633c43a5ecb27745fd4452645bd53a81b45715891f056aa660a581329f9fc7f326d1366ce2082a780fcd8ae74824a1eea91d9930f8c464b5e1059d2
7
+ data.tar.gz: b27f3cc0aef83627c2669ac2b0f23e4583906a724e30cfb58809cad4675ac37f8f2cde09710606383c06564558c7561eb8be33b85279063a0a1c1480e58bfb06
data/Gemfile CHANGED
@@ -9,3 +9,6 @@ gem "constructor"
9
9
  gem "diy"
10
10
  gem "rr"
11
11
  gem "thor"
12
+
13
+ #gem "pty", :platforms => [ :ruby ] #automatically included on *nix platforms
14
+ gem "popen4", :platforms => [ :mswin ]
data/Gemfile.lock CHANGED
@@ -30,6 +30,7 @@ DEPENDENCIES
30
30
  bundler (>= 1.3.5)
31
31
  constructor
32
32
  diy
33
+ popen4
33
34
  rake (>= 0.9.2.2)
34
35
  require_all
35
36
  rr
data/Rakefile CHANGED
@@ -7,4 +7,5 @@ RSpec::Core::RakeTask.new(:spec) do |t|
7
7
  t.pattern = 'spec/**/*_spec.rb'
8
8
  end
9
9
 
10
+ task :default => [:spec]
10
11
  task :ci => [:spec]
data/bin/ceedling CHANGED
@@ -44,7 +44,11 @@ unless (File.exists?("project.yml"))
44
44
  'docs/CeedlingPacket.pdf',
45
45
  'vendor/c_exception/docs/CExceptionSummary.pdf',
46
46
  'vendor/cmock/docs/CMock Summary.pdf',
47
- 'vendor/unity/docs/Unity Summary.pdf',
47
+ 'vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf',
48
+ 'vendor/unity/docs/UnityAssertionsReference.pdf',
49
+ 'vendor/unity/docs/UnityConfigurationGuide.pdf',
50
+ 'vendor/unity/docs/UnityGettingStartedGuide.pdf',
51
+ 'vendor/unity/docs/UnityHelperScriptsGuide.pdf',
48
52
  ]
49
53
 
50
54
  doc_files.each do |f|
@@ -143,11 +147,56 @@ unless (File.exists?("project.yml"))
143
147
 
144
148
  #===================================== We Have A Project Already ================================================
145
149
  else
150
+ begin
151
+ require 'pty'
152
+
153
+ #if available, we use PTY because it will live-stream our data instead of buffering it all up
154
+ def spawn_command(cmd, &block)
155
+ begin
156
+ PTY.spawn(cmd) do |stdout, stdin, pid|
157
+ begin
158
+ block.call(stdout)
159
+ rescue Errno::EIO
160
+ end
161
+ end
162
+ rescue Exception => e
163
+ STDERR.puts e.inspect unless (e == PTY::ChildExited)
164
+ end
165
+ end
166
+
167
+ rescue
146
168
 
147
- require 'pty'
169
+ begin
170
+
171
+ require 'popen4'
172
+
173
+ #if pty wasn't available, we'll use POPEN instead
174
+ def spawn_command(cmd, &block)
175
+ POpen4.popen4(cmd) do |stdout, stderr, stdin|
176
+ begin
177
+ block.call(stdout)
178
+ rescue Errno::EIO
179
+ end
180
+ end
181
+ end
182
+
183
+ rescue
184
+
185
+ #if neither of these libraries were available, we can just shell out to the command and collect results
186
+ def spawn_command(cmd, &block)
187
+ block.call( `#{cmd}` )
188
+ end
189
+ end
190
+
191
+ end
192
+
193
+ require 'curses'
148
194
  require 'yaml'
149
195
  require 'rbconfig'
150
196
 
197
+ Curses.init_screen()
198
+ cols = Curses.cols
199
+
151
200
  #determine platform
152
201
  platform = begin
153
202
  case(RbConfig::CONFIG['host_os'])
@@ -196,6 +245,8 @@ else
196
245
  abort
197
246
  when /--gtest/
198
247
  options[:pretend_we_are_gtest] = true
248
+ when /--debug/
249
+ options[:outfile] = "debug.txt"
199
250
  else
200
251
  options[:args] += v + " "
201
252
  end
@@ -211,37 +262,39 @@ else
211
262
  ENV["PATH"] = path
212
263
  end
213
264
 
265
+ if (options[:outfile])
266
+ f = File.open(options[:outfile],'w')
267
+ f << ARGV.inspect << "\n\n"
268
+ f << options.inspect << "\n\n"
269
+ end
270
+
214
271
  #run rake and capture all the output
215
- results = ""
216
272
  okay_to_print = !(options[:pretend_we_are_gtest])
217
- begin
218
- options[:cmd] = if (options[:pretest].nil? || options[:pretest].empty?)
219
- "rake #{options[:args]}"
220
- else
221
- "#{options[:pretest]} && rake #{options[:args]}"
222
- end
223
- PTY.spawn(options[:cmd]) do |stdout, stdin, pid|
224
- begin
225
- stdout.each do |line|
226
- okay_to_print = true if ((options[:pretend_we_are_gtest]) && (line.match(/\[\=+\]/)))
227
- line.gsub!(/(?<!\w)rake(?!\w)/,'ceedling') if (options[:args].strip == "-T")
228
- puts(line) if okay_to_print
273
+ options[:cmd] = if (options[:pretest].nil? || options[:pretest].empty?)
274
+ "rake #{options[:args]}"
275
+ else
276
+ "#{options[:pretest]} && rake #{options[:args]}"
277
+ end
278
+ spawn_command(options[:cmd]) do |stdout|
279
+ stdout.each do |line|
280
+ okay_to_print = true if ((options[:pretend_we_are_gtest]) && (line.match(/\[\=+\]/)))
281
+ if (okay_to_print)
282
+ f.puts(line) if (options[:outfile])
283
+ if (options[:args].strip == "-T")
284
+ line.gsub!(/(?<!\w)rake(?!\w)/,'ceedling')
285
+ if (line.length > cols)
286
+ endings = line.match(/[\r\n]+/)[0]
287
+ line.gsub!(endings,'')
288
+ line = line.slice(0, cols-3) + '...' + endings
289
+ end
229
290
  end
230
- rescue Errno::EIO
291
+ puts(line)
231
292
  end
232
293
  end
233
- rescue Exception => e
234
- results += e.inspect #unless (e == PTY::ChildExited)
235
294
  end
236
295
 
237
- #File.open("debug.txt",'w'){|f| f << ARGV.inspect << "\n\n" << options.inspect << "\n\n" << results }
238
-
239
- #dump the results back out stdout unless otherwise specified
240
- if (options[:outfile].nil?)
241
- puts results
242
- else
243
- File.open(options[:outfile],'w') {|f| f << results }
244
- end
296
+ f.close if options[:outfile]
297
+ true
245
298
 
246
299
  #===================================================================================================================
247
300
  end
@@ -19,14 +19,10 @@ class ConfiguratorPlugins
19
19
 
20
20
  config[:plugins][:enabled].each do |plugin|
21
21
  path = File.join(root, plugin, "lib")
22
- old_path = File.join( root, plugin )
23
22
 
24
23
  if ( not @file_wrapper.directory_listing( File.join( path, '*.rb' ) ).empty? )
25
24
  plugin_paths[(plugin + '_path').to_sym] = path
26
25
  @system_wrapper.add_load_path( path )
27
- elsif ( not @file_wrapper.directory_listing( File.join( old_path, '*.rb' ) ).empty? )
28
- plugin_paths[(plugin + '_path').to_sym] = old_path
29
- @system_wrapper.add_load_path( old_path )
30
26
  end
31
27
  end
32
28
  end
@@ -59,17 +55,11 @@ class ConfiguratorPlugins
59
55
  config[:plugins][:enabled].each do |plugin|
60
56
  script_plugin_path = File.join(root, plugin, "lib", "#{plugin}.rb")
61
57
 
62
- # Add the old path here to support legacy style. Eventaully remove.
63
- old_script_plugin_path = File.join(root, plugin, "#{plugin}.rb")
64
58
 
65
59
  if @file_wrapper.exist?(script_plugin_path) or @file_wrapper.exist?(old_script_plugin_path)
66
60
  @script_plugins << plugin
67
61
  end
68
62
 
69
- # Print depreciation warning.
70
- if @file_wrapper.exist?(old_script_plugin_path)
71
- $stderr.puts "WARNING: Depreciated plugin style used in #{plugin}. Use new directory structure!"
72
- end
73
63
  end
74
64
  end
75
65
 
@@ -85,14 +75,9 @@ class ConfiguratorPlugins
85
75
  config[:plugins][:enabled].each do |plugin|
86
76
  config_plugin_path = File.join(root, plugin, "config", "#{plugin}.yml")
87
77
 
88
- # Add the old path here to support legacy style. Eventaully remove.
89
- old_config_plugin_path = File.join(root, plugin, "#{plugin}.yml")
90
78
 
91
79
  if @file_wrapper.exist?(config_plugin_path)
92
80
  plugins_with_path << config_plugin_path
93
- elsif @file_wrapper.exist?(old_config_plugin_path)
94
- # there's a warning printed for this in find_script_plugins
95
- plugins_with_path << old_config_plugin_path
96
81
  end
97
82
  end
98
83
  end
@@ -108,12 +93,9 @@ class ConfiguratorPlugins
108
93
  config[:plugins][:load_paths].each do |root|
109
94
  config[:plugins][:enabled].each do |plugin|
110
95
  default_path = File.join(root, plugin, 'config', 'defaults.yml')
111
- old_default_path = File.join(root, plugin, 'defaults.yml')
112
96
 
113
97
  if @file_wrapper.exist?(default_path)
114
98
  defaults_with_path << default_path
115
- elsif @file_wrapper.exist?(old_default_path)
116
- defaults_with_path << old_default_path
117
99
  end
118
100
  end
119
101
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- rule(/#{CMOCK_MOCK_PREFIX}.+#{'\\'+EXTENSION_SOURCE}$/ => [
3
+ rule(/#{CMOCK_MOCK_PREFIX}[^\/\\]+#{'\\'+EXTENSION_SOURCE}$/ => [
4
4
  proc do |task_name|
5
5
  @ceedling[:file_finder].find_header_input_for_mock_file(task_name)
6
6
  end
@@ -69,12 +69,16 @@ end
69
69
  if (not ENVIRONMENT.empty?)
70
70
  desc "List all configured environment variables."
71
71
  task :environment do
72
+ env_list = []
72
73
  ENVIRONMENT.each do |env|
73
74
  env.each_key do |key|
74
75
  name = key.to_s.upcase
75
- puts " - #{name}: \"#{env[key]}\""
76
+ env_list.push(" - #{name}: \"#{env[key]}\"")
76
77
  end
77
78
  end
79
+ env_list.sort.each do |env_line|
80
+ puts env_line
81
+ end
78
82
  end
79
83
  end
80
84
 
@@ -1,9 +1,12 @@
1
1
  require 'ceedling/constants'
2
2
 
3
+ task :test => [:directories] do
4
+ @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS)
5
+ end
3
6
 
4
7
  namespace TEST_SYM do
5
-
6
- desc "Run all unit tests."
8
+
9
+ desc "Run all unit tests (also just 'test' works)."
7
10
  task :all => [:directories] do
8
11
  @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS)
9
12
  end
@@ -13,21 +16,21 @@ namespace TEST_SYM do
13
16
  message = "\nOops! '#{TEST_ROOT_NAME}:*' isn't a real task. " +
14
17
  "Use a real test or source file name (no path) in place of the wildcard.\n" +
15
18
  "Example: rake #{TEST_ROOT_NAME}:foo.c\n\n"
16
-
19
+
17
20
  @ceedling[:streaminator].stdout_puts( message )
18
21
  end
19
-
22
+
20
23
  desc "Run tests for changed files."
21
24
  task :delta => [:directories] do
22
25
  @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, TEST_SYM, {:force_run => false})
23
26
  end
24
-
27
+
25
28
  desc "Run tests by matching regular expression pattern."
26
29
  task :pattern, [:regex] => [:directories] do |t, args|
27
30
  matches = []
28
-
31
+
29
32
  COLLECTION_ALL_TESTS.each { |test| matches << test if (test =~ /#{args.regex}/) }
30
-
33
+
31
34
  if (matches.size > 0)
32
35
  @ceedling[:test_invoker].setup_and_invoke(matches, TEST_SYM, {:force_run => false})
33
36
  else
@@ -38,9 +41,9 @@ namespace TEST_SYM do
38
41
  desc "Run tests whose test path contains [dir] or [dir] substring."
39
42
  task :path, [:dir] => [:directories] do |t, args|
40
43
  matches = []
41
-
44
+
42
45
  COLLECTION_ALL_TESTS.each { |test| matches << test if File.dirname(test).include?(args.dir.gsub(/\\/, '/')) }
43
-
46
+
44
47
  if (matches.size > 0)
45
48
  @ceedling[:test_invoker].setup_and_invoke(matches, TEST_SYM, {:force_run => false})
46
49
  else
@@ -2,7 +2,7 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.20.3"
5
+ GEM = "0.21.0"
6
6
  # @private
7
7
  CEEDLING = GEM
8
8
  # @private
@@ -2,7 +2,7 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.20.3"
5
+ GEM = "0.20.4"
6
6
  # @private
7
7
  CEEDLING = "<%= versions["CEEDLING"] %>"
8
8
  # @private
@@ -0,0 +1,250 @@
1
+ # A Fake Function Framework Plug-in for Ceedling
2
+
3
+ This is a plug-in for [Ceedling](https://github.com/ThrowTheSwitch/Ceedling) to use the [Fake Function Framework](https://github.com/meekrosoft/fff) for mocking instead of CMock.
4
+
5
+ Using fff provides less strict mocking than CMock, and allows for more loosely-coupled tests.
6
+ And, when tests fail -- since you get the actual line number of the failure -- it's a lot easier to figure out what went wrong.
7
+
8
+ ## Installing the plug-in
9
+
10
+ To use the plugin you need to 1) get the contents of this repo and 2) configure your project to use it.
11
+
12
+ ### Get the source
13
+
14
+ The easiest way to get the source is to just clone this repo into the Ceedling plugin folder for your existing Ceedling project.
15
+ (Don't have a Ceedling project already? [Here are instructions to create one.](http://www.electronvector.com/blog/try-embedded-test-driven-development-right-now-with-ceedling))
16
+ From within `<your-project>/vendor/ceedling/plugins`, run:
17
+
18
+ `git clone https://github.com/ElectronVector/fake_function_framework.git`
19
+
20
+ This will create a new folder named `fake_function_framework` in the plugins folder.
21
+
22
+ ### Enable the plug-in.
23
+
24
+ The plug-in is enabled from within your project.yml file.
25
+
26
+ In the `:plugins` configuration, add `fake_function_framework` to the list of enabled plugins:
27
+
28
+ ```yaml
29
+ :plugins:
30
+ :load_paths:
31
+ - vendor/ceedling/plugins
32
+ :enabled:
33
+ - stdout_pretty_tests_report
34
+ - module_generator
35
+ - fake_function_framework
36
+ ```
37
+ *Note that you could put the plugin source in some other loaction.
38
+ In that case you'd need to add a new path the `:load_paths`.*
39
+
40
+ ## How to use it
41
+
42
+ You use fff with Ceedling the same way you used to use CMock.
43
+ Modules can still be generated with the default module generator: `rake module:create[my_module]`.
44
+ If you want to "mock" `some_module.h` in your tests, just `#include "mock_some_module.h"`.
45
+ This creates a fake function for each of the functions defined in `some_module.h`.
46
+
47
+ The name of each fake is the original function name with an appended `_fake`.
48
+ For example, if we're generating fakes for a stack module with `push` and `pop` functions, we would have the fakes `push_fake` and `pop_fake`.
49
+ These fakes are linked into our test executable so that any time our unit under test calls `push` or `pop` our fakes are called instead.
50
+
51
+ Each of these fakes is actually a structure containing information about how the function was called, and what it might return.
52
+ We can use Unity to inspect these fakes in our tests, and verify the interactions of our units.
53
+ There is also a global structure named `fff` which we can use to check the sequence of calls.
54
+
55
+ The fakes can also be configured to return particular values, so you can exercise the unit under test however you want.
56
+
57
+ The examples below explain how to use fff to test a variety of module interactions.
58
+ Each example uses fakes for a "display" module, created from a display.h file with `#include "mock_display.h"`. The `display.h` file must exist and must contain the prototypes for the functions to be faked.
59
+
60
+ ### Test that a function was called once
61
+
62
+ ```c
63
+ void
64
+ test_whenTheDeviceIsReset_thenTheStatusLedIsTurnedOff()
65
+ {
66
+ // When
67
+ event_deviceReset();
68
+
69
+ // Then
70
+ TEST_ASSERT_EQUAL(1, display_turnOffStatusLed_fake.call_count);
71
+ }
72
+ ```
73
+
74
+ ### Test that a function was NOT called
75
+
76
+ ```c
77
+ void
78
+ test_whenThePowerReadingIsLessThan5_thenTheStatusLedIsNotTurnedOn(void)
79
+ {
80
+ // When
81
+ event_powerReadingUpdate(4);
82
+
83
+ // Then
84
+ TEST_ASSERT_EQUAL(0, display_turnOnStatusLed_fake.call_count);
85
+ }
86
+ ```
87
+
88
+ ## Test that a single function was called with the correct argument
89
+
90
+ ```c
91
+ void
92
+ test_whenTheVolumeKnobIsMaxed_thenVolumeDisplayIsSetTo11(void)
93
+ {
94
+ // When
95
+ event_volumeKnobMaxed();
96
+
97
+ // Then
98
+ TEST_ASSERT_EQUAL(1, display_setVolume_fake.call_count);
99
+ TEST_ASSERT_EQUAL(11, display_setVolume_fake.arg0_val);
100
+ }
101
+ ```
102
+
103
+ ## Test that calls are made in a particular sequence
104
+
105
+ ```c
106
+ void
107
+ test_whenTheModeSelectButtonIsPressed_thenTheDisplayModeIsCycled(void)
108
+ {
109
+ // When
110
+ event_modeSelectButtonPressed();
111
+ event_modeSelectButtonPressed();
112
+ event_modeSelectButtonPressed();
113
+
114
+ // Then
115
+ TEST_ASSERT_EQUAL_PTR((void*)display_setModeToMinimum, fff.call_history[0]);
116
+ TEST_ASSERT_EQUAL_PTR((void*)display_setModeToMaximum, fff.call_history[1]);
117
+ TEST_ASSERT_EQUAL_PTR((void*)display_setModeToAverage, fff.call_history[2]);
118
+ }
119
+ ```
120
+
121
+ ## Fake a return value from a function
122
+
123
+ ```c
124
+ void
125
+ test_givenTheDisplayHasAnError_whenTheDeviceIsPoweredOn_thenTheDisplayIsPoweredDown(void)
126
+ {
127
+ // Given
128
+ display_isError_fake.return_val = true;
129
+
130
+ // When
131
+ event_devicePoweredOn();
132
+
133
+ // Then
134
+ TEST_ASSERT_EQUAL(1, display_powerDown_fake.call_count);
135
+ }
136
+ ```
137
+
138
+ ## Fake a function with a value returned by reference
139
+
140
+ ```c
141
+ void
142
+ test_givenTheUserHasTypedSleep_whenItIsTimeToCheckTheKeyboard_theDisplayIsPoweredDown(void)
143
+ {
144
+ // Given
145
+ char mockedEntry[] = "sleep";
146
+ void return_mock_value(char * entry, int length)
147
+ {
148
+ if (length > strlen(mockedEntry))
149
+ {
150
+ strncpy(entry, mockedEntry, length);
151
+ }
152
+ }
153
+ display_getKeyboardEntry_fake.custom_fake = return_mock_value;
154
+
155
+ // When
156
+ event_keyboardCheckTimerExpired();
157
+
158
+ // Then
159
+ TEST_ASSERT_EQUAL(1, display_powerDown_fake.call_count);
160
+ }
161
+ ```
162
+
163
+ ## Fake a function with a function pointer parameter
164
+
165
+ ```
166
+ void
167
+ test_givenNewDataIsAvailable_whenTheDisplayHasUpdated_thenTheEventIsComplete(void)
168
+ {
169
+ // A mock function for capturing the callback handler function pointer.
170
+ void(*registeredCallback)(void) = 0;
171
+ void mock_display_updateData(int data, void(*callback)(void))
172
+ {
173
+ //Save the callback function.
174
+ registeredCallback = callback;
175
+ }
176
+ display_updateData_fake.custom_fake = mock_display_updateData;
177
+
178
+ // Given
179
+ event_newDataAvailable(10);
180
+
181
+ // When
182
+ if (registeredCallback != 0)
183
+ {
184
+ registeredCallback();
185
+ }
186
+
187
+ // Then
188
+ TEST_ASSERT_EQUAL(true, eventProcessor_isLastEventComplete());
189
+ }
190
+ ```
191
+
192
+ ## Helper macros
193
+
194
+ For convenience, there are also some helper macros that create new Unity-style asserts:
195
+
196
+ - `TEST_ASSERT_CALLED(function)`: Asserts that a function was called once.
197
+ - `TEST_ASSERT_NOT_CALLED(function)`: Asserts that a function was never called.
198
+ - `TEST_ASSERT_CALLED_TIMES(times, function)`: Asserts that a function was called a particular number of times.
199
+ - `TEST_ASSERT_CALLED_IN_ORDER(order, function)`: Asserts that a function was called in a particular order.
200
+
201
+ Here's how you might use one of these instead of simply checking the call_count value:
202
+
203
+ ```c
204
+ void
205
+ test_whenTheDeviceIsReset_thenTheStatusLedIsTurnedOff()
206
+ {
207
+ // When
208
+ event_deviceReset();
209
+
210
+ // Then
211
+ // This how to directly use fff...
212
+ TEST_ASSERT_EQUAL(1, display_turnOffStatusLed_fake.call_count);
213
+ // ...and this is how to use the helper macro.
214
+ TEST_ASSERT_CALLED(display_turnOffStatusLed);
215
+ }
216
+ ```
217
+
218
+ ## Test setup
219
+
220
+ All of the fake functions, and any fff global state are all reset automatically between each test.
221
+
222
+ ## CMock configuration
223
+
224
+ Use still use some of the CMock configuration options for setting things like the mock prefix, and for including additional header files in the mock files.
225
+
226
+ ```yaml
227
+ :cmock:
228
+ :mock_prefix: mock_
229
+ :includes:
230
+ -
231
+ :includes_h_pre_orig_header:
232
+ -
233
+ :includes_h_post_orig_header:
234
+ -
235
+ :includes_c_pre_header:
236
+ -
237
+ :includes_c_post_header:
238
+ ```
239
+
240
+ ## Running the tests
241
+
242
+ There are unit and integration tests for the plug-in itself.
243
+ These are run with the default `rake` task.
244
+ The integration test runs the tests for the example project in examples/fff_example.
245
+ For the integration tests to succeed, this repository must be placed in a Ceedling tree in the plugins folder.
246
+
247
+ ## More examples
248
+
249
+ There is an example project in examples/fff_example.
250
+ It shows how to use the plug-in with some full-size examples.