ceedling 0.0.13 → 0.0.14
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.
- data/bin/ceedling +11 -3
- data/lib/ceedling/version.rb +2 -2
- data/lib/ceedling/version.rb.erb +1 -1
- data/new_project_template/vendor/ceedling/lib/configurator_builder.rb +2 -2
- data/new_project_template/vendor/ceedling/lib/generator.rb +33 -17
- data/new_project_template/vendor/ceedling/lib/release_invoker.rb +9 -2
- data/new_project_template/vendor/ceedling/lib/rules_release.rake +3 -1
- data/new_project_template/vendor/ceedling/lib/tasks_filesystem.rake +1 -0
- data/new_project_template/vendor/ceedling/lib/tool_executor.rb +7 -1
- data/new_project_template/vendor/ceedling/plugins/bullseye/bullseye.rb +14 -0
- data/new_project_template/vendor/ceedling/plugins/bullseye/template.erb +1 -1
- data/new_project_template/vendor/ceedling/plugins/xml_tests_report/xml_tests_report.rb +14 -10
- data/new_project_template/vendor/ceedling/release/build.info +1 -1
- metadata +4 -4
data/bin/ceedling
CHANGED
|
@@ -12,9 +12,15 @@ class CeedlingTasks < Thor
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
desc "new PROJECT_NAME", "create a new ceedling project"
|
|
15
|
+
method_option :nodocs, :type => :boolean, :default => false, :desc => "No docs in vendor directory"
|
|
15
16
|
def new(name)
|
|
16
17
|
directory Ceedling::NEW_PROJECT_DIR, name
|
|
17
|
-
|
|
18
|
+
remove_dir "#{name}/vendor/ceedling/docs" if options[:nodocs]
|
|
19
|
+
puts "\n"
|
|
20
|
+
puts "Project '#{name}' created!"
|
|
21
|
+
puts " - Tool documentation is located in vendor/ceedling/docs" if not options[:nodocs]
|
|
22
|
+
puts " - Execute 'rake -T' to view available test & build tasks"
|
|
23
|
+
puts ''
|
|
18
24
|
end
|
|
19
25
|
|
|
20
26
|
desc "update DIRECTORY", "update the vendor/ceedling directory under the given project root"
|
|
@@ -45,8 +51,10 @@ class CeedlingTasks < Thor
|
|
|
45
51
|
remove_file "#{dest}/rakefile.rb"
|
|
46
52
|
directory "examples/#{proj_name}", dest
|
|
47
53
|
puts "\n"
|
|
48
|
-
puts "Example project
|
|
49
|
-
puts "
|
|
54
|
+
puts "Example project '#{proj_name}' created!"
|
|
55
|
+
puts " - Tool documentation is located in vendor/ceedling/docs"
|
|
56
|
+
puts " - Execute 'rake -T' to view available test & build tasks"
|
|
57
|
+
puts ''
|
|
50
58
|
end
|
|
51
59
|
|
|
52
60
|
desc "version", "print all ceedling gem and library versions"
|
data/lib/ceedling/version.rb
CHANGED
data/lib/ceedling/version.rb.erb
CHANGED
|
@@ -188,8 +188,8 @@ class ConfiguratorBuilder
|
|
|
188
188
|
|
|
189
189
|
return {
|
|
190
190
|
# tempted to make a helper method in file_path_utils? stop right there, pal. you'll introduce a cyclical dependency
|
|
191
|
-
:project_release_build_target => File.join(in_hash[:
|
|
192
|
-
:project_release_build_map => File.join(in_hash[:
|
|
191
|
+
:project_release_build_target => File.join(in_hash[:project_build_release_root], release_target_file),
|
|
192
|
+
:project_release_build_map => File.join(in_hash[:project_build_release_root], release_map_file)
|
|
193
193
|
}
|
|
194
194
|
end
|
|
195
195
|
|
|
@@ -32,9 +32,13 @@ class Generator
|
|
|
32
32
|
arg_hash = {:header_file => header_filepath, :context => context}
|
|
33
33
|
@plugin_manager.pre_mock_execute(arg_hash)
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
begin
|
|
36
|
+
@cmock_builder.cmock.setup_mocks( arg_hash[:header_file] )
|
|
37
|
+
rescue
|
|
38
|
+
raise
|
|
39
|
+
ensure
|
|
40
|
+
@plugin_manager.post_mock_execute(arg_hash)
|
|
41
|
+
end
|
|
38
42
|
end
|
|
39
43
|
|
|
40
44
|
# test_filepath may be either preprocessed test file or original test file
|
|
@@ -50,21 +54,32 @@ class Generator
|
|
|
50
54
|
@streaminator.stdout_puts("Generating runner for #{module_name}...", Verbosity::NORMAL)
|
|
51
55
|
|
|
52
56
|
# build runner file
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
begin
|
|
58
|
+
@generator_test_runner.generate(module_name, runner_filepath, test_cases, mock_list)
|
|
59
|
+
rescue
|
|
60
|
+
raise
|
|
61
|
+
ensure
|
|
62
|
+
@plugin_manager.post_runner_execute(arg_hash)
|
|
63
|
+
end
|
|
56
64
|
end
|
|
57
65
|
|
|
58
66
|
def generate_object_file(tool, context, source, object, list='')
|
|
67
|
+
shell_result = {}
|
|
59
68
|
arg_hash = {:tool => tool, :context => context, :source => source, :object => object, :list => list}
|
|
60
69
|
@plugin_manager.pre_compile_execute(arg_hash)
|
|
61
70
|
|
|
62
71
|
@streaminator.stdout_puts("Compiling #{File.basename(arg_hash[:source])}...", Verbosity::NORMAL)
|
|
63
|
-
command
|
|
64
|
-
shell_result = @tool_executor.exec( command[:line], command[:options] )
|
|
72
|
+
command = @tool_executor.build_command_line(arg_hash[:tool], arg_hash[:source], arg_hash[:object], arg_hash[:list])
|
|
65
73
|
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
begin
|
|
75
|
+
shell_result = @tool_executor.exec( command[:line], command[:options] )
|
|
76
|
+
rescue ShellExecutionException => ex
|
|
77
|
+
shell_result = ex.shell_result
|
|
78
|
+
raise ''
|
|
79
|
+
ensure
|
|
80
|
+
arg_hash[:shell_result] = shell_result
|
|
81
|
+
@plugin_manager.post_compile_execute(arg_hash)
|
|
82
|
+
end
|
|
68
83
|
end
|
|
69
84
|
|
|
70
85
|
def generate_executable_file(tool, context, objects, executable, map='')
|
|
@@ -73,11 +88,11 @@ class Generator
|
|
|
73
88
|
@plugin_manager.pre_link_execute(arg_hash)
|
|
74
89
|
|
|
75
90
|
@streaminator.stdout_puts("Linking #{File.basename(arg_hash[:executable])}...", Verbosity::NORMAL)
|
|
91
|
+
command = @tool_executor.build_command_line(arg_hash[:tool], arg_hash[:objects], arg_hash[:executable], arg_hash[:map])
|
|
76
92
|
|
|
77
93
|
begin
|
|
78
|
-
command = @tool_executor.build_command_line(arg_hash[:tool], arg_hash[:objects], arg_hash[:executable], arg_hash[:map])
|
|
79
94
|
shell_result = @tool_executor.exec( command[:line], command[:options] )
|
|
80
|
-
rescue
|
|
95
|
+
rescue ShellExecutionException => ex
|
|
81
96
|
notice = "\n" +
|
|
82
97
|
"NOTICE: If the linker reports missing symbols, the following may be to blame:\n" +
|
|
83
98
|
" 1. Test lacks #include statements corresponding to needed source files.\n" +
|
|
@@ -88,13 +103,14 @@ class Generator
|
|
|
88
103
|
else
|
|
89
104
|
notice += "\n"
|
|
90
105
|
end
|
|
91
|
-
|
|
106
|
+
|
|
92
107
|
@streaminator.stderr_puts(notice, Verbosity::COMPLAIN)
|
|
93
|
-
|
|
108
|
+
shell_result = ex.shell_result
|
|
109
|
+
raise ''
|
|
110
|
+
ensure
|
|
111
|
+
arg_hash[:shell_result] = shell_result
|
|
112
|
+
@plugin_manager.post_link_execute(arg_hash)
|
|
94
113
|
end
|
|
95
|
-
|
|
96
|
-
arg_hash[:shell_result] = shell_result
|
|
97
|
-
@plugin_manager.post_link_execute(arg_hash)
|
|
98
114
|
end
|
|
99
115
|
|
|
100
116
|
def generate_test_results(tool, context, executable, result)
|
|
@@ -6,7 +6,7 @@ class ReleaseInvoker
|
|
|
6
6
|
constructor :configurator, :release_invoker_helper, :build_invoker_helper, :dependinator, :task_invoker, :file_path_utils, :file_wrapper
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def setup_and_invoke_c_objects(c_files)
|
|
9
|
+
def setup_and_invoke_c_objects( c_files )
|
|
10
10
|
objects = @file_path_utils.form_release_build_c_objects_filelist( c_files )
|
|
11
11
|
|
|
12
12
|
begin
|
|
@@ -22,7 +22,7 @@ class ReleaseInvoker
|
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
def setup_and_invoke_asm_objects(asm_files)
|
|
25
|
+
def setup_and_invoke_asm_objects( asm_files )
|
|
26
26
|
objects = @file_path_utils.form_release_build_asm_objects_filelist( asm_files )
|
|
27
27
|
|
|
28
28
|
begin
|
|
@@ -48,4 +48,11 @@ class ReleaseInvoker
|
|
|
48
48
|
@configurator.collection_all_source ) )
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
|
|
52
|
+
def artifactinate( *files )
|
|
53
|
+
files.each do |file|
|
|
54
|
+
@file_wrapper.cp( file, @configurator.project_release_artifacts_path ) if @file_wrapper.exist?( file)
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
51
58
|
end
|
|
@@ -33,12 +33,14 @@ end
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
rule(/#{PROJECT_RELEASE_BUILD_TARGET}/) do |bin_file|
|
|
36
|
+
map_file = @ceedling[:configurator].project_release_build_map
|
|
36
37
|
@ceedling[:generator].generate_executable_file(
|
|
37
38
|
TOOLS_RELEASE_LINKER,
|
|
38
39
|
RELEASE_SYM,
|
|
39
40
|
bin_file.prerequisites,
|
|
40
41
|
bin_file.name,
|
|
41
|
-
|
|
42
|
+
map_file )
|
|
43
|
+
@ceedling[:release_invoker].artifactinate( bin_file.name, map_file )
|
|
42
44
|
end
|
|
43
45
|
|
|
44
46
|
|
|
@@ -8,6 +8,7 @@ CLEAN.clear_exclude.exclude { |fn| fn.pathmap("%f") == 'core' && File.directory?
|
|
|
8
8
|
CLEAN.include(File.join(PROJECT_TEST_BUILD_OUTPUT_PATH, '*'))
|
|
9
9
|
CLEAN.include(File.join(PROJECT_TEST_RESULTS_PATH, '*'))
|
|
10
10
|
CLEAN.include(File.join(PROJECT_TEST_DEPENDENCIES_PATH, '*'))
|
|
11
|
+
CLEAN.include(File.join(PROJECT_BUILD_RELEASE_ROOT, '*.*'))
|
|
11
12
|
CLEAN.include(File.join(PROJECT_RELEASE_BUILD_OUTPUT_PATH, '*'))
|
|
12
13
|
CLEAN.include(File.join(PROJECT_RELEASE_DEPENDENCIES_PATH, '*'))
|
|
13
14
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
require 'constants'
|
|
2
2
|
|
|
3
|
+
class ShellExecutionException < RuntimeError
|
|
4
|
+
attr_reader :shell_result
|
|
5
|
+
def initialize(shell_result)
|
|
6
|
+
@shell_result = shell_result
|
|
7
|
+
end
|
|
8
|
+
end
|
|
3
9
|
|
|
4
10
|
class ToolExecutor
|
|
5
11
|
|
|
@@ -62,7 +68,7 @@ class ToolExecutor
|
|
|
62
68
|
@tool_executor_helper.print_error_results( command_line, shell_result, options[:boom] )
|
|
63
69
|
|
|
64
70
|
# go boom if exit code isn't 0 (but in some cases we don't want a non-0 exit code to raise)
|
|
65
|
-
raise if ((shell_result[:exit_code] != 0) and options[:boom])
|
|
71
|
+
raise ShellExecutionException.new(shell_result) if ((shell_result[:exit_code] != 0) and options[:boom])
|
|
66
72
|
|
|
67
73
|
return shell_result
|
|
68
74
|
end
|
|
@@ -78,6 +78,7 @@ class Bullseye < Plugin
|
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
# coverage results
|
|
81
|
+
return if (verify_coverage_file() == false)
|
|
81
82
|
if (@ceedling[:task_invoker].invoked?(/^#{BULLSEYE_TASK_ROOT}(all|delta)/))
|
|
82
83
|
command = @ceedling[:tool_executor].build_command_line(TOOLS_BULLSEYE_REPORT_COVSRC)
|
|
83
84
|
shell_result = @ceedling[:tool_executor].exec(command[:line], command[:options])
|
|
@@ -88,6 +89,7 @@ class Bullseye < Plugin
|
|
|
88
89
|
end
|
|
89
90
|
|
|
90
91
|
def summary
|
|
92
|
+
return if (verify_coverage_file() == false)
|
|
91
93
|
result_list = @ceedling[:file_path_utils].form_pass_results_filelist( BULLSEYE_RESULTS_PATH, COLLECTION_ALL_TESTS )
|
|
92
94
|
|
|
93
95
|
# test results
|
|
@@ -149,8 +151,20 @@ class Bullseye < Plugin
|
|
|
149
151
|
end
|
|
150
152
|
end
|
|
151
153
|
|
|
154
|
+
def verify_coverage_file
|
|
155
|
+
exist = @ceedling[:file_wrapper].exist?( ENVIRONMENT_COVFILE )
|
|
156
|
+
|
|
157
|
+
if (!exist)
|
|
158
|
+
banner = @ceedling[:plugin_reportinator].generate_banner "#{BULLSEYE_ROOT_NAME.upcase}: CODE COVERAGE SUMMARY"
|
|
159
|
+
@ceedling[:streaminator].stdout_puts "\n" + banner + "\nNo coverage file.\n\n"
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
return exist
|
|
163
|
+
end
|
|
164
|
+
|
|
152
165
|
end
|
|
153
166
|
|
|
167
|
+
|
|
154
168
|
# end blocks always executed following rake run
|
|
155
169
|
END {
|
|
156
170
|
# cache our input configurations to use in comparison upon next execution
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
% function_string = hash[:coverage][:functions].to_s
|
|
2
2
|
% branch_string = hash[:coverage][:branches].to_s
|
|
3
3
|
% format_string = "%#{[function_string.length, branch_string.length].max}i"
|
|
4
|
-
<%=@ceedling[:plugin_reportinator].generate_banner("#{
|
|
4
|
+
<%=@ceedling[:plugin_reportinator].generate_banner("#{hash[:header]}: CODE COVERAGE SUMMARY")%>
|
|
5
5
|
% if (!hash[:coverage][:functions].nil?)
|
|
6
6
|
FUNCTIONS: <%=sprintf(format_string, hash[:coverage][:functions])%>%
|
|
7
7
|
% else
|
|
@@ -4,24 +4,28 @@ require 'constants'
|
|
|
4
4
|
class XmlTestsReport < Plugin
|
|
5
5
|
|
|
6
6
|
def setup
|
|
7
|
-
@
|
|
8
|
-
@
|
|
9
|
-
@test_counter = 1
|
|
7
|
+
@results_list = {}
|
|
8
|
+
@test_counter = 0
|
|
10
9
|
end
|
|
11
10
|
|
|
12
11
|
def post_test_execute(arg_hash)
|
|
13
|
-
|
|
12
|
+
context = arg_hash[:context]
|
|
14
13
|
|
|
15
|
-
@results_list
|
|
14
|
+
@results_list[context] = [] if (@results_list[context].nil?)
|
|
15
|
+
|
|
16
|
+
@results_list[context] << arg_hash[:result_file]
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def post_build
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
@results_list.each_key do |context|
|
|
21
|
+
results = @ceedling[:plugin_reportinator].assemble_test_results(@results_list[context])
|
|
22
|
+
|
|
23
|
+
file_path = File.join( PROJECT_BUILD_ARTIFACTS_ROOT, context.to_s, 'report.xml' )
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
@ceedling[:file_wrapper].open( file_path, 'w' ) do |f|
|
|
26
|
+
@test_counter = 1
|
|
27
|
+
write_results( results, f )
|
|
28
|
+
end
|
|
25
29
|
end
|
|
26
30
|
end
|
|
27
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
200
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ceedling
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 3
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 14
|
|
10
|
+
version: 0.0.14
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Mike Karlesky, Mark VanderVoord
|
|
@@ -17,7 +17,7 @@ autorequire:
|
|
|
17
17
|
bindir: bin
|
|
18
18
|
cert_chain: []
|
|
19
19
|
|
|
20
|
-
date: 2011-05-
|
|
20
|
+
date: 2011-05-28 00:00:00 -04:00
|
|
21
21
|
default_executable:
|
|
22
22
|
dependencies:
|
|
23
23
|
- !ruby/object:Gem::Dependency
|