ceedling 0.15.4 → 0.15.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 820de69c03254ab70dba861eb547edfbcd6ca948
4
+ data.tar.gz: 91817c1f9ba91ad922daa5a9af3d87af69b5f602
5
+ SHA512:
6
+ metadata.gz: 12582b3bd3f143baf7c53ee33cbf806a69899c769d9da0067e1501ac4ad73ffe117554e915826b325dfb8e694afe6786773464c2c90dba023b06ba2566f5298c
7
+ data.tar.gz: 279615504d80ac07420f568a5efe4ca275677ab4649cbb865ab835ccee003ceeb2aadd11b7e8983350f7a206ea50b9206cf38caf9b631f3e683bb66a609e4c28
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "http://rubygems.org/"
3
3
  gem "bundler", ">= 1.3.5"
4
4
  gem "rake", ">= 0.9.2.2"
5
5
 
6
- gem "rspec", "~> 3.0"
6
+ gem "rspec", "~> 2.14.1"
7
7
  gem "require_all"
8
8
  gem "constructor"
9
9
  gem "diy"
@@ -8,18 +8,14 @@ GEM
8
8
  rake (10.3.2)
9
9
  require_all (1.3.2)
10
10
  rr (1.1.2)
11
- rspec (3.0.0)
12
- rspec-core (~> 3.0.0)
13
- rspec-expectations (~> 3.0.0)
14
- rspec-mocks (~> 3.0.0)
15
- rspec-core (3.0.3)
16
- rspec-support (~> 3.0.0)
17
- rspec-expectations (3.0.3)
18
- diff-lcs (>= 1.2.0, < 2.0)
19
- rspec-support (~> 3.0.0)
20
- rspec-mocks (3.0.3)
21
- rspec-support (~> 3.0.0)
22
- rspec-support (3.0.3)
11
+ rspec (2.14.1)
12
+ rspec-core (~> 2.14.0)
13
+ rspec-expectations (~> 2.14.0)
14
+ rspec-mocks (~> 2.14.0)
15
+ rspec-core (2.14.8)
16
+ rspec-expectations (2.14.5)
17
+ diff-lcs (>= 1.1.3, < 2.0)
18
+ rspec-mocks (2.14.6)
23
19
  thor (0.19.1)
24
20
 
25
21
  PLATFORMS
@@ -32,5 +28,5 @@ DEPENDENCIES
32
28
  rake (>= 0.9.2.2)
33
29
  require_all
34
30
  rr
35
- rspec (~> 3.0)
31
+ rspec (~> 2.14.1)
36
32
  thor
data/README.md CHANGED
@@ -1,10 +1,6 @@
1
1
  Ceedling - Build/test system for C based on Ruby/Rake
2
2
  =====================================================
3
3
 
