ceedling 0.28.2 → 0.28.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. checksums.yaml +4 -4
  2. data/assets/ceedling +3 -0
  3. data/assets/ceedling.cmd +1 -0
  4. data/assets/default_gitignore +5 -0
  5. data/assets/project_with_guts.yml +1 -0
  6. data/assets/project_with_guts_gcov.yml +3 -0
  7. data/assets/test_example_file_verbose.c +12 -0
  8. data/bin/ceedling +30 -6
  9. data/docs/CeedlingPacket.md +135 -23
  10. data/docs/CeedlingPacket.odt +0 -0
  11. data/examples/blinky/rakefile.rb +2 -1
  12. data/lib/ceedling/configurator.rb +7 -5
  13. data/lib/ceedling/configurator_builder.rb +10 -7
  14. data/lib/ceedling/configurator_plugins.rb +29 -24
  15. data/lib/ceedling/configurator_setup.rb +0 -1
  16. data/lib/ceedling/defaults.rb +7 -2
  17. data/lib/ceedling/dependinator.rb +10 -2
  18. data/lib/ceedling/file_finder.rb +57 -49
  19. data/lib/ceedling/file_path_utils.rb +12 -4
  20. data/lib/ceedling/file_wrapper.rb +4 -0
  21. data/lib/ceedling/generator.rb +4 -3
  22. data/lib/ceedling/generator_test_results.rb +15 -13
  23. data/lib/ceedling/plugin_manager.rb +18 -18
  24. data/lib/ceedling/plugin_reportinator.rb +3 -2
  25. data/lib/ceedling/plugin_reportinator_helper.rb +2 -3
  26. data/lib/ceedling/preprocessinator_extractor.rb +2 -2
  27. data/lib/ceedling/preprocessinator_includes_handler.rb +5 -0
  28. data/lib/ceedling/rakefile.rb +1 -0
  29. data/lib/ceedling/release_invoker_helper.rb +5 -2
  30. data/lib/ceedling/rules_release.rake +2 -1
  31. data/lib/ceedling/rules_tests.rake +18 -9
  32. data/lib/ceedling/rules_tests_deep_dependencies.rake +2 -2
  33. data/lib/ceedling/task_invoker.rb +15 -3
  34. data/lib/ceedling/tasks_vendor.rake +3 -3
  35. data/lib/ceedling/test_invoker.rb +39 -12
  36. data/lib/ceedling/test_invoker_helper.rb +5 -1
  37. data/lib/ceedling/tool_executor.rb +8 -4
  38. data/lib/ceedling/version.rb +1 -1
  39. data/out.fail +21 -0
  40. data/plugins/beep/README.md +22 -0
  41. data/plugins/beep/lib/beep.rb +40 -0
  42. data/plugins/bullseye/bullseye.rake +43 -36
  43. data/plugins/bullseye/config/defaults.yml +4 -0
  44. data/plugins/bullseye/lib/bullseye.rb +27 -5
  45. data/plugins/command_hooks/lib/command_hooks.rb +3 -0
  46. data/plugins/gcov/README.md +34 -1
  47. data/plugins/gcov/config/defaults.yml +3 -3
  48. data/plugins/gcov/gcov.rake +7 -5
  49. data/plugins/gcov/lib/gcov.rb +3 -1
  50. data/plugins/gcov/lib/gcov_constants.rb +2 -0
  51. data/plugins/junit_tests_report/lib/junit_tests_report.rb +12 -9
  52. data/plugins/module_generator/lib/module_generator.rb +14 -1
  53. data/plugins/module_generator/module_generator.rake +21 -4
  54. data/plugins/raw_output_report/lib/raw_output_report.rb +41 -0
  55. data/spec/gcov/gcov_deployment_spec.rb +1 -1
  56. data/spec/gcov/gcov_test_cases_spec.rb +2 -2
  57. data/spec/generator_test_results_spec.rb +5 -0
  58. data/spec/preprocessinator_includes_handler_spec.rb +1 -0
  59. data/spec/spec_system_helper.rb +178 -4
  60. data/spec/support/test_example.fail +1 -0
  61. data/spec/support/test_example.pass +1 -0
  62. data/spec/support/test_example_empty.pass +1 -0
  63. data/spec/support/test_example_ignore.pass +1 -0
  64. data/spec/support/test_example_mangled.pass +1 -0
  65. data/spec/support/test_example_with_time.pass +22 -0
  66. data/spec/system/deployment_spec.rb +33 -0
  67. data/vendor/cmock/README.md +4 -3
  68. data/vendor/cmock/docs/CMock_Summary.md +1 -1
  69. data/vendor/cmock/lib/cmock_config.rb +4 -0
  70. data/vendor/cmock/lib/cmock_generator.rb +5 -2
  71. data/vendor/cmock/lib/cmock_generator_plugin_array.rb +4 -4
  72. data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +9 -11
  73. data/vendor/cmock/lib/cmock_generator_plugin_cexception.rb +0 -1
  74. data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +2 -3
  75. data/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb +2 -4
  76. data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +0 -2
  77. data/vendor/cmock/lib/cmock_generator_utils.rb +16 -3
  78. data/vendor/cmock/lib/cmock_header_parser.rb +59 -34
  79. data/vendor/cmock/release/build.info +1 -1
  80. data/vendor/cmock/release/version.info +1 -1
  81. data/vendor/cmock/scripts/create_makefile.rb +17 -2
  82. data/vendor/cmock/src/cmock.c +13 -7
  83. data/vendor/cmock/test/test_helper.rb +11 -10
  84. data/vendor/cmock/test/unit/cmock_config_test.rb +4 -2
  85. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +10 -4
  86. data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +20 -12
  87. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +2 -2
  88. data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +2 -2
  89. data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +3 -3
  90. data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +8 -6
  91. data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +27 -10
  92. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +108 -20
  93. data/vendor/cmock/vendor/c_exception/Gemfile +4 -0
  94. data/vendor/cmock/vendor/c_exception/Gemfile.lock +12 -0
  95. data/vendor/cmock/vendor/c_exception/LICENSE.txt +30 -0
  96. data/vendor/cmock/vendor/c_exception/README.md +162 -0
  97. data/vendor/cmock/vendor/c_exception/Rakefile +42 -0
  98. data/vendor/cmock/vendor/c_exception/docs/CException.md +292 -0
  99. data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
  100. data/vendor/cmock/vendor/c_exception/lib/CException.c +46 -0
  101. data/vendor/cmock/vendor/c_exception/lib/CException.h +110 -0
  102. data/vendor/cmock/vendor/c_exception/makefile +24 -0
  103. data/vendor/cmock/vendor/c_exception/release/build.info +2 -0
  104. data/vendor/cmock/vendor/c_exception/release/version.info +2 -0
  105. data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +46 -0
  106. data/vendor/cmock/vendor/c_exception/test/TestException.c +391 -0
  107. data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +67 -0
  108. data/vendor/cmock/vendor/unity/README.md +231 -0
  109. data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +118 -0
  110. data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +39 -0
  111. data/vendor/cmock/vendor/unity/auto/generate_config.yml +36 -0
  112. data/vendor/cmock/vendor/unity/auto/generate_module.rb +308 -0
  113. data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +457 -0
  114. data/vendor/cmock/vendor/unity/auto/parse_output.rb +323 -0
  115. data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +252 -0
  116. data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +25 -0
  117. data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +6 -0
  118. data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +139 -0
  119. data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +136 -0
  120. data/vendor/cmock/vendor/unity/auto/unity_to_junit.py +146 -0
  121. data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +206 -0
  122. data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
  123. data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +779 -0
  124. data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +433 -0
  125. data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +192 -0
  126. data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +260 -0
  127. data/vendor/cmock/vendor/unity/docs/license.txt +21 -0
  128. data/vendor/cmock/vendor/unity/examples/example_1/makefile +71 -0
  129. data/vendor/cmock/vendor/unity/examples/example_1/readme.txt +5 -0
  130. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +24 -0
  131. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +3 -0
  132. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +11 -0
  133. data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +2 -0
  134. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +62 -0
  135. data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +31 -0
  136. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -0
  137. data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -0
  138. data/vendor/cmock/vendor/unity/examples/example_2/makefile +70 -0
  139. data/vendor/cmock/vendor/unity/examples/example_2/readme.txt +5 -0
  140. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +24 -0
  141. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +3 -0
  142. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +11 -0
  143. data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +2 -0
  144. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +64 -0
  145. data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +33 -0
  146. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
  147. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
  148. data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
  149. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +10 -0
  150. data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +12 -0
  151. data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +43 -0
  152. data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +249 -0
  153. data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +13 -0
  154. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +24 -0
  155. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +3 -0
  156. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +11 -0
  157. data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +2 -0
  158. data/vendor/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +46 -0
  159. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +62 -0
  160. data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +31 -0
  161. data/vendor/cmock/vendor/unity/examples/unity_config.h +247 -0
  162. data/vendor/cmock/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
  163. data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +48 -0
  164. data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +178 -0
  165. data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +9 -0
  166. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +436 -0
  167. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +83 -0
  168. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +51 -0
  169. data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +47 -0
  170. data/vendor/cmock/vendor/unity/extras/fixture/test/Makefile +75 -0
  171. data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +22 -0
  172. data/vendor/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +39 -0
  173. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +543 -0
  174. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +57 -0
  175. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +57 -0
  176. data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +17 -0
  177. data/vendor/cmock/vendor/unity/release/build.info +2 -0
  178. data/vendor/cmock/vendor/unity/release/version.info +2 -0
  179. data/vendor/cmock/vendor/unity/src/unity.c +1572 -0
  180. data/vendor/cmock/vendor/unity/src/unity.h +503 -0
  181. data/vendor/cmock/vendor/unity/src/unity_internals.h +924 -0
  182. data/vendor/cmock/vendor/unity/test/Makefile +68 -0
  183. data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +61 -0
  184. data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +57 -0
  185. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +55 -0
  186. data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.h +15 -0
  187. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +80 -0
  188. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +76 -0
  189. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -0
  190. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -0
  191. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +89 -0
  192. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +89 -0
  193. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +77 -0
  194. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +89 -0
  195. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +89 -0
  196. data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +90 -0
  197. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +67 -0
  198. data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +70 -0
  199. data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +58 -0
  200. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +67 -0
  201. data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +70 -0
  202. data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +71 -0
  203. data/vendor/cmock/vendor/unity/test/rakefile +125 -0
  204. data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +260 -0
  205. data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
  206. data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +78 -0
  207. data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +78 -0
  208. data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +49 -0
  209. data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +50 -0
  210. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +47 -0
  211. data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +59 -0
  212. data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +47 -0
  213. data/vendor/cmock/vendor/unity/test/targets/hitech_picc18.yml +101 -0
  214. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +90 -0
  215. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +80 -0
  216. data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +80 -0
  217. data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +94 -0
  218. data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +84 -0
  219. data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +95 -0
  220. data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +86 -0
  221. data/vendor/cmock/vendor/unity/test/testdata/CException.h +11 -0
  222. data/vendor/cmock/vendor/unity/test/testdata/Defs.h +8 -0
  223. data/vendor/cmock/vendor/unity/test/testdata/cmock.h +14 -0
  224. data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +13 -0
  225. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +186 -0
  226. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +70 -0
  227. data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +195 -0
  228. data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +1252 -0
  229. data/vendor/cmock/vendor/unity/test/tests/testparameterized.c +113 -0
  230. data/vendor/cmock/vendor/unity/test/tests/testunity.c +5371 -0
  231. data/vendor/unity/auto/generate_test_runner.rb +30 -10
  232. data/vendor/unity/auto/parse_output.rb +212 -109
  233. data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +9 -10
  234. data/vendor/unity/docs/UnityAssertionsReference.md +11 -2
  235. data/vendor/unity/docs/UnityConfigurationGuide.md +90 -55
  236. data/vendor/unity/docs/UnityGettingStartedGuide.md +6 -5
  237. data/vendor/unity/docs/UnityHelperScriptsGuide.md +23 -5
  238. data/vendor/unity/examples/unity_config.h +8 -0
  239. data/vendor/unity/extras/fixture/src/unity_fixture.c +4 -0
  240. data/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
  241. data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
  242. data/vendor/unity/release/build.info +1 -1
  243. data/vendor/unity/release/version.info +1 -1
  244. data/vendor/unity/src/unity.c +64 -57
  245. data/vendor/unity/src/unity.h +111 -7
  246. data/vendor/unity/src/unity_internals.h +173 -73
  247. data/vendor/unity/test/Makefile +5 -1
  248. data/vendor/unity/test/testdata/testRunnerGenerator.c +4 -1
  249. data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +4 -1
  250. data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +4 -1
  251. data/vendor/unity/test/tests/testparameterized.c +5 -2
  252. data/vendor/unity/test/tests/testunity.c +34 -0
  253. metadata +150 -2
