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
@@ -14,15 +14,20 @@ class ConfiguratorPlugins
14
14
  def add_load_paths(config)
15
15
  plugin_paths = {}
16
16
 
17
- config[:plugins][:load_paths].each do |root|
18
- @system_wrapper.add_load_path( root ) if ( not @file_wrapper.directory_listing( File.join( root, '*.rb' ) ).empty? )
17
+ config[:plugins][:enabled].each do |plugin|
18
+ config[:plugins][:load_paths].each do |root|
19
+ path = File.join(root, plugin)
19
20
 
20
- config[:plugins][:enabled].each do |plugin|
21
- path = File.join(root, plugin, "lib")
21
+ is_script_plugin = ( not @file_wrapper.directory_listing( File.join( path, 'lib', '*.rb' ) ).empty? )
22
+ is_rake_plugin = ( not @file_wrapper.directory_listing( File.join( path, '*.rake' ) ).empty? )
22
23
 
23
- if ( not @file_wrapper.directory_listing( File.join( path, '*.rb' ) ).empty? )
24
+ if is_script_plugin or is_rake_plugin
24
25
  plugin_paths[(plugin + '_path').to_sym] = path
25
- @system_wrapper.add_load_path( path )
26
+
27
+ if is_script_plugin
28
+ @system_wrapper.add_load_path( File.join( path, 'lib') )
29
+ end
30
+ break
26
31
  end
27
32
  end
28
33
  end
@@ -32,12 +37,13 @@ class ConfiguratorPlugins
32
37
 
33
38
 
34
39
  # gather up and return .rake filepaths that exist on-disk
35
- def find_rake_plugins(config)
40
+ def find_rake_plugins(config, plugin_paths)
41
+ @rake_plugins = []
36
42
  plugins_with_path = []
37
43
 
38
- config[:plugins][:load_paths].each do |root|
39
- config[:plugins][:enabled].each do |plugin|
40
- rake_plugin_path = File.join(root, plugin, "#{plugin}.rake")
44
+ config[:plugins][:enabled].each do |plugin|
45
+ if path = plugin_paths[(plugin + '_path').to_sym]
46
+ rake_plugin_path = File.join(path, "#{plugin}.rake")
41
47
  if (@file_wrapper.exist?(rake_plugin_path))
42
48
  plugins_with_path << rake_plugin_path
43
49
  @rake_plugins << plugin
@@ -50,16 +56,16 @@ class ConfiguratorPlugins
50
56
 
51
57
 
52
58
  # gather up and return just names of .rb classes that exist on-disk
53
- def find_script_plugins(config)
54
- config[:plugins][:load_paths].each do |root|
55
- config[:plugins][:enabled].each do |plugin|
56
- script_plugin_path = File.join(root, plugin, "lib", "#{plugin}.rb")
59
+ def find_script_plugins(config, plugin_paths)
60
+ @script_plugins = []
57
61
 
62
+ config[:plugins][:enabled].each do |plugin|
63
+ if path = plugin_paths[(plugin + '_path').to_sym]
64
+ script_plugin_path = File.join(path, "lib", "#{plugin}.rb")
58
65
 
59
66
  if @file_wrapper.exist?(script_plugin_path)
60
67
  @script_plugins << plugin
61
68
  end
62
-
63
69
  end
64
70
  end
65
71
 
@@ -68,13 +74,12 @@ class ConfiguratorPlugins
68
74
 
69
75
 
70
76
  # gather up and return configuration .yml filepaths that exist on-disk
71
- def find_config_plugins(config)
77
+ def find_config_plugins(config, plugin_paths)
72
78
  plugins_with_path = []
73
79
 
74
- config[:plugins][:load_paths].each do |root|
75
- config[:plugins][:enabled].each do |plugin|
76
- config_plugin_path = File.join(root, plugin, "config", "#{plugin}.yml")
77
-
80
+ config[:plugins][:enabled].each do |plugin|
81
+ if path = plugin_paths[(plugin + '_path').to_sym]
82
+ config_plugin_path = File.join(path, "config", "#{plugin}.yml")
78
83
 
79
84
  if @file_wrapper.exist?(config_plugin_path)
80
85
  plugins_with_path << config_plugin_path
@@ -87,12 +92,12 @@ class ConfiguratorPlugins
87
92
 
88
93
 
89
94
  # gather up and return default .yml filepaths that exist on-disk
90
- def find_plugin_defaults(config)
95
+ def find_plugin_defaults(config, plugin_paths)
91
96
  defaults_with_path = []
92
97
 
