ceedling 0.31.0 → 0.31.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/example_file_call.c +6 -0
- data/assets/example_file_call.h +6 -0
- data/assets/test_example_file_with_mock.c +13 -0
- data/bin/ceedling +2 -2
- data/ceedling.gemspec +1 -1
- data/lib/ceedling/configurator.rb +7 -2
- data/lib/ceedling/configurator_plugins.rb +21 -1
- data/lib/ceedling/defaults.rb +1 -0
- data/lib/ceedling/preprocessinator_extractor.rb +2 -0
- data/lib/ceedling/preprocessinator_includes_handler.rb +24 -24
- data/lib/ceedling/version.rb +11 -7
- data/plugins/gcov/config/defaults_gcov.rb +118 -0
- data/plugins/gcov/lib/gcovr_reportinator.rb +1 -1
- data/plugins/gcov/lib/reportgenerator_reportinator.rb +1 -1
- data/plugins/junit_tests_report/lib/junit_tests_report.rb +6 -6
- data/plugins/module_generator/README.md +16 -2
- data/plugins/module_generator/lib/module_generator.rb +1 -0
- data/spec/gcov/gcov_deployment_spec.rb +1 -1
- data/spec/preprocessinator_includes_handler_spec.rb +38 -8
- data/spec/spec_system_helper.rb +19 -0
- data/spec/system/deployment_spec.rb +1 -0
- data/vendor/cmock/lib/cmock_file_writer.rb +2 -3
- data/vendor/cmock/lib/cmock_generator.rb +87 -70
- data/vendor/cmock/lib/cmock_header_parser.rb +29 -27
- data/vendor/cmock/src/cmock.h +1 -1
- data/vendor/cmock/test/unit/cmock_generator_main_test.rb +46 -41
- data/vendor/cmock/test/unit/cmock_header_parser_test.rb +46 -40
- data/vendor/cmock/vendor/c_exception/README.md +6 -4
- data/vendor/cmock/vendor/c_exception/docs/CException.md +2 -2
- data/vendor/cmock/vendor/c_exception/lib/CException.h +1 -1
- data/vendor/cmock/vendor/c_exception/lib/meson.build +2 -2
- data/vendor/cmock/vendor/c_exception/meson.build +36 -2
- data/vendor/cmock/vendor/unity/README.md +77 -71
- data/vendor/cmock/vendor/unity/auto/generate_test_runner.rb +1 -1
- data/vendor/cmock/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +107 -126
- data/vendor/cmock/vendor/unity/docs/UnityAssertionsReference.md +149 -193
- data/vendor/cmock/vendor/unity/docs/UnityConfigurationGuide.md +236 -294
- data/vendor/cmock/vendor/unity/docs/UnityGettingStartedGuide.md +112 -121
- data/vendor/cmock/vendor/unity/docs/UnityHelperScriptsGuide.md +82 -115
- data/vendor/cmock/vendor/unity/extras/fixture/readme.md +16 -19
- data/vendor/cmock/vendor/unity/extras/memory/readme.md +27 -34
- data/vendor/cmock/vendor/unity/src/unity.c +1 -1
- data/vendor/cmock/vendor/unity/src/unity.h +1 -1
- data/vendor/cmock/vendor/unity/src/unity_internals.h +21 -7
- data/vendor/unity/README.md +77 -71
- data/vendor/unity/auto/generate_test_runner.rb +1 -1
- data/vendor/unity/docs/ThrowTheSwitchCodingStandard.md +107 -126
- data/vendor/unity/docs/UnityAssertionsReference.md +149 -193
- data/vendor/unity/docs/UnityConfigurationGuide.md +236 -294
- data/vendor/unity/docs/UnityGettingStartedGuide.md +112 -121
- data/vendor/unity/docs/UnityHelperScriptsGuide.md +82 -115
- data/vendor/unity/extras/fixture/readme.md +16 -19
- data/vendor/unity/extras/memory/readme.md +27 -34
- data/vendor/unity/src/unity.c +1 -1
- data/vendor/unity/src/unity.h +1 -1
- data/vendor/unity/src/unity_internals.h +21 -7
- metadata +14 -5
- data/plugins/gcov/config/defaults.yml +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0da771e9249d10318e68a8c2c5bee09d14f36dc9198ab603ec1ee7dfc95ffe94
|
4
|
+
data.tar.gz: bd9ecb45abb57b47d59277ca0852b3b176d47a81133131ce2c79e5b0f0d07c48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ec2df3f174cc78eda8b44c3034a42b99b3a5a0e4ff3b3e9db40c6cd72fde0d05ff4ad45e14070bdf88931443a43343f5d996ac15caebb9eb2da90af20bf3dfa
|
7
|
+
data.tar.gz: cac6b185311d6e042f33c9064aa33e2d4b19422c74349e70bc94d00cbe19d72ac47dc79b07727d60a56e205392aabe16ad957b9c4dd323a795167c0683b5781c
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#include "unity.h"
|
2
|
+
#include "example_file_call.h"
|
3
|
+
// mock header should have higher priority than real file
|
4
|
+
#include "example_file.h"
|
5
|
+
#include "mock_example_file.h"
|
6
|
+
|
7
|
+
void setUp(void) {}
|
8
|
+
void tearDown(void) {}
|
9
|
+
|
10
|
+
void test_add_numbers_adds_numbers(void) {
|
11
|
+
add_numbers_ExpectAndReturn(1, 1, 2);
|
12
|
+
TEST_ASSERT_EQUAL(2, call_add_numbers(1, 1));
|
13
|
+
}
|
data/bin/ceedling
CHANGED
@@ -164,7 +164,7 @@ unless (project_found)
|
|
164
164
|
|
165
165
|
# Perform the actual clone of the config file, while updating the version
|
166
166
|
File.open(dst_yaml,'w') do |dst|
|
167
|
-
require
|
167
|
+
require File.expand_path(File.join(File.dirname(__FILE__),"..","lib","ceedling","version.rb"))
|
168
168
|
dst << File.read(src_yaml).gsub(":ceedling_version: '?'",":ceedling_version: #{Ceedling::Version::CEEDLING}")
|
169
169
|
puts " create #{dst_yaml}"
|
170
170
|
end
|
@@ -217,7 +217,7 @@ unless (project_found)
|
|
217
217
|
|
218
218
|
desc "version", "return the version of the tools installed"
|
219
219
|
def version()
|
220
|
-
require
|
220
|
+
require File.expand_path(File.join(File.dirname(__FILE__),"..","lib","ceedling","version.rb"))
|
221
221
|
puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
|
222
222
|
puts " CMock:: #{Ceedling::Version::CMOCK}"
|
223
223
|
puts " Unity:: #{Ceedling::Version::UNITY}"
|
data/ceedling.gemspec
CHANGED
@@ -31,7 +31,7 @@ Ceedling projects are created with a YAML configuration file. A variety of conve
|
|
31
31
|
s.required_ruby_version = ">= 2.4.0"
|
32
32
|
|
33
33
|
s.add_dependency "thor", "~> 0.14"
|
34
|
-
s.add_dependency "rake", "
|
34
|
+
s.add_dependency "rake", ">= 12", "< 14"
|
35
35
|
s.add_dependency "deep_merge", "~> 1.2"
|
36
36
|
s.add_dependency "constructor", "~> 2"
|
37
37
|
|
@@ -184,17 +184,22 @@ class Configurator
|
|
184
184
|
@rake_plugins = @configurator_plugins.find_rake_plugins(config, paths_hash)
|
185
185
|
@script_plugins = @configurator_plugins.find_script_plugins(config, paths_hash)
|
186
186
|
config_plugins = @configurator_plugins.find_config_plugins(config, paths_hash)
|
187
|
-
|
187
|
+
plugin_yml_defaults = @configurator_plugins.find_plugin_yml_defaults(config, paths_hash)
|
188
|
+
plugin_hash_defaults = @configurator_plugins.find_plugin_hash_defaults(config, paths_hash)
|
188
189
|
|
189
190
|
config_plugins.each do |plugin|
|
190
191
|
plugin_config = @yaml_wrapper.load(plugin)
|
191
192
|
config.deep_merge(plugin_config)
|
192
193
|
end
|
193
194
|
|
194
|
-
|
195
|
+
plugin_yml_defaults.each do |defaults|
|
195
196
|
@configurator_builder.populate_defaults( config, @yaml_wrapper.load(defaults) )
|
196
197
|
end
|
197
198
|
|
199
|
+
plugin_hash_defaults.each do |defaults|
|
200
|
+
@configurator_builder.populate_defaults( config, defaults )
|
201
|
+
end
|
202
|
+
|
198
203
|
# special plugin setting for results printing
|
199
204
|
config[:plugins][:display_raw_test_results] = true if (config[:plugins][:display_raw_test_results].nil?)
|
200
205
|
|
@@ -26,6 +26,7 @@ class ConfiguratorPlugins
|
|
26
26
|
|
27
27
|
if is_script_plugin
|
28
28
|
@system_wrapper.add_load_path( File.join( path, 'lib') )
|
29
|
+
@system_wrapper.add_load_path( File.join( path, 'config') )
|
29
30
|
end
|
30
31
|
break
|
31
32
|
end
|
@@ -92,7 +93,7 @@ class ConfiguratorPlugins
|
|
92
93
|
|
93
94
|
|
94
95
|
# gather up and return default .yml filepaths that exist on-disk
|
95
|
-
def
|
96
|
+
def find_plugin_yml_defaults(config, plugin_paths)
|
96
97
|
defaults_with_path = []
|
97
98
|
|
98
99
|
config[:plugins][:enabled].each do |plugin|
|
@@ -108,4 +109,23 @@ class ConfiguratorPlugins
|
|
108
109
|
return defaults_with_path
|
109
110
|
end
|
110
111
|
|
112
|
+
# gather up and return
|
113
|
+
def find_plugin_hash_defaults(config, plugin_paths)
|
114
|
+
defaults_hash= []
|
115
|
+
|
116
|
+
config[:plugins][:enabled].each do |plugin|
|
117
|
+
if path = plugin_paths[(plugin + '_path').to_sym]
|
118
|
+
default_path = File.join(path, "config", "defaults_#{plugin}.rb")
|
119
|
+
if @file_wrapper.exist?(default_path)
|
120
|
+
@system_wrapper.require_file( "defaults_#{plugin}.rb")
|
121
|
+
|
122
|
+
object = eval("get_default_config()")
|
123
|
+
defaults_hash << object
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
return defaults_hash
|
129
|
+
end
|
130
|
+
|
111
131
|
end
|
data/lib/ceedling/defaults.rb
CHANGED
@@ -294,6 +294,7 @@ DEFAULT_CEEDLING_CONFIG = {
|
|
294
294
|
:use_preprocessor_directives => false,
|
295
295
|
:use_deep_dependencies => false,
|
296
296
|
:generate_deep_dependencies => true, # only applicable if use_deep_dependencies is true
|
297
|
+
:auto_link_deep_dependencies => false,
|
297
298
|
:test_file_prefix => 'test_',
|
298
299
|
:options_paths => [],
|
299
300
|
:release_build => false,
|
@@ -16,6 +16,7 @@ class PreprocessinatorExtractor
|
|
16
16
|
|
17
17
|
lines = []
|
18
18
|
File.readlines(filepath).each do |line|
|
19
|
+
line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
19
20
|
if found_file and not line =~ not_pragma
|
20
21
|
lines << line
|
21
22
|
else
|
@@ -41,6 +42,7 @@ class PreprocessinatorExtractor
|
|
41
42
|
|
42
43
|
lines = []
|
43
44
|
File.readlines(filepath).each do |line|
|
45
|
+
line.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
44
46
|
lines << line
|
45
47
|
|
46
48
|
if line =~ pattern
|
@@ -77,8 +77,7 @@ class PreprocessinatorIncludesHandler
|
|
77
77
|
new_deps, new_to_process, all_mocks = extract_includes_helper(target, include_paths, ignore_list, all_mocks)
|
78
78
|
list += new_deps
|
79
79
|
to_process += new_to_process
|
80
|
-
if
|
81
|
-
!@configurator.project_config_hash[:project_auto_link_deep_dependencies])
|
80
|
+
if !@configurator.project_config_hash[:project_auto_link_deep_dependencies]
|
82
81
|
break
|
83
82
|
else
|
84
83
|
list = list.uniq()
|
@@ -94,7 +93,7 @@ class PreprocessinatorIncludesHandler
|
|
94
93
|
make_rule = self.form_shallow_dependencies_rule(filepath)
|
95
94
|
target_file = make_rule.split[0].gsub(':', '').gsub('\\','/')
|
96
95
|
base = File.basename(target_file, File.extname(target_file))
|
97
|
-
make_rule_dependencies = make_rule.gsub(
|
96
|
+
make_rule_dependencies = make_rule.gsub(/.*\b#{Regexp.escape(base)}\S*/, '').gsub(/\\$/, '')
|
98
97
|
|
99
98
|
# Extract the headers dependencies from the make rule
|
100
99
|
hdr_ext = @configurator.extension_header
|
@@ -109,15 +108,30 @@ class PreprocessinatorIncludesHandler
|
|
109
108
|
full_path_sources_dependencies = extract_full_path_dependencies(sources_dependencies)
|
110
109
|
|
111
110
|
list = full_path_headers_dependencies + full_path_sources_dependencies
|
112
|
-
to_process = []
|
113
111
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
112
|
+
mock_prefix = @configurator.project_config_hash[:cmock_mock_prefix]
|
113
|
+
# Creating list of mocks
|
114
|
+
mocks += full_path_headers_dependencies.find_all do |header|
|
115
|
+
File.basename(header) =~ /^#{mock_prefix}.*$/
|
116
|
+
end.compact
|
117
|
+
|
118
|
+
# ignore real file when both mock and real file exist
|
119
|
+
mocks.each do |mock|
|
120
|
+
list.each do |filename|
|
121
|
+
if File.basename(filename) == File.basename(mock).sub(mock_prefix, '')
|
122
|
+
ignore_list << filename
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end.compact
|
126
|
+
|
127
|
+
# Filtering list of final includes to only include mocks and anything that is NOT in the ignore_list
|
128
|
+
list = list.select do |item|
|
129
|
+
mocks.include? item or !(ignore_list.any? { |ignore_item| !item.match(/^(.*\/)?#{Regexp.escape(ignore_item)}$/).nil? })
|
130
|
+
end
|
120
131
|
|
132
|
+
to_process = []
|
133
|
+
|
134
|
+
if @configurator.project_config_hash[:project_auto_link_deep_dependencies]
|
121
135
|
# Creating list of headers that should be recursively pre-processed
|
122
136
|
# Skipping mocks and vendor headers
|
123
137
|
headers_to_deep_link = full_path_headers_dependencies.select do |hdr|
|
@@ -126,20 +140,6 @@ class PreprocessinatorIncludesHandler
|
|
126
140
|
headers_to_deep_link.map! {|hdr| File.expand_path(hdr) }
|
127
141
|
headers_to_deep_link.compact!
|
128
142
|
|
129
|
-
# ignore real file when both mock and real file exist
|
130
|
-
mocks.each do |mock|
|
131
|
-
list.each do |filename|
|
132
|
-
if File.basename(filename) == File.basename(mock).sub(mock_prefix, '')
|
133
|
-
ignore_list << filename
|
134
|
-
end
|
135
|
-
end
|
136
|
-
end.compact
|
137
|
-
|
138
|
-
# Filtering list of final includes to only include mocks and anything that is NOT in the ignore_list
|
139
|
-
list = list.select do |item|
|
140
|
-
mocks.include? item or !(ignore_list.any? { |ignore_item| !item.match(/^(.*\/)?#{Regexp.escape(ignore_item)}$/).nil? })
|
141
|
-
end
|
142
|
-
|
143
143
|
headers_to_deep_link.each do |hdr|
|
144
144
|
if (ignore_list.none? {|ignore_header| hdr.match(/^(.*\/)?#{Regexp.escape(ignore_header)}$/)} and
|
145
145
|
include_paths.none? {|include_path| hdr =~ /^#{include_path}\.*/})
|
data/lib/ceedling/version.rb
CHANGED
@@ -13,7 +13,7 @@ module Ceedling
|
|
13
13
|
path1
|
14
14
|
elsif (File.exists?(path2))
|
15
15
|
path2
|
16
|
-
elsif exists?(CEEDLING_VENDOR)
|
16
|
+
elsif File.exists?(CEEDLING_VENDOR)
|
17
17
|
path3 = File.expand_path( File.join(CEEDLING_VENDOR,path) )
|
18
18
|
if (File.exists?(path3))
|
19
19
|
path3
|
@@ -23,7 +23,7 @@ module Ceedling
|
|
23
23
|
[ @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'version.info') ).strip,
|
24
24
|
@ceedling[:file_wrapper].read( File.join(base_path, 'release', 'build.info') ).strip ].join('.')
|
25
25
|
rescue
|
26
|
-
"
|
26
|
+
"#{name}"
|
27
27
|
end
|
28
28
|
end
|
29
29
|
else
|
@@ -33,18 +33,22 @@ module Ceedling
|
|
33
33
|
|
34
34
|
# Actually look up the versions
|
35
35
|
a = [0,0,0]
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
36
|
+
begin
|
37
|
+
File.readlines(filename).each do |line|
|
38
|
+
["VERSION_MAJOR", "VERSION_MINOR", "VERSION_BUILD"].each_with_index do |field, i|
|
39
|
+
m = line.match(/#{name}_#{field}\s+(\d+)/)
|
40
|
+
a[i] = m[1] unless (m.nil?)
|
41
|
+
end
|
40
42
|
end
|
43
|
+
rescue
|
44
|
+
abort("Can't collect data for vendor component: \"#{filename}\" . \nPlease check your setup.")
|
41
45
|
end
|
42
46
|
|
43
47
|
# splat it to return the final value
|
44
48
|
eval("#{name} = '#{a.join(".")}'")
|
45
49
|
end
|
46
50
|
|
47
|
-
GEM = "0.31.
|
51
|
+
GEM = "0.31.1"
|
48
52
|
CEEDLING = GEM
|
49
53
|
end
|
50
54
|
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
|
2
|
+
DEFAULT_GCOV_COMPILER_TOOL = {
|
3
|
+
:executable => ENV['CC'].nil? ? FilePathUtils.os_executable_ext('gcc').freeze : ENV['CC'].split[0],
|
4
|
+
:name => 'default_gcov_compiler'.freeze,
|
5
|
+
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
6
|
+
:background_exec => BackgroundExec::NONE.freeze,
|
7
|
+
:optional => false.freeze,
|
8
|
+
:arguments => [
|
9
|
+
"-g".freeze,
|
10
|
+
"-fprofile-arcs".freeze,
|
11
|
+
"-ftest-coverage".freeze,
|
12
|
+
ENV['CC'].nil? ? "" : ENV['CC'].split[1..-1],
|
13
|
+
ENV['CPPFLAGS'].nil? ? "" : ENV['CPPFLAGS'].split,
|
14
|
+
{"-I\"$\"" => 'COLLECTION_PATHS_TEST_SUPPORT_SOURCE_INCLUDE_VENDOR'}.freeze,
|
15
|
+
{"-I\"$\"" => 'COLLECTION_PATHS_TEST_TOOLCHAIN_INCLUDE'}.freeze,
|
16
|
+
{"-D$" => 'COLLECTION_DEFINES_TEST_AND_VENDOR'}.freeze,
|
17
|
+
"-DGCOV_COMPILER".freeze,
|
18
|
+
"-DCODE_COVERAGE".freeze,
|
19
|
+
ENV['CFLAGS'].nil? ? "" : ENV['CFLAGS'].split,
|
20
|
+
"-c \"${1}\"".freeze,
|
21
|
+
"-o \"${2}\"".freeze
|
22
|
+
].freeze
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
DEFAULT_GCOV_LINKER_TOOL = {
|
27
|
+
:executable => ENV['CCLD'].nil? ? FilePathUtils.os_executable_ext('gcc').freeze : ENV['CCLD'].split[0],
|
28
|
+
:name => 'default_gcov_linker'.freeze,
|
29
|
+
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
30
|
+
:background_exec => BackgroundExec::NONE.freeze,
|
31
|
+
:optional => false.freeze,
|
32
|
+
:arguments => [
|
33
|
+
"-g".freeze,
|
34
|
+
"-fprofile-arcs".freeze,
|
35
|
+
"-ftest-coverage".freeze,
|
36
|
+
ENV['CCLD'].nil? ? "" : ENV['CCLD'].split[1..-1],
|
37
|
+
ENV['CFLAGS'].nil? ? "" : ENV['CFLAGS'].split,
|
38
|
+
ENV['LDFLAGS'].nil? ? "" : ENV['LDFLAGS'].split,
|
39
|
+
"\"${1}\"".freeze,
|
40
|
+
"-o \"${2}\"".freeze,
|
41
|
+
"${4}".freeze,
|
42
|
+
"${5}".freeze,
|
43
|
+
ENV['LDLIBS'].nil? ? "" : ENV['LDLIBS'].split
|
44
|
+
].freeze
|
45
|
+
}
|
46
|
+
|
47
|
+
DEFAULT_GCOV_FIXTURE_TOOL = {
|
48
|
+
:executable => '${1}'.freeze,
|
49
|
+
:name => 'default_gcov_fixture'.freeze,
|
50
|
+
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
51
|
+
:background_exec => BackgroundExec::NONE.freeze,
|
52
|
+
:optional => false.freeze,
|
53
|
+
:arguments => [].freeze
|
54
|
+
}
|
55
|
+
|
56
|
+
DEFAULT_GCOV_REPORT_TOOL = {
|
57
|
+
:executable => ENV['GCOV'].nil? ? FilePathUtils.os_executable_ext('gcov').freeze : ENV['GCOV'].split[0],
|
58
|
+
:name => 'default_gcov_report'.freeze,
|
59
|
+
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
60
|
+
:background_exec => BackgroundExec::NONE.freeze,
|
61
|
+
:optional => false.freeze,
|
62
|
+
:arguments => [
|
63
|
+
"-n".freeze,
|
64
|
+
"-p".freeze,
|
65
|
+
"-b".freeze,
|
66
|
+
{"-o \"$\"" => 'GCOV_BUILD_OUTPUT_PATH'}.freeze,
|
67
|
+
"\"${1}\"".freeze
|
68
|
+
].freeze
|
69
|
+
}
|
70
|
+
|
71
|
+
DEFAULT_GCOV_GCOV_POST_REPORT_TOOL = {
|
72
|
+
:executable => ENV['GCOV'].nil? ? FilePathUtils.os_executable_ext('gcov').freeze : ENV['GCOV'].split[0],
|
73
|
+
:name => 'default_gcov_gcov_post_report'.freeze,
|
74
|
+
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
75
|
+
:background_exec => BackgroundExec::NONE.freeze,
|
76
|
+
:optional => true.freeze,
|
77
|
+
:arguments => [
|
78
|
+
"-b".freeze,
|
79
|
+
"-c".freeze,
|
80
|
+
"-r".freeze,
|
81
|
+
"-x".freeze,
|
82
|
+
"${1}".freeze
|
83
|
+
].freeze
|
84
|
+
}
|
85
|
+
|
86
|
+
DEFAULT_GCOV_GCOVR_POST_REPORT_TOOL = {
|
87
|
+
:executable => 'gcovr'.freeze,
|
88
|
+
:name => 'default_gcov_gcovr_post_report'.freeze,
|
89
|
+
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
90
|
+
:background_exec => BackgroundExec::NONE.freeze,
|
91
|
+
:optional => true.freeze,
|
92
|
+
:arguments => [
|
93
|
+
"${1}".freeze
|
94
|
+
].freeze
|
95
|
+
}
|
96
|
+
|
97
|
+
DEFAULT_GCOV_REPORTGENERATOR_POST_REPORT = {
|
98
|
+
:executable => 'reportgenerator'.freeze,
|
99
|
+
:name => 'default_gcov_reportgenerator_post_report'.freeze,
|
100
|
+
:stderr_redirect => StdErrRedirect::NONE.freeze,
|
101
|
+
:background_exec => BackgroundExec::NONE.freeze,
|
102
|
+
:optional => true.freeze,
|
103
|
+
:arguments => [
|
104
|
+
"${1}".freeze
|
105
|
+
].freeze
|
106
|
+
}
|
107
|
+
|
108
|
+
def get_default_config
|
109
|
+
return :tools => {
|
110
|
+
:gcov_compiler => DEFAULT_GCOV_COMPILER_TOOL,
|
111
|
+
:gcov_linker => DEFAULT_GCOV_LINKER_TOOL,
|
112
|
+
:gcov_fixture => DEFAULT_GCOV_FIXTURE_TOOL,
|
113
|
+
:gcov_report => DEFAULT_GCOV_REPORT_TOOL,
|
114
|
+
:gcov_gcov_post_report => DEFAULT_GCOV_GCOV_POST_REPORT_TOOL,
|
115
|
+
:gcov_gcovr_post_report => DEFAULT_GCOV_GCOVR_POST_REPORT_TOOL,
|
116
|
+
:gcov_reportgenerator_post_report => DEFAULT_GCOV_REPORTGENERATOR_POST_REPORT
|
117
|
+
}
|
118
|
+
end
|
@@ -16,7 +16,7 @@ class GcovrReportinator
|
|
16
16
|
# Build the common gcovr arguments.
|
17
17
|
args_common = args_builder_common(opts)
|
18
18
|
|
19
|
-
if (gcovr_version_info[0]
|
19
|
+
if ((gcovr_version_info[0] == 4) && (gcovr_version_info[1] >= 2)) || (gcovr_version_info[0] > 4)
|
20
20
|
# gcovr version 4.2 and later supports generating multiple reports with a single call.
|
21
21
|
args = args_common
|
22
22
|
args += args_builder_cobertura(opts, false)
|
@@ -181,7 +181,7 @@ class ReportGeneratorReportinator
|
|
181
181
|
|
182
182
|
# Run ReportGenerator with the given arguments.
|
183
183
|
def run(args)
|
184
|
-
command = @ceedling[:tool_executor].build_command_line(
|
184
|
+
command = @ceedling[:tool_executor].build_command_line(TOOLS_GCOV_REPORTGENERATOR_POST_REPORT, [], args)
|
185
185
|
return @ceedling[:tool_executor].exec(command[:line], command[:options])
|
186
186
|
end
|
187
187
|
|
@@ -44,7 +44,7 @@ class JunitTestsReport < Plugin
|
|
44
44
|
def write_header( results, stream )
|
45
45
|
results[:counts][:time] = @time_result.reduce(0, :+)
|
46
46
|
stream.puts '<?xml version="1.0" encoding="utf-8" ?>'
|
47
|
-
stream.puts('<testsuites tests="%<total>d" failures="%<failed>d"
|
47
|
+
stream.puts('<testsuites tests="%<total>d" failures="%<failed>d" time="%<time>.3f">' % results[:counts])
|
48
48
|
end
|
49
49
|
|
50
50
|
def write_footer( stream )
|
@@ -53,7 +53,7 @@ class JunitTestsReport < Plugin
|
|
53
53
|
|
54
54
|
def reorganise_results( results )
|
55
55
|
# Reorganise the output by test suite instead of by result
|
56
|
-
suites = Hash.new{ |h,k| h[k] = {collection: [], total: 0, success: 0, failed: 0, ignored: 0, stdout: []} }
|
56
|
+
suites = Hash.new{ |h,k| h[k] = {collection: [], total: 0, success: 0, failed: 0, ignored: 0, errors: 0, stdout: []} }
|
57
57
|
results[:successes].each do |result|
|
58
58
|
source = result[:source]
|
59
59
|
name = source[:file].sub(/\..{1,4}$/, "")
|
@@ -85,7 +85,7 @@ class JunitTestsReport < Plugin
|
|
85
85
|
|
86
86
|
def write_suite( suite, stream )
|
87
87
|
suite[:time] = @time_result.shift
|
88
|
-
stream.puts(' <testsuite name="%<name>s" tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d" time="%<time
|
88
|
+
stream.puts(' <testsuite name="%<name>s" tests="%<total>d" failures="%<failed>d" skipped="%<ignored>d" errors="%<errors>d" time="%<time>.3f">' % suite)
|
89
89
|
|
90
90
|
suite[:collection].each do |test|
|
91
91
|
write_test( test, stream )
|
@@ -116,9 +116,9 @@ class JunitTestsReport < Plugin
|
|
116
116
|
|
117
117
|
case test[:result]
|
118
118
|
when :success
|
119
|
-
stream.puts(' <testcase name="%<test>s" time="%<unity_test_time
|
119
|
+
stream.puts(' <testcase name="%<test>s" time="%<unity_test_time>.3f"/>' % test)
|
120
120
|
when :failed
|
121
|
-
stream.puts(' <testcase name="%<test>s" time="%<unity_test_time
|
121
|
+
stream.puts(' <testcase name="%<test>s" time="%<unity_test_time>.3f">' % test)
|
122
122
|
if test[:message].empty?
|
123
123
|
stream.puts(' <failure />')
|
124
124
|
else
|
@@ -126,7 +126,7 @@ class JunitTestsReport < Plugin
|
|
126
126
|
end
|
127
127
|
stream.puts(' </testcase>')
|
128
128
|
when :ignored
|
129
|
-
stream.puts(' <testcase name="%<test>s" time="%<unity_test_time
|
129
|
+
stream.puts(' <testcase name="%<test>s" time="%<unity_test_time>.3f">' % test)
|
130
130
|
stream.puts(' <skipped />')
|
131
131
|
stream.puts(' </testcase>')
|
132
132
|
end
|