@@ -1,4 +1,3 @@
1
- require 'set'
2
1
  require 'ceedling/constants'
3
2
 
4
3
  class PluginManager
@@ -9,19 +8,19 @@ class PluginManager
9
8
  @build_fail_registry = []
10
9
  @plugin_objects = [] # so we can preserve order
11
10
  end
12
-
11
+
13
12
  def load_plugin_scripts(script_plugins, system_objects)
14
13
  environment = []
15
-
14
+
16
15
  script_plugins.each do |plugin|
17
16
  # protect against instantiating object multiple times due to processing config multiple times (option files, etc)
18
- next if (@plugin_manager_helper.include?(@plugin_objects, plugin))
17
+ next if (@plugin_manager_helper.include?(@plugin_objects, plugin))
19
18
  begin
20
19
  @system_wrapper.require_file( "#{plugin}.rb" )
21
20
  object = @plugin_manager_helper.instantiate_plugin_script( camelize(plugin), system_objects, plugin )
22
21
  @plugin_objects << object
23
22
  environment += object.environment
24
-
23
+
25
24
  # add plugins to hash of all system objects
26
25
  system_objects[plugin.downcase.to_sym] = object
27
26
  rescue
@@ -29,28 +28,28 @@ class PluginManager
29
28
  raise
30
29
  end