93
- config[:plugins][:load_paths].each do |root|
94
- config[:plugins][:enabled].each do |plugin|
95
- default_path = File.join(root, plugin, 'config', 'defaults.yml')
98
+ config[:plugins][:enabled].each do |plugin|
99
+ if path = plugin_paths[(plugin + '_path').to_sym]
100
+ default_path = File.join(path, 'config', 'defaults.yml')
96
101
 
97
102
  if @file_wrapper.exist?(default_path)
98
103
  defaults_with_path << default_path
@@ -76,7 +76,6 @@ class ConfiguratorSetup
76
76
  def validate_paths(config)
77
77
  validation = []
78
78
 
79
- validation << @configurator_validator.validate_filepath(config, :project, :build_root)
80
79
  if config[:cmock][:unity_helper]
81
80
  config[:cmock][:unity_helper].each do |path|
82
81
  validation << @configurator_validator.validate_filepath_simple( path, :cmock, :unity_helper )
@@ -4,7 +4,7 @@ require 'ceedling/file_path_utils'
4
4
 
5
5
  #this should be defined already, but not always during system specs
6
6
  CEEDLING_VENDOR = File.expand_path(File.dirname(__FILE__) + '/../../vendor') unless defined? CEEDLING_VENDOR
7
- CEEDLING_PLUGINS = [File.expand_path(File.dirname(__FILE__) + '/../../plugins')] unless defined? CEEDLING_PLUGINS
7
+ CEEDLING_PLUGINS = [] unless defined? CEEDLING_PLUGINS
8
8
 
9
9
  DEFAULT_TEST_COMPILER_TOOL = {
10
10
  :executable => FilePathUtils.os_executable_ext('gcc').freeze,
@@ -21,6 +21,8 @@ DEFAULT_TEST_COMPILER_TOOL = {
21
21
  "-c \"${1}\"".freeze,
22
22
  "-o \"${2}\"".freeze,
23
23
  # gcc's list file output options are complex; no use of ${3} parameter in default config
24
+ "-MMD".freeze,
25
+ "-MF \"${4}\"".freeze,
24
26
  ].freeze
25
27
  }
26
28
 
@@ -158,6 +160,8 @@ DEFAULT_RELEASE_COMPILER_TOOL = {
158
160
  "-c \"${1}\"".freeze,
159
161
  "-o \"${2}\"".freeze,
160
162
  # gcc's list file output options are complex; no use of ${3} parameter in default config
163
+ "-MMD".freeze,
164
+ "-MF \"${4}\"".freeze,
161
165
  ].freeze
162
166
  }
163
167
 
