ceedling 0.15.3 → 0.15.4

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.
@@ -4,7 +4,7 @@ class Dependinator
4
4
  constructor :configurator, :project_config_manager, :test_includes_extractor, :file_path_utils, :rake_wrapper, :file_wrapper
5
5
 
6
6
  def touch_force_rebuild_files
7
- @file_wrapper.touch( @configurator.project_test_force_rebuild_filepath )
7
+ @file_wrapper.touch( @configurator.project_test_force_rebuild_filepath )
8
8
  @file_wrapper.touch( @configurator.project_release_force_rebuild_filepath ) if (@configurator.project_release_build)
9
9
  end
10
10
 
@@ -16,9 +16,8 @@ class Dependinator
16
16
 
17
17
 
18
18
  def enhance_release_file_dependencies(files)
19
- files.each do |filepath|
19
+ files.each do |filepath|
20
20
  @rake_wrapper[filepath].enhance( [@configurator.project_release_force_rebuild_filepath] ) if (@project_config_manager.release_config_changed)
21
- @rake_wrapper[filepath].enhance( [@configurator.ceedling_build_info_filepath] )
22
21
  end
23
22
  end
24
23
 
@@ -32,14 +31,12 @@ class Dependinator
32
31
 
33
32
  def enhance_runner_dependencies(runner_filepath)