31
30
  end
32
-
31
+
33
32
  yield( { :environment => environment } ) if (environment.size > 0)
34
33
  end
35
-
34
+
36
35
  def plugins_failed?
37
36
  return (@build_fail_registry.size > 0)
38
37
  end
39
-
38
+
40
39
  def print_plugin_failures
41
40
  if (@build_fail_registry.size > 0)
42
41
  report = @reportinator.generate_banner('BUILD FAILURE SUMMARY')
43
-
42
+
44
43
  @build_fail_registry.each do |failure|
45
44
  report += "#{' - ' if (@build_fail_registry.size > 1)}#{failure}\n"
46
45
  end
47
-
46
+
48
47
  report += "\n"
49
-
48
+
50
49
  @streaminator.stderr_puts(report, Verbosity::ERRORS)
51
- end
50
+ end
52
51
  end
53
-
52
+
54
53
  def register_build_failure(message)
55
54
  @build_fail_registry << message if (message and not message.empty?)
56
55
  end
@@ -81,14 +80,15 @@ class PluginManager
81
80
 
82
81
  def pre_release; execute_plugins(:pre_release); end
83
82
  def post_release; execute_plugins(:post_release); end
84
-
83
+
85
84
  def pre_build; execute_plugins(:pre_build); end
86
85
  def post_build; execute_plugins(:post_build); end