@@ -242,6 +246,7 @@ DEFAULT_CEEDLING_CONFIG = {
242
246
  :test_threads => 1,
243
247
  :use_test_preprocessor => false,
244
248
  :use_deep_dependencies => false,
249
+ :generate_deep_dependencies => true, # only applicable if use_deep_dependencies is true
245
250
  :test_file_prefix => 'test_',
246
251
  :options_paths => [],
247
252
  :release_build => false,
@@ -347,7 +352,7 @@ DEFAULT_CEEDLING_CONFIG = {
347
352
  :release_dependencies_generator => { :arguments => [] },
348
353
 
349
354
  :plugins => {
350
- :load_paths => [], #XXX this is injected twice as of now so removed til better handling is found CEEDLING_PLUGINS,
355
+ :load_paths => CEEDLING_PLUGINS,
351
356
  :enabled => [],
352
357
  }
353
358
  }.freeze
@@ -11,7 +11,11 @@ class Dependinator
11
11
 
12
12
 
13
13
  def load_release_object_deep_dependencies(dependencies_list)
14
- dependencies_list.each { |dependencies_file| @rake_wrapper.load_dependencies( dependencies_file ) }
14
+ dependencies_list.each do |dependencies_file|
15
+ if File.exists?(dependencies_file)
16
+ @rake_wrapper.load_dependencies( dependencies_file )
17
+ end
18
+ end
15
19
  end
16
20
 
17
21
 
@@ -25,7 +29,11 @@ class Dependinator
25
29
 
26
30
  def load_test_object_deep_dependencies(files_list)
27
31
  dependencies_list = @file_path_utils.form_test_dependencies_filelist(files_list)
28
- dependencies_list.each { |dependencies_file| @rake_wrapper.load_dependencies(dependencies_file) }
32
+ dependencies_list.each do |dependencies_file|
33
+ if File.exists?(dependencies_file)
34
+ @rake_wrapper.load_dependencies(dependencies_file)
35
+ end
36
+ end
29
37
  end
30
38
 
31
39
 
@@ -1,14 +1,17 @@
1
1
  require 'rubygems'
2
2
  require 'rake' # for adding ext() method to string
3
+ require 'thread'
4
+
3
5
 
4
6
  class FileFinder
7
+ SEMAPHORE = Mutex.new
5
8
 
6
9
  constructor :configurator, :file_finder_helper, :cacheinator, :file_path_utils, :file_wrapper, :yaml_wrapper
7
10
 
8
11
  def prepare_search_sources
9
- @all_test_source_and_header_file_collection =
12
+ @all_test_source_and_header_file_collection =
10
13
  @configurator.collection_all_tests +
11
- @configurator.collection_all_source +
14
+ @configurator.collection_all_source +
12
15
  @configurator.collection_all_headers
13
16
  end
14
17
 
@@ -25,19 +28,19 @@ class FileFinder
25
28
  def find_header_input_for_mock_file(mock_file)
26
29
  found_path = find_header_file(mock_file)
27
30
  mock_input = found_path
28
-
31
+
29
32
  if (@configurator.project_use_test_preprocessor)
30
33
  mock_input = @cacheinator.diff_cached_test_file( @file_path_utils.form_preprocessed_file_filepath( found_path ) )
31
34
  end
32
-
35
+
33
36
  return mock_input
34
37
  end
35
-
38
+
36
39
 
37
40
  def find_source_from_test(test, complain)
38
41
  test_prefix = @configurator.project_test_file_prefix
39
42
  source_paths = @configurator.collection_all_source
40
-
43
+
41
44
  source = File.basename(test).sub(/#{test_prefix}/, '')
42
45
 
43
46
  # we don't blow up if a test file has no corresponding source file
@@ -49,31 +52,31 @@ class FileFinder
49
52
  extension_source = @configurator.extension_source
50
53
 
51
54
  test_file = File.basename(runner_path).sub(/#{@configurator.test_runner_file_suffix}#{'\\'+extension_source}/, extension_source)
52
-
55
+
53
56
  found_path = @file_finder_helper.find_file_in_collection(test_file, @configurator.collection_all_tests, :error)
54
57
 
55
58
  return found_path
56
59
  end
57
60
 
58
-
61
+
59
62
  def find_test_input_for_runner_file(runner_path)
60
63
  found_path = find_test_from_runner_path(runner_path)
61
64
  runner_input = found_path
62
-
65
+
63
66
  if (@configurator.project_use_test_preprocessor)
64
67
  runner_input = @cacheinator.diff_cached_test_file( @file_path_utils.form_preprocessed_file_filepath( found_path ) )
65
68
  end
66
-
69
+
67
70
  return runner_input
68
71
  end
69
-
72
+
70
73
 
71
74
  def find_test_from_file_path(file_path)
72
75
  test_file = File.basename(file_path).ext(@configurator.extension_source)
73
-
76
+
74
77
  found_path = @file_finder_helper.find_file_in_collection(test_file, @configurator.collection_all_tests, :error)
75
-
76
- return found_path
78
+
79
+ return found_path
77
80
  end
78
81
 
79
82
 
@@ -81,59 +84,64 @@ class FileFinder
81
84
  file = File.basename(file_path)
82
85
  return @file_finder_helper.find_file_in_collection(file, @all_test_source_and_header_file_collection, :error)
83
86
  end
84
-
85
-
87
+
88
+
86
89
  def find_compilation_input_file(file_path, complain=:error, release=false)
87
90
  found_file = nil
88
-
91
+
89
92
  source_file = File.basename(file_path).ext(@configurator.extension_source)
90
93
 
91
94
  # We only collect files that already exist when we start up.
92
95
  # FileLists can produce undesired results for dynamically generated files depending on when they're accessed.
93
96
  # So collect mocks and runners separately and right now.
94
- if (source_file =~ /#{@configurator.test_runner_file_suffix}/)
95
- found_file =
96
- @file_finder_helper.find_file_in_collection(
97
- source_file,
98
- @file_wrapper.directory_listing( File.join(@configurator.project_test_runners_path, '*') ),
99
- complain)
100
-
101
- elsif (@configurator.project_use_mocks and (source_file =~ /#{@configurator.cmock_mock_prefix}/))
102
- found_file =
103
- @file_finder_helper.find_file_in_collection(
104
- source_file,
105
- @file_wrapper.directory_listing( File.join(@configurator.cmock_mock_path, '*') ),
106
- complain)
107
-
108
- elsif release
109
- found_file =
110
- @file_finder_helper.find_file_in_collection(
111
- source_file,
112
- @configurator.collection_release_existing_compilation_input,
113
- complain)
114
- else
115
- found_file =
116
- @file_finder_helper.find_file_in_collection(
117
- source_file,
118
- @configurator.collection_all_existing_compilation_input,
119
- complain)
120
- end
121
97
 
98
+ SEMAPHORE.synchronize {
99
+
100
+ if (source_file =~ /#{@configurator.test_runner_file_suffix}/)
101
+ found_file =
102
+ @file_finder_helper.find_file_in_collection(
103
+ source_file,
104
+ @file_wrapper.directory_listing( File.join(@configurator.project_test_runners_path, '*') ),
105
+ complain)
106
+
107
+ elsif (@configurator.project_use_mocks and (source_file =~ /#{@configurator.cmock_mock_prefix}/))
108
+ found_file =
109
+ @file_finder_helper.find_file_in_collection(
110
+ source_file,
111
+ @file_wrapper.directory_listing( File.join(@configurator.cmock_mock_path, '*') ),
112
+ complain)
113
+
114
+ elsif release
115
+ found_file =
116
+ @file_finder_helper.find_file_in_collection(
117
+ source_file,
118
+ @configurator.collection_release_existing_compilation_input,
119
+ complain)
120
+ else
121
+ temp_complain = (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY) ? :ignore : complain
122
+ found_file =
123
+ @file_finder_helper.find_file_in_collection(
124
+ source_file,
125
+ @configurator.collection_all_existing_compilation_input,
126
+ temp_complain)
127
+ found_file ||= find_assembly_file(file_path, false) if (defined?(TEST_BUILD_USE_ASSEMBLY) && TEST_BUILD_USE_ASSEMBLY)
128
+ end
129
+ }
122
130
  return found_file
123
131
  end
124
132
 
125
-
133
+
126
134
  def find_source_file(file_path, complain)
127
135
  source_file = File.basename(file_path).ext(@configurator.extension_source)
128
136
  return @file_finder_helper.find_file_in_collection(source_file, @configurator.collection_all_source, complain)
129
137
  end
130
138
 
131
-
132
- def find_assembly_file(file_path)
139
+
140
+ def find_assembly_file(file_path, complain = :error)
133
141
  assembly_file = File.basename(file_path).ext(@configurator.extension_assembly)
134
- return @file_finder_helper.find_file_in_collection(assembly_file, @configurator.collection_all_assembly, :error)
142
+ return @file_finder_helper.find_file_in_collection(assembly_file, @configurator.collection_all_assembly, complain)
135
143
  end
136
-
144
+
137
145
  def find_file_from_list(file_path, file_list, complain)
138
146
  return @file_finder_helper.find_file_in_collection(file_path, file_list, complain)
139
147
  end
@@ -116,6 +116,10 @@ class FilePathUtils
116
116
  return File.join( @configurator.project_test_build_cache_path, File.basename(filepath) )
117
117
  end
118
118
 
119
+ def form_test_dependencies_filepath(filepath)
120
+ return File.join( @configurator.project_test_dependencies_path, File.basename(filepath).ext(@configurator.extension_dependencies) )
121
+ end
122
+
119
123
  def form_pass_results_filepath(filepath)
120
124
  return File.join( @configurator.project_test_results_path, File.basename(filepath).ext(@configurator.extension_testpass) )
121
125
  end
@@ -133,11 +137,15 @@ class FilePathUtils
133
137
  end
134
138
 
135
139
  def form_runner_object_filepath_from_test(filepath)
136
- return (form_test_build_object_filepath(filepath)).sub(/(#{@configurator.extension_object})$/, "#{@configurator.test_runner_file_suffix}\\1")
140
+ return (form_test_build_c_object_filepath(filepath)).sub(/(#{@configurator.extension_object})$/, "#{@configurator.test_runner_file_suffix}\\1")
141
+ end
142
+
143
+ def form_test_build_c_object_filepath(filepath)
144
+ return File.join( @configurator.project_test_build_output_c_path, File.basename(filepath).ext(@configurator.extension_object) )
137
145
  end
138
146
 
139
- def form_test_build_object_filepath(filepath)
140
- return File.join( @configurator.project_test_build_output_path, File.basename(filepath).ext(@configurator.extension_object) )
147
+ def form_test_build_asm_object_filepath(filepath)
148
+ return File.join( @configurator.project_test_build_output_asm_path, File.basename(filepath).ext(@configurator.extension_object) )
141
149
  end
142
150
 
143
151
  def form_test_executable_filepath(filepath)
@@ -161,7 +169,7 @@ class FilePathUtils
161
169
  end
162
170
 
163
171
  def form_test_build_objects_filelist(sources)
164
- return (@file_wrapper.instantiate_file_list(sources)).pathmap("#{@configurator.project_test_build_output_path}/%n#{@configurator.extension_object}")
172
+ return (@file_wrapper.instantiate_file_list(sources)).pathmap("#{@configurator.project_test_build_output_c_path}/%n#{@configurator.extension_object}")
165
173
  end
166
174
 
167
175
  def form_preprocessed_mockable_headers_filelist(mocks)
@@ -76,4 +76,8 @@ class FileWrapper
76
76
  return FileList.new(files)
77
77
  end
78
78
 
79
+ def mkdir(folder)
80
+ return FileUtils.mkdir_p(folder)
81
+ end
82
+
79
83
  end
@@ -78,9 +78,9 @@ class Generator
78
78
  end
79
79
  end
80
80
 
81
- def generate_object_file(tool, operation, context, source, object, list='')
81
+ def generate_object_file(tool, operation, context, source, object, list='', dependencies='')
82
82
  shell_result = {}
83
- arg_hash = {:tool => tool, :operation => operation, :context => context, :source => source, :object => object, :list => list}
83
+ arg_hash = {:tool => tool, :operation => operation, :context => context, :source => source, :object => object, :list => list, :dependencies => dependencies}
84
84
  @plugin_manager.pre_compile_execute(arg_hash)
85
85
 
86
86
  @streaminator.stdout_puts("Compiling #{File.basename(arg_hash[:source])}...", Verbosity::NORMAL)
@@ -89,7 +89,8 @@ class Generator
89
89
  @flaginator.flag_down( operation, context, source ),
90
90
  arg_hash[:source],
91
91
  arg_hash[:object],
92
- arg_hash[:list])
92
+ arg_hash[:list],
93
+ arg_hash[:dependencies])
93
94
 
94
95
  begin
95
96
  shell_result = @tool_executor.exec( command[:line], command[:options] )
@@ -1,19 +1,20 @@
1
1
  require 'rubygems'
2
2
  require 'rake' # for .ext()
3
3
  require 'ceedling/constants'
4
-
4
+
5
5
  class GeneratorTestResults
6
6
 
7
7
  constructor :configurator, :generator_test_results_sanity_checker, :yaml_wrapper
8
-
8
+
9
9
  def process_and_write_results(unity_shell_result, results_file, test_file)
10
10
  output_file = results_file
11
-
11
+
12
12
  results = get_results_structure
13
-
13
+
14
14
  results[:source][:path] = File.dirname(test_file)
15
15
  results[:source][:file] = File.basename(test_file)
16
-
16
+ results[:time] = unity_shell_result[:time] unless unity_shell_result[:time].nil?
17
+
17
18
  # process test statistics
18
19
  if (unity_shell_result[:output] =~ TEST_STDOUT_STATISTICS_PATTERN)
19
20
  results[:counts][:total] = $1.to_i
@@ -24,7 +25,7 @@ class GeneratorTestResults
24
25
 
25
26
  # remove test statistics lines
26
27
  output_string = unity_shell_result[:output].sub(TEST_STDOUT_STATISTICS_PATTERN, '')
27
-
28
+
28
29
  output_string.lines do |line|
29
30
  # process unity output
30
31
  case line
@@ -44,13 +45,13 @@ class GeneratorTestResults
44
45
  results[:stdout] << line.chomp
45
46
  end
46
47
  end
47
-
48
+
48
49
  @generator_test_results_sanity_checker.verify(results, unity_shell_result[:exit_code])
49
-
50
+
50
51
  output_file = results_file.ext(@configurator.extension_testfail) if (results[:counts][:failed] > 0)
51
-
52
+
52
53
  @yaml_wrapper.dump(output_file, results)
53
-
54
+
54
55
  return { :result_file => output_file, :result => results }
55
56
  end
56
57
 
@@ -64,19 +65,20 @@ class GeneratorTestResults
64
65
  :ignores => [],
65
66
  :counts => {:total => 0, :passed => 0, :failed => 0, :ignored => 0},
66
67
  :stdout => [],
68
+ :time => 0.0
67
69
  }
68
70
  end
69
-
71
+
70
72
  def extract_line_elements(line, filename)
71
73
  # handle anything preceding filename in line as extra output to be collected
72
74
  stdout = nil
73
75
  stdout_regex = /(.+)#{Regexp.escape(filename)}.+/i
74
-
76
+
75
77
  if (line =~ stdout_regex)
76
78
  stdout = $1.clone
77
79
  line.sub!(/#{Regexp.escape(stdout)}/, '')
78
80
  end
79
-
81
+
80
82
  # collect up test results minus and extra output
81
83
  elements = (line.strip.split(':'))[1..-1]
82
84