4
- [![Ceedling Build Status](https://api.travis-ci.org/ThrowTheSwitch/Ceedling.png?branch=master)](https://travis-ci.org/ThrowTheSwitch/Ceedling)
5
-
6
- Ceedling is a build system for C projects that is something of an extension around Ruby’s Rake (make-ish) build system. Ceedling also makes TDD (Test-Driven Development) in C a breeze by integrating [CMock](https://github.com/throwtheswitch/cmock), [Unity](https://github.com/throwtheswitch/unity), and [CException](https://github.com/throwtheswitch/cexception) -- three other awesome open-source projects you can’t live without if you're creating awesomeness in the C language. Ceedling is also extensible with a handy plugin mechanism.
7
-
8
4
  Usage Documentation
9
5
  ===================
10
6
 
data/Rakefile CHANGED
@@ -1,14 +1,10 @@
1
1
  #!/usr/bin/env rake
2
2
  require 'bundler'
3
-
4
- task :ci => [:bundle_install, :spec]
5
-
6
3
  require 'rspec/core/rake_task'
4
+
7
5
  desc "Run all rspecs"
8
6
  RSpec::Core::RakeTask.new(:spec) do |t|
9
7
  t.pattern = 'spec/**/*_spec.rb'
10
8
  end
11
9
 
12
- task :bundle_install do
13
- sh 'bundle install'
14
- end
10
+ task :ci => [:spec]
@@ -46,7 +46,7 @@ class CeedlingTasks < Thor
46
46
  end
47
47
  end
48
48
 
49
- folders = %w{plugins lib}
49
+ folders = %w{plugins lib release}
50
50
  folders.map do |f|
51
51
  {:src => f, :dst => File.join(ceedling_path, f)}
52
52
  end.each do |f|
@@ -1,6 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $LOAD_PATH << File.expand_path(File.join(File.dirname(__FILE__), 'lib'))
3
3
  require "ceedling/version"
4
+ require 'date'
4
5
 
5
6
  Gem::Specification.new do |s|
6
7
  s.name = "ceedling"
@@ -13,14 +14,12 @@ Gem::Specification.new do |s|
13
14
  s.description = %q{Ceedling provides a set of tools to deploy its guts in a folder or which can be required in a Rakefile}
14
15
  s.licenses = ['MIT']
15
16
 
16
- s.rubyforge_project = "ceedling"
17
-
18
17
  s.add_dependency "thor", ">= 0.14.5"
19
18
  s.add_dependency "rake", ">= 0.8.7"
20
19
 
21
20
  # Files needed from submodules
22
21
  s.files = []
23
- s.files += Dir['vendor/**/docs/**/*.pdf', 'docs/**/*.pdf', 'vendor/**/docs/**/*.md', 'docs/**/*.md']
22
+ s.files += Dir['vendor/**/docs/**/*.pdf', 'docs/**/*.pdf']
24
23
  s.files += Dir['vendor/cmock/lib/**/*.rb']
25
24
  s.files += Dir['vendor/cmock/config/**/*.rb']
26
25
  s.files += Dir['vendor/cmock/release/**/*.info']
@@ -7,10 +7,10 @@ require 'ceedling/constants' # for Verbosity constants class & base file p
7
7
 
8
8
 
9
9
  class ConfiguratorBuilder
10
-
10
+
11
11
  constructor :file_system_utils, :file_wrapper, :system_wrapper
12
-
13
-
12
+
13
+
14
14
  def build_global_constants(config)
15
15
  config.each_pair do |key, value|
16
16
  formatted_key = key.to_s.upcase
@@ -21,7 +21,7 @@ class ConfiguratorBuilder
21
21
  end
22
22
  end
23
23
 
24
-
24
+
25
25
  def build_accessor_methods(config, context)
26
26
  config.each_pair do |key, value|
27
27
  # fill configurator object with accessor methods
@@ -29,11 +29,11 @@ class ConfiguratorBuilder
29
29
  end
30
30
  end
31
31
 
32
-
32
+
33
33
  # create a flattened hash from the original configuration structure
34
34
  def flattenify(config)
35
35
  new_hash = {}
36
-
36
+
37
37
  config.each_key do | parent |
38
38
 
39
39
  # gracefully handle empty top-level entries
@@ -54,13 +54,13 @@ class ConfiguratorBuilder
54
54
  else
55
55
  new_hash["#{parent.to_s.downcase}".to_sym] = config[parent]
56
56
  end
57
-
57
+
58
58
  end
59
-
59
+
60
60
  return new_hash
61
61
  end
62
62
 
63
-
63
+
64
64
  def populate_defaults(config, defaults)
65
65
  defaults.keys.sort.each do |section|
66
66
  defaults[section].keys.sort.each do |entry|
@@ -118,7 +118,7 @@ class ConfiguratorBuilder
118
118
  build_path_name = path[0]
119
119
  build_path = path[1]
120
120
  build_path_add_condition = path[2]
121
-
121
+
122
122
  # insert path into build paths if associated with true condition
123
123
  out_hash[:project_build_paths] << build_path if build_path_add_condition
124
124
  # set path symbol name and path for each entry in paths array
@@ -131,7 +131,7 @@ class ConfiguratorBuilder
131
131
 
132
132
  def set_force_build_filepaths(in_hash)
133
133
  out_hash = {}
134
-
134
+
135
135
  out_hash[:project_test_force_rebuild_filepath] = File.join( in_hash[:project_test_dependencies_path], 'force_build' )
136
136
  out_hash[:project_release_force_rebuild_filepath] = File.join( in_hash[:project_release_dependencies_path], 'force_build' ) if (in_hash[:project_release_build])
137
137
 
@@ -141,7 +141,7 @@ class ConfiguratorBuilder
141
141
 
142
142
  def set_rakefile_components(in_hash)
143
143
  out_hash = {
144
- :project_rakefile_component_files =>
144
+ :project_rakefile_component_files =>
145
145
  [File.join(CEEDLING_LIB, 'ceedling', 'tasks_base.rake'),
146
146
  File.join(CEEDLING_LIB, 'ceedling', 'tasks_filesystem.rake'),
147
147
  File.join(CEEDLING_LIB, 'ceedling', 'tasks_tests.rake'),
@@ -160,72 +160,79 @@ class ConfiguratorBuilder
160
160
 
161
161
  return out_hash
162
162
  end
163
-
163
+
164
164
 
165
165
  def set_library_build_info_filepaths(hash)
166
+
166
167
  # Notes:
167
- # - Dependency on a change to our input configuration hash is handled elsewhere as it is
168
+ # - Dependency on a change to our input configuration hash is handled elsewhere as it is
168
169
  # dynamically formed during ceedling's execution
169
170
  # - Compiled vendor dependencies like cmock.o, unity.o, cexception.o are handled below;
170
171
  # here we're interested only in ceedling-based code generation dependencies
172
+
173
+ ceedling_build_info_filepath = File.join(CEEDLING_RELEASE, 'build.info')
174
+ cmock_build_info_filepath = FilePathUtils::form_ceedling_vendor_path('cmock/release', 'build.info')
175
+
171
176
  out_hash = {
172
- :cmock_build_info_filepath => FilePathUtils::form_ceedling_vendor_path('cmock/release', 'build.info')
177
+ :ceedling_build_info_filepath => ceedling_build_info_filepath,
178
+ :cmock_build_info_filepath => cmock_build_info_filepath
173
179
  }
180
+
174
181
  return out_hash
175
182
  end
176
183
 
177
-
184
+
178
185
  def set_release_target(in_hash)
179
186
  return {} if (not in_hash[:project_release_build])
180
-
187
+
181
188
  release_target_file = ((in_hash[:release_build_output].nil?) ? (DEFAULT_RELEASE_TARGET_NAME.ext(in_hash[:extension_executable])) : in_hash[:release_build_output])
182
189
  release_map_file = ((in_hash[:release_build_output].nil?) ? (DEFAULT_RELEASE_TARGET_NAME.ext(in_hash[:extension_map])) : in_hash[:release_build_output].ext(in_hash[:extension_map]))
183
-
190
+
184
191
  return {
185
192
  # tempted to make a helper method in file_path_utils? stop right there, pal. you'll introduce a cyclical dependency
186
193
  :project_release_build_target => File.join(in_hash[:project_build_release_root], release_target_file),
187
194
  :project_release_build_map => File.join(in_hash[:project_build_release_root], release_map_file)
188
195
  }
189
196
  end
190
-
197
+
191
198
 
192
199
  def collect_project_options(in_hash)
193
200
  options = []
194
-
201
+
195
202
  in_hash[:project_options_paths].each do |path|
196
203
  options << @file_wrapper.directory_listing( File.join(path, '*.yml') )
197
204
  end
198
-
205
+
199
206
  return {
200
207
  :collection_project_options => options.flatten
201
208
  }
202
209
  end
203
-
210
+
204
211
 
205
212
  def expand_all_path_globs(in_hash)
206
213
  out_hash = {}
207
214
  path_keys = []
208
-
215
+
209
216
  in_hash.each_key do |key|
210
217
  next if (not key.to_s[0..4] == 'paths')
211
218
  path_keys << key
212
219
  end
213
-
220
+
214
221
  # sorted to provide assured order of traversal in test calls on mocks
215
222
  path_keys.sort.each do |key|
216
223
  out_hash["collection_#{key.to_s}".to_sym] = @file_system_utils.collect_paths( in_hash[key] )
217
224
  end
218
-
225
+
219
226
  return out_hash
220
227
  end
221
228
 
222
229
 
223
230
  def collect_source_and_include_paths(in_hash)
224
231
  return {
225
- :collection_paths_source_and_include =>
226
- ( in_hash[:collection_paths_source] +
232
+ :collection_paths_source_and_include =>
233
+ ( in_hash[:collection_paths_source] +
227
234
  in_hash[:collection_paths_include] ).select {|x| File.directory?(x)}
228
- }
235
+ }
229
236
  end
230
237
 
231
238
 
@@ -234,38 +241,38 @@ class ConfiguratorBuilder
234
241
  extra_paths << FilePathUtils::form_ceedling_vendor_path(CEXCEPTION_LIB_PATH) if (in_hash[:project_use_exceptions])
235
242
 
236
243
  return {
237
- :collection_paths_source_include_vendor =>
238
- in_hash[:collection_paths_source_and_include] +
244
+ :collection_paths_source_include_vendor =>
245
+ in_hash[:collection_paths_source_and_include] +
239
246
  extra_paths
240
- }
247
+ }
241
248
  end
242
249
 
243
250
 
244
251
  def collect_test_support_source_include_paths(in_hash)
245
252
  return {
246
- :collection_paths_test_support_source_include =>
253
+ :collection_paths_test_support_source_include =>
247
254
  (in_hash[:collection_paths_test] +
248
255
  in_hash[:collection_paths_support] +
249
- in_hash[:collection_paths_source] +
256
+ in_hash[:collection_paths_source] +
250
257
  in_hash[:collection_paths_include] ).select {|x| File.directory?(x)}
251
- }
258
+ }
252
259
  end
253
260
 
254
261
 
255
262
  def collect_vendor_paths(in_hash)
256
263
  return {:collection_paths_vendor => get_vendor_paths(in_hash)}
257
264
  end
258
-
265
+
259
266
 
260
267
  def collect_test_support_source_include_vendor_paths(in_hash)
261
268
  return {
262
- :collection_paths_test_support_source_include_vendor =>
269
+ :collection_paths_test_support_source_include_vendor =>
263
270
  in_hash[:collection_paths_test_support_source_include] +
264
271
  get_vendor_paths(in_hash)
265
- }
272
+ }
266
273
  end
267
-
268
-
274
+
275
+
269
276
  def collect_tests(in_hash)
270
277
  all_tests = @file_wrapper.instantiate_file_list
271
278
 
@@ -283,11 +290,11 @@ class ConfiguratorBuilder
283
290
  all_assembly = @file_wrapper.instantiate_file_list
284
291
 
285
292
  return {:collection_all_assembly => all_assembly} if (not in_hash[:release_build_use_assembly])
286
-
293
+
287
294
  in_hash[:collection_paths_source].each do |path|
288
295
  all_assembly.include( File.join(path, "*#{in_hash[:extension_assembly]}") )
289
296
  end
290
-
297
+
291
298
  @file_system_utils.revise_file_list( all_assembly, in_hash[:files_assembly] )
292
299
 
293
300
  return {:collection_all_assembly => all_assembly}
@@ -304,7 +311,7 @@ class ConfiguratorBuilder
304
311
  end
305
312
  end
306
313
  @file_system_utils.revise_file_list( all_source, in_hash[:files_source] )
307
-
314
+
308
315
  return {:collection_all_source => all_source}
309
316
  end
310
317
 
@@ -312,18 +319,18 @@ class ConfiguratorBuilder
312
319
  def collect_headers(in_hash)
313
320
  all_headers = @file_wrapper.instantiate_file_list
314
321
 
315
- paths =
322
+ paths =
316
323
  in_hash[:collection_paths_test] +
317
324
  in_hash[:collection_paths_support] +
318
- in_hash[:collection_paths_source] +
325
+ in_hash[:collection_paths_source] +
319
326
  in_hash[:collection_paths_include]
320
-
327
+
321
328
  paths.each do |path|
322
329
  all_headers.include( File.join(path, "*#{in_hash[:extension_header]}") )
323
330
  end
324
331
 
325
332
  @file_system_utils.revise_file_list( all_headers, in_hash[:files_include] )
326
-
333
+
327
334
  return {:collection_all_headers => all_headers}
328
335
  end
329
336
 
@@ -331,13 +338,13 @@ class ConfiguratorBuilder
331
338
  def collect_all_existing_compilation_input(in_hash)
332
339
  all_input = @file_wrapper.instantiate_file_list
333
340
 
334
- paths =
335
- in_hash[:collection_paths_test] +
336
- in_hash[:collection_paths_support] +
337
- in_hash[:collection_paths_source] +
341
+ paths =
342
+ in_hash[:collection_paths_test] +
343
+ in_hash[:collection_paths_support] +
344
+ in_hash[:collection_paths_source] +
338
345
  in_hash[:collection_paths_include] +
339
346
  [FilePathUtils::form_ceedling_vendor_path(UNITY_LIB_PATH)]
340
-
347
+
341
348
  paths << FilePathUtils::form_ceedling_vendor_path(CEXCEPTION_LIB_PATH) if (in_hash[:project_use_exceptions])
342
349
  paths << FilePathUtils::form_ceedling_vendor_path(CMOCK_LIB_PATH) if (in_hash[:project_use_mocks])
343
350
 
@@ -349,14 +356,14 @@ class ConfiguratorBuilder
349
356
  all_input.include( File.join(path, "*#{in_hash[:extension_source]}") )
350
357
  end
351
358
  end
352
-
359
+
353
360
  @file_system_utils.revise_file_list( all_input, in_hash[:files_test] )
354
361
  @file_system_utils.revise_file_list( all_input, in_hash[:files_support] )
355
362
  @file_system_utils.revise_file_list( all_input, in_hash[:files_source] )
356
363
  @file_system_utils.revise_file_list( all_input, in_hash[:files_include] )
357
364
  # finding assembly files handled explicitly through other means
358
365
 
359
- return {:collection_all_existing_compilation_input => all_input}
366
+ return {:collection_all_existing_compilation_input => all_input}
360
367
  end
361
368
 
362
369
 
@@ -366,16 +373,16 @@ class ConfiguratorBuilder
366
373
  test_defines.concat(in_hash[:unity_defines])
367
374
  test_defines.concat(in_hash[:cmock_defines]) if (in_hash[:project_use_mocks])
368
375
  test_defines.concat(in_hash[:cexception_defines]) if (in_hash[:project_use_exceptions])
369
-
376
+
370
377
  return {:collection_defines_test_and_vendor => test_defines}
371
378
  end
372
379
 
373
380
 
374
381
  def collect_release_and_vendor_defines(in_hash)
375
382
  release_defines = in_hash[:defines_release].clone
376
-
383
+
377
384
  release_defines.concat(in_hash[:cexception_defines]) if (in_hash[:project_use_exceptions])
378
-
385
+
379
386
  return {:collection_defines_release_and_vendor => release_defines}
380
387
  end
381
388
 
@@ -388,29 +395,29 @@ class ConfiguratorBuilder
388
395
 
389
396
  return {:collection_release_artifact_extra_link_objects => objects}
390
397
  end
391
-
398
+
392
399
 
393
400
  def collect_test_fixture_extra_link_objects(in_hash)
394
401
  # Note: Symbols passed to compiler at command line can change Unity and CException behavior / configuration;
395
402
  # we also handle those dependencies elsewhere in compilation dependencies
396
-
403
+
397
404
  objects = [UNITY_C_FILE]
398
-
405
+
399
406
  # we don't include paths here because use of plugins or mixing different compilers may require different build paths
400
407
  objects << CEXCEPTION_C_FILE if (in_hash[:project_use_exceptions])
401
408
  objects << CMOCK_C_FILE if (in_hash[:project_use_mocks])
402
-
409
+
403
410
  # if we're using mocks & a unity helper is defined & that unity helper includes a source file component (not only a header of macros),
404
411
  # then link in the unity_helper object file too
405
412
  if ( in_hash[:project_use_mocks] and
406
- in_hash[:cmock_unity_helper] and
413
+ in_hash[:cmock_unity_helper] and
407
414
  @file_wrapper.exist?(in_hash[:cmock_unity_helper].ext(in_hash[:extension_source])) )
408
415
  objects << File.basename(in_hash[:cmock_unity_helper])
409
416
  end
410
417
 
411
418
  # no build paths here so plugins can remap if necessary (i.e. path mapping happens at runtime)
412
419
  objects.map! { |object| object.ext(in_hash[:extension_object]) }
413
-
420
+
414
421
  return { :collection_test_fixture_extra_link_objects => objects }
415
422
  end
416
423
 
@@ -426,5 +433,5 @@ class ConfiguratorBuilder
426
433
 
427
434
  return vendor_paths
428
435
  end
429
-
436
+
430
437
  end