87
-
86
+ def post_error; execute_plugins(:post_error); end
87
+
88
88
  def summary; execute_plugins(:summary); end
89
-
89
+
90
90
  private ####################################
91
-
91
+
92
92
  def camelize(underscored_name)
93
93
  return underscored_name.gsub(/(_|^)([a-z0-9])/) {$2.upcase}
94
94
  end
@@ -96,7 +96,7 @@ class PluginManager
96
96
  def execute_plugins(method, *args)
97
97
  @plugin_objects.each do |plugin|
98
98
  begin
99
- plugin.send(method, *args)
99
+ plugin.send(method, *args) if plugin.respond_to?(method)
100
100
  rescue
101
101
  puts "Exception raised in plugin: #{plugin.name}, in method #{method}"
102
102
  raise
@@ -68,8 +68,9 @@ class PluginReportinator
68
68
  :failures => [],
69
69
  :ignores => [],
70
70
  :stdout => [],
71
- :counts => {:total => 0, :passed => 0, :failed => 0, :ignored => 0, :stdout => 0}
71
+ :counts => {:total => 0, :passed => 0, :failed => 0, :ignored => 0, :stdout => 0},
72
+ :time => 0.0
72
73
  }
73
74
  end
74
75
 
75
- end
76
+ end
@@ -3,7 +3,6 @@ require 'rubygems'
3
3
  require 'rake' # for ext()
4
4
  require 'ceedling/constants'
5
5
 
6
-
7
6
  class PluginReportinatorHelper
8
7
 
9
8
  attr_writer :ceedling
@@ -31,7 +30,6 @@ class PluginReportinatorHelper
31
30
 
32
31
  def process_results(aggregate_results, results)
33
32
  return if (results.empty?)
34
-
35
33
  aggregate_results[:successes] << { :source => results[:source].clone, :collection => results[:successes].clone } if (results[:successes].size > 0)
36
34
  aggregate_results[:failures] << { :source => results[:source].clone, :collection => results[:failures].clone } if (results[:failures].size > 0)
37
35
  aggregate_results[:ignores] << { :source => results[:source].clone, :collection => results[:ignores].clone } if (results[:ignores].size > 0)
