ceedling 0.27.0 → 0.28.1
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.
- checksums.yaml +4 -4
- data/assets/project_as_gem.yml +6 -0
- data/assets/project_with_guts.yml +6 -0
- data/assets/project_with_guts_gcov.yml +88 -0
- data/assets/test_example_file_boom.c +13 -0
- data/assets/test_example_file_success.c +14 -0
- data/bin/ceedling +57 -113
- data/ceedling.gemspec +1 -1
- data/config/test_environment.rb +0 -1
- data/examples/blinky/project.yml +1 -1
- data/examples/temp_sensor/project.yml +7 -1
- data/examples/temp_sensor/rakefile.rb +3 -1
- data/lib/ceedling/build_invoker_utils.rb +14 -2
- data/lib/ceedling/configurator.rb +3 -1
- data/lib/ceedling/configurator_builder.rb +6 -4
- data/lib/ceedling/configurator_setup.rb +5 -1
- data/lib/ceedling/defaults.rb +5 -2
- data/lib/ceedling/dependinator.rb +1 -1
- data/lib/ceedling/file_path_utils.rb +1 -2
- data/lib/ceedling/generator_test_results.rb +3 -2
- data/lib/ceedling/generator_test_results_sanity_checker.rb +4 -3
- data/lib/ceedling/project_file_loader.rb +26 -9
- data/lib/ceedling/rakefile.rb +9 -2
- data/lib/ceedling/release_invoker.rb +1 -1
- data/lib/ceedling/reportinator.rb +18 -1
- data/lib/ceedling/system_utils.rb +6 -1
- data/lib/ceedling/system_wrapper.rb +2 -1
- data/lib/ceedling/target_loader.rb +2 -2
- data/lib/ceedling/tasks_filesystem.rake +8 -2
- data/lib/ceedling/tool_executor_helper.rb +71 -22
- data/lib/ceedling/version.rb +1 -1
- data/license.txt +1 -1
- data/out.fail +21 -0
- data/plugins/command_hooks/lib/command_hooks.rb +2 -1
- data/plugins/gcov/config/defaults.yml +22 -0
- data/plugins/gcov/gcov.rake +79 -65
- data/plugins/gcov/lib/gcov.rb +25 -38
- data/plugins/gcov/lib/gcov_constants.rb +16 -0
- data/spec/build_invoker_utils_spec.rb +54 -0
- data/spec/file_finder_helper_spec.rb +53 -0
- data/spec/gcov/gcov_deployment_spec.rb +70 -0
- data/spec/gcov/gcov_test_cases_spec.rb +91 -0
- data/spec/generator_test_results_sanity_checker_spec.rb +88 -0
- data/spec/generator_test_results_spec.rb +102 -0
- data/spec/reportinator_spec.rb +19 -0
- data/spec/spec_system_helper.rb +67 -5
- data/spec/support/other_target.yml +0 -0
- data/spec/support/target.yml +0 -0
- data/spec/support/test_example.fail +21 -0
- data/spec/support/test_example.pass +21 -0
- data/spec/support/test_example_empty.pass +13 -0
- data/spec/support/test_example_ignore.pass +21 -0
- data/spec/support/test_example_mangled.pass +19 -0
- data/spec/system/deployment_spec.rb +25 -5
- data/spec/system_utils_spec.rb +56 -0
- data/spec/target_loader_spec.rb +30 -0
- data/spec/tool_executor_helper_spec.rb +310 -0
- data/vendor/cmock/scripts/create_makefile.rb +35 -12
- data/vendor/unity/src/unity_internals.h +3 -3
- metadata +62 -27
- data/assets/rakefile_as_gem.rb +0 -3
- data/assets/rakefile_with_guts.rb +0 -6
- data/vendor/constructor/History.rdoc +0 -19
- data/vendor/constructor/README.rdoc +0 -72
- data/vendor/constructor/Rakefile +0 -33
- data/vendor/constructor/homepage/Notes.txt +0 -27
- data/vendor/constructor/homepage/Rakefile +0 -15
- data/vendor/constructor/homepage/index.erb +0 -27
- data/vendor/constructor/homepage/index.html +0 -36
- data/vendor/constructor/homepage/page_header.graffle +0 -0
- data/vendor/constructor/homepage/page_header.html +0 -9
- data/vendor/constructor/homepage/page_header.png +0 -0
- data/vendor/constructor/homepage/sample_code.png +0 -0
- data/vendor/constructor/homepage/sample_code.rb +0 -12
- data/vendor/constructor/lib/constructor.rb +0 -127
- data/vendor/constructor/lib/constructor_struct.rb +0 -33
- data/vendor/constructor/specs/constructor_spec.rb +0 -407
- data/vendor/constructor/specs/constructor_struct_spec.rb +0 -84
data/lib/ceedling/version.rb
CHANGED
data/license.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2007-
|
1
|
+
Copyright (c) 2007-2017 Mike Karlesky, Mark VanderVoord, Greg Williams
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person
|
4
4
|
obtaining a copy of this software and associated documentation
|
data/out.fail
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
:source:
|
3
|
+
:path: some/place
|
4
|
+
:file: test_example.c
|
5
|
+
:successes: []
|
6
|
+
:failures:
|
7
|
+
- :test: test_one
|
8
|
+
:line: 257
|
9
|
+
:message: ''
|
10
|
+
- :test: test_two
|
11
|
+
:line: 269
|
12
|
+
:message: ''
|
13
|
+
:ignores: []
|
14
|
+
:counts:
|
15
|
+
:total: 2
|
16
|
+
:passed: 0
|
17
|
+
:failed: 2
|
18
|
+
:ignored: 0
|
19
|
+
:stdout:
|
20
|
+
- Verbose output one
|
21
|
+
- Verbous output two
|
@@ -48,7 +48,8 @@ class CommandHooks < Plugin
|
|
48
48
|
|
49
49
|
def run_hook_step(hook, name="")
|
50
50
|
if (hook[:executable])
|
51
|
-
|
51
|
+
args = ( (hook[:args].is_a? Array) ? hook[:args] : [] )
|
52
|
+
cmd = @ceedling[:tool_executor].build_command_line( hook, args, name )
|
52
53
|
shell_result = @ceedling[:tool_executor].exec( cmd[:line], cmd[:options] )
|
53
54
|
end
|
54
55
|
end
|
@@ -40,4 +40,26 @@
|
|
40
40
|
- --html
|
41
41
|
- -r .
|
42
42
|
- -o GcovCoverageResults.html
|
43
|
+
:gcov_post_report_basic:
|
44
|
+
:executable: gcovr
|
45
|
+
:optional: TRUE
|
46
|
+
:arguments:
|
47
|
+
- -p
|
48
|
+
- -b
|
49
|
+
- -e '^vendor.*|^build.*|^test.*|^lib.*'
|
50
|
+
- --html
|
51
|
+
- -r .
|
52
|
+
- -o "$": GCOV_ARTIFACTS_FILE
|
53
|
+
:gcov_post_report_advanced:
|
54
|
+
:executable: gcovr
|
55
|
+
:optional: TRUE
|
56
|
+
:arguments:
|
57
|
+
- -p
|
58
|
+
- -b
|
59
|
+
- -e '^vendor.*|^build.*|^test.*|^lib.*'
|
60
|
+
- --html-details
|
61
|
+
- -r .
|
62
|
+
- -o "$": GCOV_ARTIFACTS_FILE
|
63
|
+
|
64
|
+
|
43
65
|
...
|
data/plugins/gcov/gcov.rake
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
directory(GCOV_BUILD_OUTPUT_PATH)
|
3
2
|
directory(GCOV_RESULTS_PATH)
|
4
3
|
directory(GCOV_ARTIFACTS_PATH)
|
@@ -6,159 +5,174 @@ directory(GCOV_DEPENDENCIES_PATH)
|
|
6
5
|
|
7
6
|
CLEAN.include(File.join(GCOV_BUILD_OUTPUT_PATH, '*'))
|
8
7
|
CLEAN.include(File.join(GCOV_RESULTS_PATH, '*'))
|
8
|
+
CLEAN.include(File.join(GCOV_ARTIFACTS_PATH, '*'))
|
9
9
|
CLEAN.include(File.join(GCOV_DEPENDENCIES_PATH, '*'))
|
10
10
|
|
11
11
|
CLOBBER.include(File.join(GCOV_BUILD_PATH, '**/*'))
|
12
12
|
|
13
|
+
rule(/#{GCOV_BUILD_OUTPUT_PATH}\/#{'.+\\' + EXTENSION_OBJECT}$/ => [
|
14
|
+
proc do |task_name|
|
15
|
+
@ceedling[:file_finder].find_compilation_input_file(task_name)
|
16
|
+
end
|
17
|
+
]) do |object|
|
13
18
|
|
14
|
-
|
15
|
-
proc do |task_name|
|
16
|
-
@ceedling[:file_finder].find_compilation_input_file(task_name)
|
17
|
-
end
|
18
|
-
]) do |object|
|
19
|
-
|
20
|
-
if (File.basename(object.source) =~ /^(#{PROJECT_TEST_FILE_PREFIX}|#{CMOCK_MOCK_PREFIX}|#{GCOV_IGNORE_SOURCES.join('|')})/i)
|
19
|
+
if File.basename(object.source) =~ /^(#{PROJECT_TEST_FILE_PREFIX}|#{CMOCK_MOCK_PREFIX}|#{GCOV_IGNORE_SOURCES.join('|')})/i
|
21
20
|
@ceedling[:generator].generate_object_file(
|
22
21
|
TOOLS_GCOV_COMPILER,
|
23
22
|
OPERATION_COMPILE_SYM,
|
24
23
|
GCOV_SYM,
|
25
24
|
object.source,
|
26
25
|
object.name,
|
27
|
-
@ceedling[:file_path_utils].form_test_build_list_filepath(
|
26
|
+
@ceedling[:file_path_utils].form_test_build_list_filepath(object.name)
|
27
|
+
)
|
28
28
|
else
|
29
29
|
@ceedling[GCOV_SYM].generate_coverage_object_file(object.source, object.name)
|
30
30
|
end
|
31
|
-
|
32
31
|
end
|
33
32
|
|
34
|
-
rule(/#{GCOV_BUILD_OUTPUT_PATH}\/#{'.+\\'+EXTENSION_EXECUTABLE}$/) do |bin_file|
|
33
|
+
rule(/#{GCOV_BUILD_OUTPUT_PATH}\/#{'.+\\' + EXTENSION_EXECUTABLE}$/) do |bin_file|
|
35
34
|
@ceedling[:generator].generate_executable_file(
|
36
35
|
TOOLS_GCOV_LINKER,
|
37
36
|
GCOV_SYM,
|
38
37
|
bin_file.prerequisites,
|
39
38
|
bin_file.name,
|
40
|
-
@ceedling[:file_path_utils].form_test_build_map_filepath(bin_file.name)
|
39
|
+
@ceedling[:file_path_utils].form_test_build_map_filepath(bin_file.name)
|
40
|
+
)
|
41
41
|
end
|
42
42
|
|
43
|
-
rule(/#{GCOV_RESULTS_PATH}\/#{'.+\\'+EXTENSION_TESTPASS}$/ => [
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
rule(/#{GCOV_RESULTS_PATH}\/#{'.+\\' + EXTENSION_TESTPASS}$/ => [
|
44
|
+
proc do |task_name|
|
45
|
+
@ceedling[:file_path_utils].form_test_executable_filepath(task_name)
|
46
|
+
end
|
47
|
+
]) do |test_result|
|
48
48
|
@ceedling[:generator].generate_test_results(TOOLS_GCOV_FIXTURE, GCOV_SYM, test_result.source, test_result.name)
|
49
49
|
end
|
50
50
|
|
51
|
-
rule(/#{GCOV_DEPENDENCIES_PATH}\/#{'.+\\'+EXTENSION_DEPENDENCIES}$/ => [
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
51
|
+
rule(/#{GCOV_DEPENDENCIES_PATH}\/#{'.+\\' + EXTENSION_DEPENDENCIES}$/ => [
|
52
|
+
proc do |task_name|
|
53
|
+
@ceedling[:file_finder].find_compilation_input_file(task_name)
|
54
|
+
end
|
55
|
+
]) do |dep|
|
56
56
|
@ceedling[:generator].generate_dependencies_file(
|
57
57
|
TOOLS_TEST_DEPENDENCIES_GENERATOR,
|
58
58
|
GCOV_SYM,
|
59
59
|
dep.source,
|
60
|
-
File.join(GCOV_BUILD_OUTPUT_PATH, File.basename(dep.source).ext(EXTENSION_OBJECT)
|
61
|
-
dep.name
|
60
|
+
File.join(GCOV_BUILD_OUTPUT_PATH, File.basename(dep.source).ext(EXTENSION_OBJECT)),
|
61
|
+
dep.name
|
62
|
+
)
|
62
63
|
end
|
63
64
|
|
64
|
-
task :
|
65
|
+
task directories: [GCOV_BUILD_OUTPUT_PATH, GCOV_RESULTS_PATH, GCOV_DEPENDENCIES_PATH, GCOV_ARTIFACTS_PATH]
|
65
66
|
|
66
67
|
namespace GCOV_SYM do
|
68
|
+
task source_coverage: COLLECTION_ALL_SOURCE.pathmap("#{GCOV_BUILD_OUTPUT_PATH}/%n#{@ceedling[:configurator].extension_object}")
|
67
69
|
|
68
|
-
|
69
|
-
|
70
|
-
desc "Run code coverage for all tests"
|
71
|
-
task :all => [:directories] do
|
70
|
+
desc 'Run code coverage for all tests'
|
71
|
+
task all: [:directories] do
|
72
72
|
@ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
|
73
73
|
@ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, GCOV_SYM)
|
74
74
|
@ceedling[:configurator].restore_config
|
75
75
|
end
|
76
76
|
|
77
|
-
desc
|
77
|
+
desc 'Run single test w/ coverage ([*] real test or source file name, no path).'
|
78
78
|
task :* do
|
79
|
-
message = "\nOops! '#{GCOV_ROOT_NAME}:*' isn't a real task. "
|
80
|
-
"Use a real test or source file name (no path) in place of the wildcard.\n"
|
79
|
+
message = "\nOops! '#{GCOV_ROOT_NAME}:*' isn't a real task. " \
|
80
|
+
"Use a real test or source file name (no path) in place of the wildcard.\n" \
|
81
81
|
"Example: rake #{GCOV_ROOT_NAME}:foo.c\n\n"
|
82
82
|
|
83
|
-
@ceedling[:streaminator].stdout_puts(
|
83
|
+
@ceedling[:streaminator].stdout_puts(message)
|
84
84
|
end
|
85
85
|
|
86
|
-
desc
|
87
|
-
task :pattern, [:regex] => [:directories] do |
|
86
|
+
desc 'Run tests by matching regular expression pattern.'
|
87
|
+
task :pattern, [:regex] => [:directories] do |_t, args|
|
88
88
|
matches = []
|
89
89
|
|
90
90
|
COLLECTION_ALL_TESTS.each do |test|
|
91
91
|
matches << test if test =~ /#{args.regex}/
|
92
92
|
end
|
93
93
|
|
94
|
-
if
|
94
|
+
if !matches.empty?
|
95
95
|
@ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
|
96
|
-
@ceedling[:test_invoker].setup_and_invoke(matches, GCOV_SYM,
|
96
|
+
@ceedling[:test_invoker].setup_and_invoke(matches, GCOV_SYM, force_run: false)
|
97
97
|
@ceedling[:configurator].restore_config
|
98
98
|
else
|
99
99
|
@ceedling[:streaminator].stdout_puts("\nFound no tests matching pattern /#{args.regex}/.")
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
desc
|
104
|
-
task :path, [:dir] => [:directories] do |
|
103
|
+
desc 'Run tests whose test path contains [dir] or [dir] substring.'
|
104
|
+
task :path, [:dir] => [:directories] do |_t, args|
|
105
105
|
matches = []
|
106
106
|
|
107
107
|
COLLECTION_ALL_TESTS.each do |test|
|
108
|
-
matches << test if File.dirname(test).include?(args.dir.
|
108
|
+
matches << test if File.dirname(test).include?(args.dir.tr('\\', '/'))
|
109
109
|
end
|
110
110
|
|
111
|
-
if
|
111
|
+
if !matches.empty?
|
112
112
|
@ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
|
113
|
-
@ceedling[:test_invoker].setup_and_invoke(matches, GCOV_SYM,
|
113
|
+
@ceedling[:test_invoker].setup_and_invoke(matches, GCOV_SYM, force_run: false)
|
114
114
|
@ceedling[:configurator].restore_config
|
115
115
|
else
|
116
116
|
@ceedling[:streaminator].stdout_puts("\nFound no tests including the given path or path component.")
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
-
desc
|
121
|
-
task :
|
120
|
+
desc 'Run code coverage for changed files'
|
121
|
+
task delta: [:directories] do
|
122
122
|
@ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
|
123
|
-
@ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, GCOV_SYM,
|
123
|
+
@ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, GCOV_SYM, force_run: false)
|
124
124
|
@ceedling[:configurator].restore_config
|
125
125
|
end
|
126
126
|
|
127
127
|
# use a rule to increase efficiency for large projects
|
128
128
|
# gcov test tasks by regex
|
129
129
|
rule(/^#{GCOV_TASK_ROOT}\S+$/ => [
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
130
|
+
proc do |task_name|
|
131
|
+
test = task_name.sub(/#{GCOV_TASK_ROOT}/, '')
|
132
|
+
test = "#{PROJECT_TEST_FILE_PREFIX}#{test}" unless test.start_with?(PROJECT_TEST_FILE_PREFIX)
|
133
|
+
@ceedling[:file_finder].find_test_from_file_path(test)
|
134
|
+
end
|
135
|
+
]) do |test|
|
136
136
|
@ceedling[:rake_wrapper][:directories].invoke
|
137
137
|
@ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
|
138
138
|
@ceedling[:test_invoker].setup_and_invoke([test.source], GCOV_SYM)
|
139
139
|
@ceedling[:configurator].restore_config
|
140
140
|
end
|
141
|
-
|
142
141
|
end
|
143
142
|
|
144
143
|
if PROJECT_USE_DEEP_DEPENDENCIES
|
145
|
-
namespace REFRESH_SYM do
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
144
|
+
namespace REFRESH_SYM do
|
145
|
+
task GCOV_SYM do
|
146
|
+
@ceedling[:configurator].replace_flattened_config(@ceedling[GCOV_SYM].config)
|
147
|
+
@ceedling[:test_invoker].refresh_deep_dependencies
|
148
|
+
@ceedling[:configurator].restore_config
|
149
|
+
end
|
150
150
|
end
|
151
151
|
end
|
152
|
-
end
|
153
152
|
|
154
153
|
namespace UTILS_SYM do
|
155
|
-
|
156
|
-
desc "Create gcov code coverage html report"
|
154
|
+
desc 'Create gcov code coverage html report'
|
157
155
|
task GCOV_SYM do
|
158
|
-
|
159
|
-
|
160
|
-
|
156
|
+
|
157
|
+
if !File.directory? GCOV_ARTIFACTS_PATH
|
158
|
+
Dir.mkdir GCOV_ARTIFACTS_PATH
|
159
|
+
end
|
160
|
+
|
161
|
+
if @ceedling[:configurator].project_config_hash[:gcov_html_report_type] == 'basic'
|
162
|
+
puts "Creating a basic html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
|
163
|
+
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [])
|
164
|
+
@ceedling[:tool_executor].exec(command[:line], command[:options])
|
165
|
+
elsif @ceedling[:configurator].project_config_hash[:gcov_html_report_type] == 'detailed'
|
166
|
+
puts "Creating a detailed html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
|
167
|
+
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_ADVANCED, [])
|
168
|
+
@ceedling[:tool_executor].exec(command[:line], command[:options])
|
169
|
+
else
|
170
|
+
puts "In your project.yml, define: \n\n:gcov:\n :html_report_type:\n\n to basic or detailed to refine this feature."
|
171
|
+
puts "For now, just creating basic."
|
172
|
+
puts "Creating a basic html report of gcov results in #{GCOV_ARTIFACTS_FILE}..."
|
173
|
+
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_POST_REPORT_BASIC, [])
|
174
|
+
@ceedling[:tool_executor].exec(command[:line], command[:options])
|
175
|
+
end
|
176
|
+
puts "Done."
|
161
177
|
end
|
162
|
-
|
163
178
|
end
|
164
|
-
|
data/plugins/gcov/lib/gcov.rb
CHANGED
@@ -1,71 +1,59 @@
|
|
1
1
|
require 'ceedling/plugin'
|
2
2
|
require 'ceedling/constants'
|
3
|
-
|
4
|
-
GCOV_ROOT_NAME = 'gcov'
|
5
|
-
GCOV_TASK_ROOT = GCOV_ROOT_NAME + ':'
|
6
|
-
GCOV_SYM = GCOV_ROOT_NAME.to_sym
|
7
|
-
|
8
|
-
GCOV_BUILD_PATH = "#{PROJECT_BUILD_ROOT}/#{GCOV_ROOT_NAME}"
|
9
|
-
GCOV_BUILD_OUTPUT_PATH = "#{GCOV_BUILD_PATH}/out"
|
10
|
-
GCOV_RESULTS_PATH = "#{GCOV_BUILD_PATH}/results"
|
11
|
-
GCOV_DEPENDENCIES_PATH = "#{GCOV_BUILD_PATH}/dependencies"
|
12
|
-
GCOV_ARTIFACTS_PATH = "#{PROJECT_BUILD_ARTIFACTS_ROOT}/#{GCOV_ROOT_NAME}"
|
13
|
-
|
14
|
-
GCOV_IGNORE_SOURCES = ['unity', 'cmock', 'cexception']
|
15
|
-
|
3
|
+
require 'gcov_constants'
|
16
4
|
|
17
5
|
class Gcov < Plugin
|
18
|
-
|
19
6
|
attr_reader :config
|
20
7
|
|
21
8
|
def setup
|
22
9
|
@result_list = []
|
23
10
|
|
24
11
|
@config = {
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
|
12
|
+
project_test_build_output_path: GCOV_BUILD_OUTPUT_PATH,
|
13
|
+
project_test_results_path: GCOV_RESULTS_PATH,
|
14
|
+
project_test_dependencies_path: GCOV_DEPENDENCIES_PATH,
|
15
|
+
defines_test: DEFINES_TEST + ['CODE_COVERAGE'],
|
16
|
+
collection_defines_test_and_vendor: COLLECTION_DEFINES_TEST_AND_VENDOR + ['CODE_COVERAGE']
|
17
|
+
}
|
31
18
|
|
32
19
|
@plugin_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
33
|
-
@coverage_template_all = @ceedling[:file_wrapper].read(
|
20
|
+
@coverage_template_all = @ceedling[:file_wrapper].read(File.join(@plugin_root, 'assets/template.erb'))
|
34
21
|
end
|
35
22
|
|
36
23
|
def generate_coverage_object_file(source, object)
|
37
24
|
compile_command =
|
38
25
|
@ceedling[:tool_executor].build_command_line(
|
39
26
|
TOOLS_GCOV_COMPILER,
|
40
|
-
@ceedling[:flaginator].flag_down(
|
27
|
+
@ceedling[:flaginator].flag_down(OPERATION_COMPILE_SYM, GCOV_SYM, source),
|
41
28
|
source,
|
42
29
|
object,
|
43
|
-
@ceedling[:file_path_utils].form_test_build_list_filepath(
|
30
|
+
@ceedling[:file_path_utils].form_test_build_list_filepath(object)
|
31
|
+
)
|
44
32
|
@ceedling[:streaminator].stdout_puts("Compiling #{File.basename(source)} with coverage...")
|
45
|
-
@ceedling[:tool_executor].exec(
|
33
|
+
@ceedling[:tool_executor].exec(compile_command[:line], compile_command[:options])
|
46
34
|
end
|
47
35
|
|
48
36
|
def post_test_fixture_execute(arg_hash)
|
49
37
|
result_file = arg_hash[:result_file]
|
50
38
|
|
51
|
-
if (
|
39
|
+
if (result_file =~ /#{GCOV_RESULTS_PATH}/) && !@result_list.include?(result_file)
|
52
40
|
@result_list << arg_hash[:result_file]
|
53
41
|
end
|
54
42
|
end
|
55
43
|
|
56
44
|
def post_build
|
57
|
-
return
|
45
|
+
return unless @ceedling[:task_invoker].invoked?(/^#{GCOV_TASK_ROOT}/)
|
58
46
|
|
59
47
|
# test results
|
60
48
|
results = @ceedling[:plugin_reportinator].assemble_test_results(@result_list)
|
61
49
|
hash = {
|
62
|
-
:
|
63
|
-
:
|
50
|
+
header: GCOV_ROOT_NAME.upcase,
|
51
|
+
results: results
|
64
52
|
}
|
65
53
|
|
66
54
|
@ceedling[:plugin_reportinator].run_test_results_report(hash) do
|
67
55
|
message = ''
|
68
|
-
message = 'Unit test failures.' if
|
56
|
+
message = 'Unit test failures.' if results[:counts][:failed] > 0
|
69
57
|
message
|
70
58
|
end
|
71
59
|
|
@@ -73,13 +61,13 @@ class Gcov < Plugin
|
|
73
61
|
end
|
74
62
|
|
75
63
|
def summary
|
76
|
-
result_list = @ceedling[:file_path_utils].form_pass_results_filelist(
|
64
|
+
result_list = @ceedling[:file_path_utils].form_pass_results_filelist(GCOV_RESULTS_PATH, COLLECTION_ALL_TESTS)
|
77
65
|
|
78
66
|
# test results
|
79
67
|
# get test results for only those tests in our configuration and of those only tests with results on disk
|
80
68
|
hash = {
|
81
|
-
:
|
82
|
-
:
|
69
|
+
header: GCOV_ROOT_NAME.upcase,
|
70
|
+
results: @ceedling[:plugin_reportinator].assemble_test_results(result_list, boom: false)
|
83
71
|
}
|
84
72
|
|
85
73
|
@ceedling[:plugin_reportinator].run_test_results_report(hash)
|
@@ -92,8 +80,8 @@ class Gcov < Plugin
|
|
92
80
|
@ceedling[:streaminator].stdout_puts "\n" + banner
|
93
81
|
|
94
82
|
coverage_sources = sources.clone
|
95
|
-
coverage_sources.delete_if {|item| item =~ /#{CMOCK_MOCK_PREFIX}.+#{EXTENSION_SOURCE}$/}
|
96
|
-
coverage_sources.delete_if {|item| item =~ /#{GCOV_IGNORE_SOURCES.join('|')}#{EXTENSION_SOURCE}$/}
|
83
|
+
coverage_sources.delete_if { |item| item =~ /#{CMOCK_MOCK_PREFIX}.+#{EXTENSION_SOURCE}$/ }
|
84
|
+
coverage_sources.delete_if { |item| item =~ /#{GCOV_IGNORE_SOURCES.join('|')}#{EXTENSION_SOURCE}$/ }
|
97
85
|
|
98
86
|
coverage_sources.each do |source|
|
99
87
|
basename = File.basename(source)
|
@@ -101,17 +89,16 @@ class Gcov < Plugin
|
|
101
89
|
shell_results = @ceedling[:tool_executor].exec(command[:line], command[:options])
|
102
90
|
coverage_results = shell_results[:output]
|
103
91
|
|
104
|
-
if
|
105
|
-
report = (
|
92
|
+
if coverage_results.strip =~ /(File\s+'#{Regexp.escape(source)}'.+$)/m
|
93
|
+
report = Regexp.last_match(1).lines.to_a[1..-1].map { |line| basename + ' ' + line }.join('')
|
106
94
|
@ceedling[:streaminator].stdout_puts(report + "\n\n")
|
107
95
|
end
|
108
96
|
end
|
109
97
|
end
|
110
|
-
|
111
98
|
end
|
112
99
|
|
113
100
|
# end blocks always executed following rake run
|
114
101
|
END {
|
115
102
|
# cache our input configurations to use in comparison upon next execution
|
116
|
-
@ceedling[:cacheinator].cache_test_config(
|
103
|
+
@ceedling[:cacheinator].cache_test_config(@ceedling[:setupinator].config_hash) if @ceedling[:task_invoker].invoked?(/^#{GCOV_TASK_ROOT}/)
|
117
104
|
}
|