ceedling 0.28.2 → 0.28.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/ceedling +3 -0
- data/assets/ceedling.cmd +1 -0
- data/assets/default_gitignore +5 -0
- data/assets/project_with_guts.yml +1 -0
- data/assets/project_with_guts_gcov.yml +3 -0
- data/assets/test_example_file_verbose.c +12 -0
- data/bin/ceedling +30 -6
- data/docs/CeedlingPacket.md +135 -23
- data/docs/CeedlingPacket.odt +0 -0
- data/examples/blinky/rakefile.rb +2 -1
- data/lib/ceedling/configurator.rb +7 -5
- data/lib/ceedling/configurator_builder.rb +10 -7
- data/lib/ceedling/configurator_plugins.rb +29 -24
- data/lib/ceedling/configurator_setup.rb +0 -1
- data/lib/ceedling/defaults.rb +7 -2
- data/lib/ceedling/dependinator.rb +10 -2
- data/lib/ceedling/file_finder.rb +57 -49
- data/lib/ceedling/file_path_utils.rb +12 -4
- data/lib/ceedling/file_wrapper.rb +4 -0
- data/lib/ceedling/generator.rb +4 -3
- data/lib/ceedling/generator_test_results.rb +15 -13
- data/lib/ceedling/plugin_manager.rb +18 -18
- data/lib/ceedling/plugin_reportinator.rb +3 -2
- data/lib/ceedling/plugin_reportinator_helper.rb +2 -3
- data/lib/ceedling/preprocessinator_extractor.rb +2 -2
- data/lib/ceedling/preprocessinator_includes_handler.rb +5 -0
- data/lib/ceedling/rakefile.rb +1 -0
- data/lib/ceedling/release_invoker_helper.rb +5 -2
- data/lib/ceedling/rules_release.rake +2 -1
- data/lib/ceedling/rules_tests.rake +18 -9
- data/lib/ceedling/rules_tests_deep_dependencies.rake +2 -2
- data/lib/ceedling/task_invoker.rb +15 -3
- data/lib/ceedling/tasks_vendor.rake +3 -3
- data/lib/ceedling/test_invoker.rb +39 -12
- data/lib/ceedling/test_invoker_helper.rb +5 -1
- data/lib/ceedling/tool_executor.rb +8 -4
- data/lib/ceedling/version.rb +1 -1
- data/out.fail +21 -0
- data/plugins/beep/README.md +22 -0
- data/plugins/beep/lib/beep.rb +40 -0
- data/plugins/bullseye/bullseye.rake +43 -36
- data/plugins/bullseye/config/defaults.yml +4 -0
- data/plugins/bullseye/lib/bullseye.rb +27 -5
- data/plugins/command_hooks/lib/command_hooks.rb +3 -0
- data/plugins/gcov/README.md +34 -1
- data/plugins/gcov/config/defaults.yml +3 -3
- data/plugins/gcov/gcov.rake +7 -5
- data/plugins/gcov/lib/gcov.rb +3 -1
- data/plugins/gcov/lib/gcov_constants.rb +2 -0
- data/plugins/junit_tests_report/lib/junit_tests_report.rb +12 -9
- data/plugins/module_generator/lib/module_generator.rb +14 -1
- data/plugins/module_generator/module_generator.rake +21 -4
- data/plugins/raw_output_report/lib/raw_output_report.rb +41 -0
- data/spec/gcov/gcov_deployment_spec.rb +1 -1
- data/spec/gcov/gcov_test_cases_spec.rb +2 -2
- data/spec/generator_test_results_spec.rb +5 -0
- data/spec/preprocessinator_includes_handler_spec.rb +1 -0
- data/spec/spec_system_helper.rb +178 -4
- data/spec/support/test_example.fail +1 -0
- data/spec/support/test_example.pass +1 -0
- data/spec/support/test_example_empty.pass +1 -0
- data/spec/support/test_example_ignore.pass +1 -0
- data/spec/support/test_example_mangled.pass +1 -0
- data/spec/support/test_example_with_time.pass +22 -0
- data/spec/system/deployment_spec.rb +33 -0
- data/vendor/cmock/README.md +4 -3
- data/vendor/cmock/docs/CMock_Summary.md +1 -1
- data/vendor/cmock/lib/cmock_config.rb +4 -0
- data/vendor/cmock/lib/cmock_generator.rb +5 -2
- data/vendor/cmock/lib/cmock_generator_plugin_array.rb +4 -4
- data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +9 -11
- data/vendor/cmock/lib/cmock_generator_plugin_cexception.rb +0 -1
- data/vendor/cmock/lib/cmock_generator_plugin_ignore.rb +2 -3
- data/vendor/cmock/lib/cmock_generator_plugin_ignore_arg.rb +2 -4
- data/vendor/cmock/lib/cmock_generator_plugin_return_thru_ptr.rb +0 -2
- data/vendor/cmock/lib/cmock_generator_utils.rb +16 -3
- data/vendor/cmock/lib/cmock_header_parser.rb +59 -34
- data/vendor/cmock/release/build.info +1 -1
- data/vendor/cmock/release/version.info +1 -1
- data/vendor/cmock/scripts/create_makefile.rb +17 -2
- data/vendor/cmock/src/cmock.c +13 -7
- data/vendor/cmock/test/test_helper.rb +11 -10
- data/vendor/cmock/test/unit/cmock_config_test.rb +4 -2
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +10 -4
- data/vendor/cmock/test/unit/cmock_generator_plugin_array_test.rb +20 -12
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_a_test.rb +2 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_expect_b_test.rb +2 -2
- data/vendor/cmock/test/unit/cmock_generator_plugin_ignore_arg_test.rb +3 -3
- data/vendor/cmock/test/unit/cmock_generator_plugin_return_thru_ptr_test.rb +8 -6
- data/vendor/cmock/test/unit/cmock_generator_utils_test.rb +27 -10
- data/vendor/cmock/test/unit/cmock_header_parser_test.rb +108 -20
- data/vendor/cmock/vendor/c_exception/Gemfile +4 -0
- data/vendor/cmock/vendor/c_exception/Gemfile.lock +12 -0
- data/vendor/cmock/vendor/c_exception/LICENSE.txt +30 -0
- data/vendor/cmock/vendor/c_exception/README.md +162 -0
- data/vendor/cmock/vendor/c_exception/Rakefile +42 -0
- data/vendor/cmock/vendor/c_exception/docs/CException.md +292 -0
- data/vendor/cmock/vendor/c_exception/docs/ThrowTheSwitchCodingStandard.md +207 -0
- data/vendor/cmock/vendor/c_exception/lib/CException.c +46 -0
- data/vendor/cmock/vendor/c_exception/lib/CException.h +110 -0
- data/vendor/cmock/vendor/c_exception/makefile +24 -0
- data/vendor/cmock/vendor/c_exception/release/build.info +2 -0
- data/vendor/cmock/vendor/c_exception/release/version.info +2 -0
- data/vendor/cmock/vendor/c_exception/test/CExceptionConfig.h +46 -0
- data/vendor/cmock/vendor/c_exception/test/TestException.c +391 -0
- data/vendor/cmock/vendor/c_exception/test/TestException_Runner.c +67 -0
- data/vendor/cmock/vendor/unity/README.md +231 -0
- data/vendor/cmock/vendor/unity/auto/colour_prompt.rb +118 -0
- data/vendor/cmock/vendor/unity/auto/colour_reporter.rb +39 -0
- data/vendor/cmock/vendor/unity/auto/generate_config.yml +36 -0
- data/vendor/cmock/vendor/unity/auto/generate_module.rb +308 -0
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +457 -0
- data/vendor/cmock/vendor/unity/auto/parse_output.rb +323 -0
- data/vendor/cmock/vendor/unity/auto/stylize_as_junit.rb +252 -0
- data/vendor/cmock/vendor/unity/auto/test_file_filter.rb +25 -0
- data/vendor/cmock/vendor/unity/auto/type_sanitizer.rb +6 -0
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.py +139 -0
- data/vendor/cmock/vendor/unity/auto/unity_test_summary.rb +136 -0
- data/vendor/cmock/vendor/unity/auto/unity_to_junit.py +146 -0
- data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +206 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf +0 -0
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +779 -0
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +433 -0
- data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +192 -0
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +260 -0
- data/vendor/cmock/vendor/unity/docs/license.txt +21 -0
- data/vendor/cmock/vendor/unity/examples/example_1/makefile +71 -0
- data/vendor/cmock/vendor/unity/examples/example_1/readme.txt +5 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.c +24 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode.h +3 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_1/src/ProductionCode2.h +2 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode.c +62 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/TestProductionCode2.c +31 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c +53 -0
- data/vendor/cmock/vendor/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c +57 -0
- data/vendor/cmock/vendor/unity/examples/example_2/makefile +70 -0
- data/vendor/cmock/vendor/unity/examples/example_2/readme.txt +5 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.c +24 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode.h +3 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_2/src/ProductionCode2.h +2 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode.c +64 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/TestProductionCode2.c +33 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c +9 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_2/test/test_runners/all_tests.c +12 -0
- data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.c +10 -0
- data/vendor/cmock/vendor/unity/examples/example_3/helper/UnityHelper.h +12 -0
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile.rb +43 -0
- data/vendor/cmock/vendor/unity/examples/example_3/rakefile_helper.rb +249 -0
- data/vendor/cmock/vendor/unity/examples/example_3/readme.txt +13 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.c +24 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode.h +3 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.c +11 -0
- data/vendor/cmock/vendor/unity/examples/example_3/src/ProductionCode2.h +2 -0
- data/vendor/cmock/vendor/unity/examples/example_3/target_gcc_32.yml +46 -0
- data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode.c +62 -0
- data/vendor/cmock/vendor/unity/examples/example_3/test/TestProductionCode2.c +31 -0
- data/vendor/cmock/vendor/unity/examples/unity_config.h +247 -0
- data/vendor/cmock/vendor/unity/extras/eclipse/error_parsers.txt +26 -0
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile.rb +48 -0
- data/vendor/cmock/vendor/unity/extras/fixture/rakefile_helper.rb +178 -0
- data/vendor/cmock/vendor/unity/extras/fixture/readme.txt +9 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.c +436 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture.h +83 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_internals.h +51 -0
- data/vendor/cmock/vendor/unity/extras/fixture/src/unity_fixture_malloc_overrides.h +47 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/Makefile +75 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/main/AllTests.c +22 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/template_fixture_tests.c +39 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_Test.c +543 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_fixture_TestRunner.c +57 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.c +57 -0
- data/vendor/cmock/vendor/unity/extras/fixture/test/unity_output_Spy.h +17 -0
- data/vendor/cmock/vendor/unity/release/build.info +2 -0
- data/vendor/cmock/vendor/unity/release/version.info +2 -0
- data/vendor/cmock/vendor/unity/src/unity.c +1572 -0
- data/vendor/cmock/vendor/unity/src/unity.h +503 -0
- data/vendor/cmock/vendor/unity/src/unity_internals.h +924 -0
- data/vendor/cmock/vendor/unity/test/Makefile +68 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_cmd.c +61 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_def.c +57 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.c +55 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_head1.h +15 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_cmd.c +80 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_def.c +76 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.c +75 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_head1.h +13 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new1.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_new2.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_param.c +77 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run1.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_run2.c +89 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_mock_yaml.c +90 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_new1.c +67 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_new2.c +70 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_param.c +58 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_run1.c +67 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_run2.c +70 -0
- data/vendor/cmock/vendor/unity/test/expectdata/testsample_yaml.c +71 -0
- data/vendor/cmock/vendor/unity/test/rakefile +125 -0
- data/vendor/cmock/vendor/unity/test/rakefile_helper.rb +260 -0
- data/vendor/cmock/vendor/unity/test/spec/generate_module_existing_file_spec.rb +158 -0
- data/vendor/cmock/vendor/unity/test/targets/clang_file.yml +78 -0
- data/vendor/cmock/vendor/unity/test/targets/clang_strict.yml +78 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_32.yml +49 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_64.yml +50 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_auto_limits.yml +47 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_auto_stdint.yml +59 -0
- data/vendor/cmock/vendor/unity/test/targets/gcc_manual_math.yml +47 -0
- data/vendor/cmock/vendor/unity/test/targets/hitech_picc18.yml +101 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v4.yml +90 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5.yml +80 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_arm_v5_3.yml +80 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_armcortex_LM3S9B92_v5_4.yml +94 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_cortexm3_v5.yml +84 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_msp430.yml +95 -0
- data/vendor/cmock/vendor/unity/test/targets/iar_sh2a_v6.yml +86 -0
- data/vendor/cmock/vendor/unity/test/testdata/CException.h +11 -0
- data/vendor/cmock/vendor/unity/test/testdata/Defs.h +8 -0
- data/vendor/cmock/vendor/unity/test/testdata/cmock.h +14 -0
- data/vendor/cmock/vendor/unity/test/testdata/mockMock.h +13 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGenerator.c +186 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +70 -0
- data/vendor/cmock/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +195 -0
- data/vendor/cmock/vendor/unity/test/tests/test_generate_test_runner.rb +1252 -0
- data/vendor/cmock/vendor/unity/test/tests/testparameterized.c +113 -0
- data/vendor/cmock/vendor/unity/test/tests/testunity.c +5371 -0
- data/vendor/unity/auto/generate_test_runner.rb +30 -10
- data/vendor/unity/auto/parse_output.rb +212 -109
- data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +9 -10
- data/vendor/unity/docs/UnityAssertionsReference.md +11 -2
- data/vendor/unity/docs/UnityConfigurationGuide.md +90 -55
- data/vendor/unity/docs/UnityGettingStartedGuide.md +6 -5
- data/vendor/unity/docs/UnityHelperScriptsGuide.md +23 -5
- data/vendor/unity/examples/unity_config.h +8 -0
- data/vendor/unity/extras/fixture/src/unity_fixture.c +4 -0
- data/vendor/unity/extras/fixture/src/unity_fixture.h +1 -1
- data/vendor/unity/extras/fixture/src/unity_fixture_internals.h +2 -2
- data/vendor/unity/release/build.info +1 -1
- data/vendor/unity/release/version.info +1 -1
- data/vendor/unity/src/unity.c +64 -57
- data/vendor/unity/src/unity.h +111 -7
- data/vendor/unity/src/unity_internals.h +173 -73
- data/vendor/unity/test/Makefile +5 -1
- data/vendor/unity/test/testdata/testRunnerGenerator.c +4 -1
- data/vendor/unity/test/testdata/testRunnerGeneratorSmall.c +4 -1
- data/vendor/unity/test/testdata/testRunnerGeneratorWithMocks.c +4 -1
- data/vendor/unity/test/tests/testparameterized.c +5 -2
- data/vendor/unity/test/tests/testunity.c +34 -0
- 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
|
-
|
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
|
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
|
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 )
|
data/lib/ceedling/rakefile.rb
CHANGED
@@ -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
|
-
@
|
12
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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].
|
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
|
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
|
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
|
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].
|
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].
|
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].
|
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
|
-
|
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
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
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?))
|