@@ -41,6 +39,7 @@ class PluginReportinatorHelper
41
39
  aggregate_results[:counts][:failed] += results[:counts][:failed]
42
40
  aggregate_results[:counts][:ignored] += results[:counts][:ignored]
43
41
  aggregate_results[:counts][:stdout] += results[:stdout].size
42
+ aggregate_results[:time] += results[:time]
44
43
  end
45
44
 
46
45
 
@@ -49,4 +48,4 @@ class PluginReportinatorHelper
49
48
  @streaminator.stream_puts(stream, output.result(binding()), verbosity)
50
49
  end
51
50
 
52
- end
51
+ end
@@ -16,13 +16,13 @@ class PreprocessinatorExtractor
16
16
 
17
17
  lines = []
18
18
  File.readlines(filepath).each do |line|
19
- if found_file and not line.match(not_pragma)
19
+ if found_file and not line =~ not_pragma
20
20
  lines << line
21
21
  else
22
22
  found_file = false
23
23
  end
24
24
 
25
- found_file = true if line.match(pattern)
25
+ found_file = true if line =~ pattern
26
26
  end
27
27
 
28
28
  return lines
@@ -30,6 +30,11 @@ class PreprocessinatorIncludesHandler
30
30
  # that winds through the code). The decorated filenames indicate files that
31
31
  # are included directly by the test file.
32
32
  contents = @file_wrapper.read(filepath)