34
33
  @rake_wrapper[runner_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
35
- @rake_wrapper[runner_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
36
34
  end
37
-
35
+
38
36
 
39
37
  def enhance_shallow_include_lists_dependencies(include_lists)
40
38
  include_lists.each do |include_list_filepath|
41
39
  @rake_wrapper[include_list_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
42
- @rake_wrapper[include_list_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
43
40
  end
44
41
  end
45
42
 
@@ -47,7 +44,6 @@ class Dependinator
47
44
  def enhance_preprocesed_file_dependencies(files)
48
45
  files.each do |filepath|
49
46
  @rake_wrapper[filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
50
- @rake_wrapper[filepath].enhance( [@configurator.ceedling_build_info_filepath] )
51
47
  end
52
48
  end
53
49
 
@@ -57,7 +53,6 @@ class Dependinator
57
53
  mocks_list.each do |mock_filepath|
58
54
  @rake_wrapper[mock_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
59
55
  @rake_wrapper[mock_filepath].enhance( [@configurator.cmock_unity_helper] ) if (@configurator.cmock_unity_helper)
60
- @rake_wrapper[mock_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
61
56
  @rake_wrapper[mock_filepath].enhance( [@configurator.cmock_build_info_filepath] )
62
57
  end
63
58
  end
@@ -66,7 +61,6 @@ class Dependinator
66
61
  def enhance_dependencies_dependencies(dependencies)
67
62
  dependencies.each do |dependencies_filepath|
68
63
  @rake_wrapper[dependencies_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
69
- @rake_wrapper[dependencies_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
70
64
  end
71
65
  end
72
66
 
@@ -74,14 +68,12 @@ class Dependinator
74
68
  def enhance_test_build_object_dependencies(objects)
75
69
  objects.each do |object_filepath|
76
70
  @rake_wrapper[object_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
77
- @rake_wrapper[object_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
78
71
  end
79
72
  end
80
-
73
+
81
74
 
82
75
  def enhance_results_dependencies(result_filepath)
83
76
  @rake_wrapper[result_filepath].enhance( [@configurator.project_test_force_rebuild_filepath] ) if (@project_config_manager.test_config_changed)
84
- @rake_wrapper[result_filepath].enhance( [@configurator.ceedling_build_info_filepath] )
85
77
  end
86
78
 
87
79
 
@@ -1,38 +1,36 @@
1
1
  require 'ceedling/constants'
2
2
  require 'ceedling/file_path_utils'
3
-
3
+ require 'ceedling/version'
4
4
 
5
5
  desc "Display build environment version info."
6
6
  task :version do
7
- tools = [
8
- [' Ceedling', CEEDLING_ROOT],
7
+ puts " Ceedling:: #{Ceedling::VERSION::Ceedling}"
8
+
9
+ [
9
10
  ['CException', File.join( CEEDLING_VENDOR, CEXCEPTION_ROOT_PATH)],
10
11
  [' CMock', File.join( CEEDLING_VENDOR, CMOCK_ROOT_PATH)],
11
12
  [' Unity', File.join( CEEDLING_VENDOR, UNITY_ROOT_PATH)],
12
- ]
13
-
14
- tools.each do |tool|
13
+ ].each do |tool|
15
14
  name = tool[0]
16
15
  base_path = tool[1]
17
-
16
+
18
17
  version_string = @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'version.info') ).strip
19
18
  build_string = @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'build.info') ).strip
20
19
  puts "#{name}:: #{version_string.empty? ? '#.#.' : (version_string + '.')}#{build_string.empty? ? '?' : build_string}"
21
20
  end
22
21
  end
23
22
 
24
-
25
23
  desc "Set verbose output (silent:[#{Verbosity::SILENT}] - obnoxious:[#{Verbosity::OBNOXIOUS}])."
26
24
  task :verbosity, :level do |t, args|
27
25
  verbosity_level = args.level.to_i
28
-
26
+
29
27
  if (PROJECT_USE_MOCKS)
30
28
  # don't store verbosity level in setupinator's config hash, use a copy;
31
29
  # otherwise, the input configuration will change and trigger entire project rebuilds
32
30
  hash = @ceedling[:setupinator].config_hash[:cmock].clone
33
31
  hash[:verbosity] = verbosity_level
34
32
 
35
- @ceedling[:cmock_builder].manufacture( hash )
33
+ @ceedling[:cmock_builder].manufacture( hash )
36
34
  end
37
35
 
38
36
  @ceedling[:configurator].project_verbosity = verbosity_level
@@ -41,13 +39,11 @@ task :verbosity, :level do |t, args|
41
39
  verbose( ((verbosity_level >= Verbosity::OBNOXIOUS) ? true : false) )
42
40
  end
43
41
 
44
-
45
42
  desc "Enable logging"
46
43
  task :logging do
47
44
  @ceedling[:configurator].project_logging = true
48
45
  end
49
46
 
50
-
51
47
  # non advertised debug task
52
48
  task :debug do
53
49
  Rake::Task[:verbosity].invoke(Verbosity::DEBUG)
@@ -55,14 +51,12 @@ task :debug do
55
51
  @ceedling[:configurator].project_debug = true
56
52
  end
57
53
 
58
-
59
54
  # non advertised sanity checking task
60
55
  task :sanity_checks, :level do |t, args|
61
56
  check_level = args.level.to_i
62
57
  @ceedling[:configurator].sanity_checks = check_level
63
58
  end
64
59
 
65
-
66
60
  # list expanded environment variables
67
61
  if (not ENVIRONMENT.empty?)
68
62
  desc "List all configured environment variables."
@@ -72,11 +66,10 @@ task :environment do
72
66
  name = key.to_s.upcase
73
67
  puts " - #{name}: \"#{env[key]}\""
74
68
  end
75
- end
69
+ end
76
70
  end
77
71
  end
78
72
 
79
-
80
73
  namespace :options do
81
74
 
82
75
  COLLECTION_PROJECT_OPTIONS.each do |option_path|
@@ -2,7 +2,7 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.15.3"
5
+ GEM = "0.15.4"
6
6
 
7
7
  # @private
8
8
  CEEDLING = GEM
@@ -10,7 +10,7 @@ describe 'Ceedling' do
10
10
  # execute method
11
11
  location = Ceedling.location
12
12
  # validate results
13
- location.should == ceedling_path
13
+ expect(location).to eq(ceedling_path)
14
14
  end
15
15
  end
16
16
 
@@ -23,7 +23,7 @@ describe 'Ceedling' do
23
23
  # execute method
24
24
  location = Ceedling.load_path
25
25
  # validate results
26
- location.should == load_path
26
+ expect(location).to eq(load_path)
27
27
  end
28
28
  end
29
29
 
@@ -36,7 +36,7 @@ describe 'Ceedling' do
36
36
  # execute method
37
37
  location = Ceedling.rakefile
38
38
  # validate results
39
- location.should == rakefile_path
39
+ expect(location).to eq(rakefile_path)
40
40
  end
41
41
  end
42
42
 
@@ -51,7 +51,7 @@ describe 'Ceedling' do
51
51
  # execute method
52
52
  Ceedling.load_project
53
53
  # validate results
54
- ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './project.yml'
54
+ expect(ENV['CEEDLING_MAIN_PROJECT_FILE']).to eq('./project.yml')
55
55
  end
56
56
 
57
57
  it 'should load the project with the specified yaml file' do
@@ -64,7 +64,7 @@ describe 'Ceedling' do
64
64
  # execute method
65
65
  Ceedling.load_project(config: './foo.yml')
66
66
  # validate results
67
- ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './foo.yml'
67
+ expect(ENV['CEEDLING_MAIN_PROJECT_FILE']).to eq('./foo.yml')
68
68
  end
69
69
 
70
70
  it 'should load the project with the yaml file specified by the existing environment variable' do
@@ -77,7 +77,7 @@ describe 'Ceedling' do
77
77
  # execute method
78
78
  Ceedling.load_project
79
79
  # validate results
80
- ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './bar.yml'
80
+ expect(ENV['CEEDLING_MAIN_PROJECT_FILE']).to eq('./bar.yml')
81
81
  end
82
82
 
83
83
  it 'should load the project with the specified plugins enabled' do
@@ -96,7 +96,7 @@ describe 'Ceedling' do
96
96
  Ceedling.load_project( config: './foo.yml',
97
97
  plugins: ['foo'])
98
98
  # validate results
99
- ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './foo.yml'
99
+ expect(ENV['CEEDLING_MAIN_PROJECT_FILE']).to eq('./foo.yml')
100
100
  end
101
101
 
102
102
  it 'should set the project root if the root key is provided' do
@@ -112,8 +112,8 @@ describe 'Ceedling' do
112
112
  Ceedling.load_project( config: './foo.yml',
113
113
  root: './')
114
114
  # validate results
115
- ENV['CEEDLING_MAIN_PROJECT_FILE'].should == './foo.yml'
116
- PROJECT_ROOT.should == './'
115
+ expect(ENV['CEEDLING_MAIN_PROJECT_FILE']).to eq('./foo.yml')
116
+ expect(PROJECT_ROOT).to eq('./')
117
117
  end
118
118
  end
119
119
 
@@ -130,8 +130,8 @@ describe 'Ceedling' do
130
130
  # execute method
131
131
  Ceedling.register_plugin('foo')
132
132
  # validate results
133
- DEFAULT_CEEDLING_CONFIG[:plugins][:enabled].should == ["foo"]
134
- DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths].should == ["dummy/path"]
133
+ expect(DEFAULT_CEEDLING_CONFIG[:plugins][:enabled]).to eq ["foo"]
134
+ expect(DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths]).to eq(["dummy/path"])
135
135
  end
136
136
 
137
137
  it 'should register a plugin with an alternative prefix' do
@@ -146,8 +146,8 @@ describe 'Ceedling' do
146
146
  # execute method
147
147
  Ceedling.register_plugin('foo','prefix-')
148
148
  # validate results
149
- DEFAULT_CEEDLING_CONFIG[:plugins][:enabled].should == ["foo"]
150
- DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths].should == ["dummy/path"]
149
+ expect(DEFAULT_CEEDLING_CONFIG[:plugins][:enabled]).to eq(["foo"])
150
+ expect(DEFAULT_CEEDLING_CONFIG[:plugins][:load_paths]).to eq(["dummy/path"])
151
151
  end
152
152
  end
153
153
  end
@@ -1,6 +1,6 @@
1
1
  require 'ceedling/par_map'
2
2
 
3
- def short_task_should(n)
3
+ def short_task_should(n)
4
4
  done_count = 0
5
5
  par_map(n, [0.01] * (n - 1) + [0] * 10) do |seconds|
6
6
  sleep(seconds)
@@ -18,14 +18,14 @@ describe "par_map" do
18
18
  end
19
19
 
20
20
  it "should run shorter tasks while larger tasks are blocking (with 3 threads)" do
21
- short_task_should(3)
21
+ short_task_should(3)
22
22
  end
23
23
 
24
24
  it "should run shorter tasks while larger tasks are blocking (with 4 threads)" do
25
25
  short_task_should(4)
26
- end
26
+ end
27
27
 
28
- #the following two tests are still slightly nondeterministic and may occasionally
28
+ #the following two tests are still slightly nondeterministic and may occasionally
29
29
  # show false positives (though we think we've gotten it pretty stable)
30
30
  it "should collide if multiple threads are used" do
31
31
  is_running = false
@@ -40,18 +40,18 @@ describe "par_map" do
40
40
  sleep(0.01 * x)
41
41
  is_running = false
42
42
  end
43
- collision.should be true
43
+ expect(collision).to eq true
44
44
  end
45
45
 
46
46
  it "should be serial if only one thread is used" do
47
47
  is_running = false
48
48
  par_map(1, (1..5).to_a) do |x|
49
- is_running.should be false
49
+ expect(is_running).to eq false
50
50
  is_running = true
51
51
  sleep(0.01 * x)
52
52
  is_running = false
53
53
  end
54
54
  end
55
55
 
56
-
57
- end
56
+
57
+ end
@@ -32,9 +32,9 @@ describe PreprocessinatorExtractor do
32
32
  'some_additional_awesome_want_text();',
33
33
  ]
34
34
 
35
- File.should_receive(:readlines).with(file_path).and_return( input_str )
35
+ expect(File).to receive(:readlines).with(file_path).and_return( input_str )
36
36
 
37
- subject.extract_base_file_from_preprocessed_expansion(file_path).should == expect_str
37
+ expect(subject.extract_base_file_from_preprocessed_expansion(file_path)).to eq expect_str
38
38
  end
39
39
 
40
40
  # These were originally hinted at by the old test, but we don't see anything
@@ -27,8 +27,8 @@ describe PreprocessinatorIncludesHandler do
27
27
  # create test state/variables
28
28
  # mocks/stubs/expected calls
29
29
  inc_list_double = double('inc-list-double')
30
- @file_path_utils.should_receive(:form_preprocessed_includes_list_filepath).with('some_source_file.c').and_return(inc_list_double)
31
- @task_invoker.should_receive(:invoke_test_shallow_include_lists).with( [inc_list_double] )
30
+ expect(@file_path_utils).to receive(:form_preprocessed_includes_list_filepath).with('some_source_file.c').and_return(inc_list_double)
31
+ expect(@task_invoker).to receive(:invoke_test_shallow_include_lists).with( [inc_list_double] )
32
32
  # execute method
33
33
  subject.invoke_shallow_includes_list('some_source_file.c')
34
34
  # validate results
@@ -39,23 +39,23 @@ describe PreprocessinatorIncludesHandler do
39
39
  it 'should return an annotated dependency rule generated by the preprocessor' do
40
40
  # create test state/variables
41
41
  # mocks/stubs/expected calls
42
- @file_path_utils.should_receive(:form_temp_path).with('some_source_file.c','_').and_return('_some_source_file.c')
42
+ expect(@file_path_utils).to receive(:form_temp_path).with('some_source_file.c','_').and_return('_some_source_file.c')
43
43
  contents_double = double('contents-double')
44
- @file_wrapper.should_receive(:read).with('some_source_file.c').and_return(contents_double)
45
- contents_double.should_receive(:gsub!).with(/^\s*#include\s+[\"<]\s*(\S+)\s*[\">]/, "#include \"\\1\"\n#include \"@@@@\\1\"")
46
- @file_wrapper.should_receive(:write).with('_some_source_file.c', contents_double)
47
- @configurator.should_receive(:tools_test_includes_preprocessor).and_return('cpp')
44
+ expect(@file_wrapper).to receive(:read).with('some_source_file.c').and_return(contents_double)
45
+ expect(contents_double).to receive(:gsub!).with(/^\s*#include\s+[\"<]\s*(\S+)\s*[\">]/, "#include \"\\1\"\n#include \"@@@@\\1\"")
46
+ expect(@file_wrapper).to receive(:write).with('_some_source_file.c', contents_double)
47
+ expect(@configurator).to receive(:tools_test_includes_preprocessor).and_return('cpp')
48
48
  command_double = double('command-double')
49
- @tool_executor.should_receive(:build_command_line).with('cpp', '_some_source_file.c').and_return(command_double)
50
- command_double.should_receive(:[]).with(:line).and_return('cpp')
51
- command_double.should_receive(:[]).with(:options).and_return(['arg1','arg2'])
49
+ expect(@tool_executor).to receive(:build_command_line).with('cpp', '_some_source_file.c').and_return(command_double)
50
+ expect(command_double).to receive(:[]).with(:line).and_return('cpp')
51
+ expect(command_double).to receive(:[]).with(:options).and_return(['arg1','arg2'])
52
52
  output_double = double('output-double')
53
- @tool_executor.should_receive(:exec).with('cpp',['arg1','arg2']).and_return(output_double)
54
- output_double.should_receive(:[]).with(:output).and_return('make-rule')
53
+ expect(@tool_executor).to receive(:exec).with('cpp',['arg1','arg2']).and_return(output_double)
54
+ expect(output_double).to receive(:[]).with(:output).and_return('make-rule')
55
55
  # execute method
56
56
  results = subject.form_shallow_dependencies_rule('some_source_file.c')
57
57
  # validate results
58
- results.should == 'make-rule'
58
+ expect(results).to eq 'make-rule'
59
59
  end
60
60
  end
61
61
 
@@ -63,7 +63,7 @@ describe PreprocessinatorIncludesHandler do
63
63
  it 'should return the list of direct dependencies for the given test file' do
64
64
  # create test state/variables
65
65
  # mocks/stubs/expected calls
66
- @configurator.should_receive(:extension_header).and_return('.h')
66
+ expect(@configurator).to receive(:extension_header).and_return('.h')
67
67
  # execute method
68
68
  results = subject.extract_shallow_includes(%q{
69
69
  _test_DUMMY.o: Build/temp/_test_DUMMY.c \
@@ -75,7 +75,7 @@ describe PreprocessinatorIncludesHandler do
75
75
  @@@@some_other_lib/some_header2.h
76
76
  })
77
77
  # validate results
78
- results.should == ['some_header1.h',
78
+ expect(results).to eq ['some_header1.h',
79
79
  'some_lib/some_header2.h',
80
80
  'some_other_lib/some_header2.h']
81
81
  end
@@ -83,7 +83,7 @@ describe PreprocessinatorIncludesHandler do
83
83
  it 'should return the list of direct dependencies for the given test file' do
84
84
  # create test state/variables
85
85
  # mocks/stubs/expected calls
86
- @configurator.should_receive(:extension_header).and_return('.h')
86
+ expect(@configurator).to receive(:extension_header).and_return('.h')
87
87
  # execute method
88
88
  results = subject.extract_shallow_includes(%q{
89
89
  _test_DUMMY.o: Build/temp/_test_DUMMY.c \
@@ -95,7 +95,7 @@ describe PreprocessinatorIncludesHandler do
95
95
  @@@@some_other_lib/some_header2.h
96
96
  })
97
97
  # validate results
98
- results.should == ['some_header1.h',
98
+ expect(results).to eq ['some_header1.h',
99
99
  'some_lib/some_header2.h',
100
100
  'some_other_lib/some_header2.h']
101
101
  end
@@ -103,7 +103,7 @@ describe PreprocessinatorIncludesHandler do
103
103
  it 'should correctly handle path separators' do
104
104
  # create test state/variables
105
105
  # mocks/stubs/expected calls
106
- @configurator.should_receive(:extension_header).and_return('.h')
106
+ expect(@configurator).to receive(:extension_header).and_return('.h')
107
107
  # execute method
108
108
  results = subject.extract_shallow_includes(%q{
109
109
  _test_DUMMY.o: Build/temp/_test_DUMMY.c \
@@ -117,7 +117,7 @@ describe PreprocessinatorIncludesHandler do
117
117
  @@@@some_other_lib/some_header2.h
118
118
  })
119
119
  # validate results
120
- results.should == ['some_header1.h',
120
+ expect(results).to eq ['some_header1.h',
121
121
  'some_lib/some_header2.h',
122
122
  'some_lib1/some_lib/some_header2.h',
123
123
  'some_other_lib/some_header2.h']
@@ -126,7 +126,7 @@ describe PreprocessinatorIncludesHandler do
126
126
  it 'exclude annotated headers with no matching "real" header' do
127
127
  # create test state/variables
128
128
  # mocks/stubs/expected calls
129
- @configurator.should_receive(:extension_header).and_return('.h')
129
+ expect(@configurator).to receive(:extension_header).and_return('.h')
130
130
  # execute method
131
131
  results = subject.extract_shallow_includes(%q{
132
132
  _test_DUMMY.o: Build/temp/_test_DUMMY.c \
@@ -135,13 +135,13 @@ describe PreprocessinatorIncludesHandler do
135
135
  @@@@some_lib/some_header2.h
136
136
  })
137
137
  # validate results
138
- results.should == ['some_header1.h']
138
+ expect(results).to eq ['some_header1.h']
139
139
  end
140
140
 
141
141
  it 'should correctly filter secondary dependencies' do
142
142
  # create test state/variables
143
143
  # mocks/stubs/expected calls
144
- @configurator.should_receive(:extension_header).and_return('.h')
144
+ expect(@configurator).to receive(:extension_header).and_return('.h')
145
145
  # execute method
146
146
  results = subject.extract_shallow_includes(%q{
147
147
  _test_DUMMY.o: Build/temp/_test_DUMMY.c \
@@ -156,7 +156,7 @@ describe PreprocessinatorIncludesHandler do
156
156
  @@@@some_other_lib/some_header2.h
157
157
  })
158
158
  # validate results
159
- results.should == ['some_header1.h',
159
+ expect(results).to eq ['some_header1.h',
160
160
  'some_lib/some_header2.h',
161
161
  'some_other_lib/some_header2.h']
162
162
  end
@@ -166,7 +166,7 @@ describe PreprocessinatorIncludesHandler do
166
166
  it 'should invoke the rake task which will build included files' do
167
167
  # create test state/variables
168
168
  # mocks/stubs/expected calls
169
- @yaml_wrapper.should_receive(:dump).with('some_source_file.c', [])
169
+ expect(@yaml_wrapper).to receive(:dump).with('some_source_file.c', [])
170
170
  # execute method
171
171
  subject.write_shallow_includes_list('some_source_file.c', [])
172
172
  # validate results