33
+
34
+ if !contents.valid_encoding?
35
+ contents = contents.encode("UTF-16be", :invalid=>:replace, :replace=>"?").encode('UTF-8')
36
+ end
37
+
33
38
  contents.gsub!( /^\s*#include\s+[\"<]\s*(\S+)\s*[\">]/, "#include \"\\1\"\n#include \"@@@@\\1\"" )
34
39
  contents.gsub!( /^\s*TEST_FILE\(\s*\"\s*(\S+)\s*\"\s*\)/, "#include \"\\1\"\n#include \"@@@@\\1\"")
35
40
  @file_wrapper.write( temp_filepath, contents )
@@ -81,5 +81,6 @@ END {
81
81
  exit(1) if (@ceedling[:plugin_manager].plugins_failed? && !@ceedling[:setupinator].config_hash[:graceful_fail])
82
82
  else
83
83
  puts "ERROR: Ceedling Failed"
84
+ @ceedling[:plugin_manager].post_error
84
85
  end
85
86
  }
@@ -8,8 +8,11 @@ class ReleaseInvokerHelper
8
8
  def process_deep_dependencies(dependencies_list)
9
9
  return if (not @configurator.project_use_deep_dependencies)
10
10
 
11
- @dependinator.enhance_release_file_dependencies( dependencies_list )
12
- @task_invoker.invoke_release_dependencies_files( dependencies_list )
11
+ if @configurator.project_generate_deep_dependencies
12
+ @dependinator.enhance_release_file_dependencies( dependencies_list )
13
+ @task_invoker.invoke_release_dependencies_files( dependencies_list )
14
+ end
15
+
13
16
  @dependinator.load_release_object_deep_dependencies( dependencies_list )
14
17
  end
15
18
 
@@ -30,7 +30,8 @@ rule(/#{PROJECT_RELEASE_BUILD_OUTPUT_C_PATH}\/#{'.+\\'+EXTENSION_OBJECT}$/ => [
30
30
  RELEASE_SYM,
31
31
  object.source,
32
32
  object.name,
33
- @ceedling[:file_path_utils].form_release_build_c_list_filepath( object.name ) )
33
+ @ceedling[:file_path_utils].form_release_build_c_list_filepath( object.name ),
34
+ @ceedling[:file_path_utils].form_release_dependencies_filepath( object.name ) )
34
35
  end
35
36
 
36
37
 
@@ -8,19 +8,28 @@ rule(/#{PROJECT_TEST_FILE_PREFIX}#{'.+'+TEST_RUNNER_FILE_SUFFIX}#{'\\'+EXTENSION
8
8
  @ceedling[:generator].generate_test_runner(TEST_SYM, runner.source, runner.name)
9
9
  end
10
10
 
11
-
12
- rule(/#{PROJECT_TEST_BUILD_OUTPUT_PATH}\/#{'.+\\'+EXTENSION_OBJECT}$/ => [
11
+ rule(/#{PROJECT_TEST_BUILD_OUTPUT_C_PATH}\/#{'.+\\'+EXTENSION_OBJECT}$/ => [
13
12
  proc do |task_name|
14
13
  @ceedling[:file_finder].find_compilation_input_file(task_name)
15
14
  end
16
15
  ]) do |object|
17
- @ceedling[:generator].generate_object_file(
18
- TOOLS_TEST_COMPILER,
19
- OPERATION_COMPILE_SYM,
20
- TEST_SYM,
21
- object.source,
22
- object.name,
23
- @ceedling[:file_path_utils].form_test_build_list_filepath( object.name ) )
16
+ if (File.basename(object.source) =~ /#{EXTENSION_SOURCE}$/)
17
+ @ceedling[:generator].generate_object_file(
18
+ TOOLS_TEST_COMPILER,
19
+ OPERATION_COMPILE_SYM,
20
+ TEST_SYM,
21
+ object.source,
22
+ object.name,
23
+ @ceedling[:file_path_utils].form_test_build_list_filepath( object.name ),
24
+ @ceedling[:file_path_utils].form_test_dependencies_filepath( object.name ))
25
+ elsif (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY)
26
+ @ceedling[:generator].generate_object_file(
27
+ TOOLS_TEST_ASSEMBLER,
28
+ OPERATION_ASSEMBLE_SYM,
29
+ TEST_SYM,
30
+ object.source,
31
+ object.name )
32
+ end
24
33
  end
25
34
 
26
35
 
@@ -3,13 +3,13 @@
3
3
  rule(/#{PROJECT_TEST_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ => [
4
4
  proc do |task_name|
5
5
  @ceedling[:file_finder].find_compilation_input_file(task_name)
6
- end
6
+ end
7
7
  ]) do |dep|
8
8
  @ceedling[:generator].generate_dependencies_file(
9
9
  TOOLS_TEST_DEPENDENCIES_GENERATOR,
10
10
  TEST_SYM,
11
11
  dep.source,
12
- @ceedling[:file_path_utils].form_test_build_object_filepath(dep.source),
12
+ @ceedling[:file_path_utils].form_test_build_c_object_filepath(dep.source),
13
13
  dep.name)
14
14
  end
15
15
 
@@ -56,17 +56,29 @@ class TaskInvoker
56
56
 
57
57
  def invoke_test_shallow_include_lists(files)
58
58
  @dependinator.enhance_shallow_include_lists_dependencies( files )
59
- files.each { |file| @rake_wrapper[file].invoke }
59
+ par_map(PROJECT_COMPILE_THREADS, files) do |file|
60
+ @rake_wrapper[file].invoke
61
+ end
60
62
  end
61
63
 
62
64
  def invoke_test_preprocessed_files(files)
63
65
  @dependinator.enhance_preprocesed_file_dependencies( files )
64
- files.each { |file| @rake_wrapper[file].invoke }
66
+ par_map(PROJECT_COMPILE_THREADS, files) do |file|
67
+ @rake_wrapper[file].invoke
68
+ end
65
69
  end
66
70
 
67
71
  def invoke_test_dependencies_files(files)
68
72
  @dependinator.enhance_dependencies_dependencies( files )
69
- files.each { |file| @rake_wrapper[file].invoke }
73
+ par_map(PROJECT_COMPILE_THREADS, files) do |file|
74
+ @rake_wrapper[file].invoke
75
+ end
76
+ end
77
+
78
+ def invoke_test_objects(objects)
79
+ par_map(PROJECT_COMPILE_THREADS, objects) do |object|
80
+ @rake_wrapper[object].invoke
81
+ end
70
82
  end
71
83
 
72
84
  def invoke_test_results(result)
@@ -4,7 +4,7 @@ require 'ceedling/file_path_utils'
4
4
  # create file dependencies to ensure C-based components of vendor tools are recompiled when they are updated with new versions
5
5
  # forming these explicitly rather than depend on auxiliary dependencies so all scenarios are explicitly covered
6
6
 
7
- file( @ceedling[:file_path_utils].form_test_build_object_filepath( UNITY_C_FILE ) => [
7
+ file( @ceedling[:file_path_utils].form_test_build_c_object_filepath( UNITY_C_FILE ) => [
8
8
  File.join( UNITY_VENDOR_PATH, UNITY_LIB_PATH, UNITY_C_FILE ),
9
9
  File.join( UNITY_VENDOR_PATH, UNITY_LIB_PATH, UNITY_H_FILE ),
10
10
  File.join( UNITY_VENDOR_PATH, UNITY_LIB_PATH, UNITY_INTERNALS_H_FILE ) ]
@@ -12,7 +12,7 @@ file( @ceedling[:file_path_utils].form_test_build_object_filepath( UNITY_C_FILE
12
12
 
13
13
 
14
14
  if (PROJECT_USE_MOCKS)
15
- file( @ceedling[:file_path_utils].form_test_build_object_filepath( CMOCK_C_FILE ) => [
15
+ file( @ceedling[:file_path_utils].form_test_build_c_object_filepath( CMOCK_C_FILE ) => [
16
16
  File.join( CMOCK_VENDOR_PATH, CMOCK_LIB_PATH, CMOCK_C_FILE ),
17
17
  File.join( CMOCK_VENDOR_PATH, CMOCK_LIB_PATH, CMOCK_H_FILE ) ]
18
18
  )
@@ -20,7 +20,7 @@ end
20
20
 
21
21
 
22
22
  if (PROJECT_USE_EXCEPTIONS)
23
- file( @ceedling[:file_path_utils].form_test_build_object_filepath( CEXCEPTION_C_FILE ) => [
23
+ file( @ceedling[:file_path_utils].form_test_build_c_object_filepath( CEXCEPTION_C_FILE ) => [
24
24
  File.join( CEXCEPTION_VENDOR_PATH, CEXCEPTION_LIB_PATH, CEXCEPTION_C_FILE ),
25
25
  File.join( CEXCEPTION_VENDOR_PATH, CEXCEPTION_LIB_PATH, CEXCEPTION_H_FILE ) ]
26
26
  )
@@ -22,7 +22,7 @@ class TestInvoker
22
22
  @tests = []
23
23
  @mocks = []
24
24
  end
25
-
25
+
26
26
  def get_test_definition_str(test)
27
27
  return "-D" + File.basename(test, File.extname(test)).upcase.sub(/@.*$/, "")
28
28
  end
@@ -55,11 +55,11 @@ class TestInvoker
55
55
  end
56
56
 
57
57
  def setup_and_invoke(tests, context=TEST_SYM, options={:force_run => true})
58
-
58
+
59
59
  @tests = tests
60
60
 
61
61
  @project_config_manager.process_test_config_change
62
-
62
+
63
63
  @tests.each do |test|
64
64
  # announce beginning of test run
65
65
  header = "Test '#{File.basename(test)}'"
@@ -67,7 +67,23 @@ class TestInvoker
67
67
 
68
68
  begin
69
69
  @plugin_manager.pre_test( test )
70
-
70
+ test_name ="#{File.basename(test)}".chomp('.c')
71
+ def_test_key="defines_#{test_name}"
72
+
73
+ # Re-define the project out path and pre-processor defines.
74
+ if @configurator.project_config_hash.has_key?(def_test_key.to_sym)
75
+ @project_config_manager.test_config_changed
76
+ defs_bkp = Array.new(COLLECTION_DEFINES_TEST_AND_VENDOR)
77
+ printf " ************** Specific test definitions for #{test_name} !!! \n"
78
+ tst_defs_cfg = @configurator.project_config_hash[def_test_key.to_sym]
79
+
80
+ orig_path = @configurator.project_test_build_output_path
81
+ @configurator.project_config_hash[:project_test_build_output_path] = File.join(@configurator.project_test_build_output_path, test_name)
82
+ @file_wrapper.mkdir(@configurator.project_test_build_output_path)
83
+ COLLECTION_DEFINES_TEST_AND_VENDOR.replace(tst_defs_cfg)
84
+ # printf " * new defines = #{COLLECTION_DEFINES_TEST_AND_VENDOR}\n"
85
+ end
86
+
71
87
  # collect up test fixture pieces & parts
72
88
  runner = @file_path_utils.form_runner_filepath_from_test( test )
73
89
  mock_list = @preprocessinator.preprocess_test_and_invoke_test_mocks( test )
@@ -77,7 +93,7 @@ class TestInvoker
77
93
  objects = @file_path_utils.form_test_build_objects_filelist( [runner] + core + extras )
78
94
  results_pass = @file_path_utils.form_pass_results_filepath( test )
79
95
  results_fail = @file_path_utils.form_fail_results_filepath( test )
80
-
96
+
81
97
  # add the definition value in the build option for the unit test
82
98
  if @configurator.defines_use_test_definition
83
99
  add_test_definition(test)
@@ -87,7 +103,7 @@ class TestInvoker
87
103
  @test_invoker_helper.clean_results( {:pass => results_pass, :fail => results_fail}, options )
88
104
 
89
105
  # load up auxiliary dependencies so deep changes cause rebuilding appropriately
90
- @test_invoker_helper.process_deep_dependencies( core ) do |dependencies_list|
106
+ @test_invoker_helper.process_deep_dependencies( core ) do |dependencies_list|
91
107
  @dependinator.load_test_object_deep_dependencies( dependencies_list )
92
108
  end
93
109
 
@@ -100,8 +116,11 @@ class TestInvoker
100
116
  # associate object files with executable
101
117
  @dependinator.setup_test_executable_dependencies( test, objects )
102
118
 
119
+ # build test objects
120
+ @task_invoker.invoke_test_objects( objects )
121
+
103
122
  # 3, 2, 1... launch
104
- @task_invoker.invoke_test_results( results_pass )
123
+ @task_invoker.invoke_test_results( results_pass )
105
124
  rescue => e
106
125
  @build_invoker_utils.process_exception( e, context )
107
126
  ensure
@@ -110,8 +129,16 @@ class TestInvoker
110
129
  delete_test_definition(test)
111
130
  end
112
131
  @plugin_manager.post_test( test )
132
+ # restore the project test defines
133
+ if @configurator.project_config_hash.has_key?(def_test_key.to_sym)
134
+ # @configurator.project_config_hash[:defines_test] =
135
+ COLLECTION_DEFINES_TEST_AND_VENDOR.replace(defs_bkp)
136
+ # printf " ---- Restored defines at #{defs_bkp}"
137
+ @configurator.project_config_hash[:project_test_build_output_path] = orig_path
138
+ printf " ************** Restored defines and build path\n"
139
+ end
113
140
  end
114
-
141
+
115
142
  # store away what's been processed
116
143
  @mocks.concat( mock_list )
117
144
  @sources.concat( sources )
@@ -119,18 +146,18 @@ class TestInvoker
119
146
 
120
147
  # post-process collected mock list
121
148
  @mocks.uniq!
122
-
149
+
123
150
  # post-process collected sources list
124
151
  @sources.uniq!
125
152
  end
126
153
 
127
154
 
128
155
  def refresh_deep_dependencies
129
- @file_wrapper.rm_f(
130
- @file_wrapper.directory_listing(
156
+ @file_wrapper.rm_f(
157
+ @file_wrapper.directory_listing(
131
158
  File.join( @configurator.project_test_dependencies_path, '*' + @configurator.extension_dependencies ) ) )
132
159
 
133
- @test_invoker_helper.process_deep_dependencies(
160
+ @test_invoker_helper.process_deep_dependencies(
134
161
  @configurator.collection_all_tests + @configurator.collection_all_source )
135
162
  end
136
163
 
@@ -12,7 +12,11 @@ class TestInvokerHelper
12
12
  return if (not @configurator.project_use_deep_dependencies)
13
13
 
14
14
  dependencies_list = @file_path_utils.form_test_dependencies_filelist( files )
15
- @task_invoker.invoke_test_dependencies_files( dependencies_list )
15
+
16
+ if @configurator.project_generate_deep_dependencies
17
+ @task_invoker.invoke_test_dependencies_files( dependencies_list )
18
+ end
19
+
16
20
  yield( dependencies_list ) if block_given?
17
21
  end
18
22
 
@@ -1,4 +1,5 @@
1
1
  require 'ceedling/constants'
2
+ require 'benchmark'
2
3
 
3
4
  class ShellExecutionException < RuntimeError
4
5
  attr_reader :shell_result
@@ -62,11 +63,14 @@ class ToolExecutor
62
63
  shell_result = {}
63
64
 
64
65
  # depending on background exec option, we shell out differently
65
- if (options[:background_exec] != BackgroundExec::NONE)
66
- shell_result = @system_wrapper.shell_system( command_line, options[:boom] )
67
- else
68
- shell_result = @system_wrapper.shell_backticks( command_line, options[:boom] )
66
+ time = Benchmark.realtime do
67
+ if (options[:background_exec] != BackgroundExec::NONE)
68
+ shell_result = @system_wrapper.shell_system( command_line, options[:boom] )
69
+ else
70
+ shell_result = @system_wrapper.shell_backticks( command_line, options[:boom] )
71
+ end
69
72
  end
73
+ shell_result[:time] = time
70
74
 
71
75
  #scrub the string for illegal output
72
76
  shell_result[:output].scrub! unless (!("".respond_to? :scrub!) || (shell_result[:output].nil?))