ceedling 0.29.0 → 0.29.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/assets/project_as_gem.yml +2 -5
  3. data/assets/project_with_guts.yml +2 -5
  4. data/assets/project_with_guts_gcov.yml +2 -5
  5. data/bin/ceedling +14 -12
  6. data/ceedling.sublime-project +26 -23
  7. data/docs/CeedlingPacket.md +17 -2
  8. data/docs/CeedlingUpgrade.md +83 -0
  9. data/lib/ceedling/build_invoker_utils.rb +1 -1
  10. data/lib/ceedling/cacheinator_helper.rb +2 -2
  11. data/lib/ceedling/dependinator.rb +2 -2
  12. data/lib/ceedling/generator_test_results.rb +13 -2
  13. data/lib/ceedling/tasks_base.rake +17 -23
  14. data/lib/ceedling/tasks_filesystem.rake +12 -3
  15. data/lib/ceedling/tasks_tests.rake +1 -1
  16. data/lib/ceedling/test_invoker.rb +1 -1
  17. data/lib/ceedling/version.rb +28 -14
  18. data/plugins/gcov/gcov.rake +3 -3
  19. data/plugins/junit_tests_report/lib/junit_tests_report.rb +4 -3
  20. data/spec/spec_system_helper.rb +42 -2
  21. data/spec/support/test_example.fail +2 -0
  22. data/spec/support/test_example.pass +2 -0
  23. data/spec/support/test_example_ignore.pass +2 -0
  24. data/spec/support/test_example_mangled.pass +1 -0
  25. data/spec/support/test_example_with_time.pass +2 -0
  26. data/spec/system/deployment_spec.rb +6 -0
  27. data/vendor/cmock/docs/CMock_Summary.md +8 -1
  28. data/vendor/cmock/lib/cmock_config.rb +11 -1
  29. data/vendor/cmock/lib/cmock_generator.rb +7 -0
  30. data/vendor/cmock/lib/cmock_generator_plugin_callback.rb +2 -2
  31. data/vendor/cmock/lib/cmock_header_parser.rb +123 -13
  32. data/vendor/cmock/src/cmock.h +1 -1
  33. data/vendor/cmock/test/system/test_compilation/config.yml +1 -0
  34. data/vendor/cmock/test/system/test_compilation/inline.h +23 -0
  35. data/vendor/cmock/test/system/test_interactions/all_plugins_coexist.yml +1 -0
  36. data/vendor/cmock/test/unit/cmock_config_test.rb +3 -0
  37. data/vendor/cmock/test/unit/cmock_config_test.yml +2 -1
  38. data/vendor/cmock/test/unit/cmock_generator_main_test.rb +3 -0
  39. data/vendor/cmock/test/unit/cmock_generator_plugin_callback_test.rb +4 -4
  40. data/vendor/cmock/test/unit/cmock_header_parser_test.rb +272 -0
  41. metadata +4 -3
  42. data/out.fail +0 -22
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7af7d95453c0e7c09164e299afb08c59bd1004ebfb279e8857df5d117e0e7de
4
- data.tar.gz: 4f10c322dc7526a2296dcb725b726de50d353e303ddc16d3b47a62cf80c1a1b5
3
+ metadata.gz: 57518fcd5eccaf61d4bf5b6953233e73bd09043d749c0c17e14bde86a448908c
4
+ data.tar.gz: ebb08f8cb40fc19ac1808fb5d5670e6323beaf8415681a97c9e0dc0ab37265b6
5
5
  SHA512:
6
- metadata.gz: 18f1c30727ed97eb04c84116d50e698a5a9907beaf0448264595593cc2d790ff26ebe1c94265792c7373b4270f9276676929c669616b80098797d417f11d424e
7
- data.tar.gz: 02f2ac736750915514646d5818de1e5a37e66e2610d14e7649f66b00e12ac41de79f2708380d4669e6aaa3518885251ef2864c68a2572ac9ff79b87e8891a268
6
+ metadata.gz: 5fc75ecfbd7c086f807fade3847511fc4208102a14ed4d3dd5a7be3302388bf6ac1be38eedcb87ff6c74654979bb9c30750c442a6ee20969209c156b6faabb7c
7
+ data.tar.gz: c00944a53e45f50e1cf7daca6400f428dce69456c7db3d29092e3641ff577c3aaefc23c347ad5174f88d2766276d3599d11494424c6fe491cd87a72971668e4c
@@ -85,11 +85,8 @@
85
85
  :libraries:
86
86
  :placement: :end
87
87
  :flag: "${1}" # or "-L ${1}" for example
88
- :common: &common_libraries []
89
- :test:
90
- - *common_libraries
91
- :release:
92
- - *common_libraries
88
+ :test: []
89
+ :release: []
93
90
 
94
91
  :plugins:
95
92
  :load_paths:
@@ -85,11 +85,8 @@
85
85
  :libraries:
86
86
  :placement: :end
87
87
  :flag: "${1}" # or "-L ${1}" for example
88
- :common: &common_libraries []
89
- :test:
90
- - *common_libraries
91
- :release:
92
- - *common_libraries
88
+ :test: []
89
+ :release: []
93
90
 
94
91
  :plugins:
95
92
  :load_paths:
@@ -85,11 +85,8 @@
85
85
  :libraries:
86
86
  :placement: :end
87
87
  :flag: "${1}" # or "-L ${1}" for example
88
- :common: &common_libraries []
89
- :test:
90
- - *common_libraries
91
- :release:
92
- - *common_libraries
88
+ :test: []
89
+ :release: []
93
90
 
94
91
  :plugins:
95
92
  :load_paths:
@@ -49,16 +49,16 @@ unless (project_found)
49
49
  end
50
50
 
51
51
  desc "upgrade PROJECT_NAME", "upgrade ceedling for a project (not req'd if gem used)"
52
- method_option :docs, :type => :boolean, :default => false, :desc => "Add docs in project vendor directory"
53
- method_option :local, :type => :boolean, :default => false, :desc => "Create a copy of Ceedling in the project vendor directory"
54
- method_option :no_configs, :type => :boolean, :default => false, :desc => "Don't install starter configuration files"
55
- method_option :noconfigs, :type => :boolean, :default => false
56
-
57
- #deprecated:
58
- method_option :no_docs, :type => :boolean, :default => false
59
- method_option :nodocs, :type => :boolean, :default => false
60
52
  def upgrade(name, silent = false)
61
- copy_assets_and_create_structure(name, silent, true, options || {:upgrade => true})
53
+ as_local = true
54
+ begin
55
+ require "yaml"
56
+ as_local = (YAML.load_file(File.join(name, "project.yml"))[:project][:which_ceedling] != 'gem')
57
+ rescue
58
+ raise "ERROR: Could not find valid project file '#{yaml_path}'"
59
+ end
60
+ found_docs = File.exists?( File.join(name, "docs", "CeedlingPacket.md") )
61
+ copy_assets_and_create_structure(name, silent, true, {:upgrade => true, :no_configs => true, :local => as_local, :docs => found_docs})
62
62
  end
63
63
 
64
64
  no_commands do
@@ -207,9 +207,9 @@ unless (project_found)
207
207
  desc "version", "return the version of the tools installed"
208
208
  def version()
209
209
  require 'ceedling/version.rb'
210
- puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
211
- puts " CMock:: #{Ceedling::Version::CMOCK}"
212
- puts " Unity:: #{Ceedling::Version::UNITY}"
210
+ puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
211
+ puts " CMock:: #{Ceedling::Version::CMOCK}"
212
+ puts " Unity:: #{Ceedling::Version::UNITY}"
213
213
  puts " CException:: #{Ceedling::Version::CEXCEPTION}"
214
214
  end
215
215
  end
@@ -287,6 +287,8 @@ else
287
287
  options[:list_tasks] = true
288
288
  when /^-T$/
289
289
  options[:list_tasks] = true
290
+ when /^--tasks$/
291
+ options[:list_tasks] = true
290
292
  when /^project:(\w+)/
291
293
  ENV['CEEDLING_USER_PROJECT_FILE'] = "#{$1}.yml"
292
294
  else
@@ -1,25 +1,28 @@
1
1
  {
2
- "folders":
3
- [
4
- {
5
- "folder_exclude_patterns":
6
- [
7
- "backup",
8
- "build"
9
- ],
10
- "file_exclude_patterns":
11
- [
12
- ".*",
13
- "*.sublime*"
14
- ],
15
- "path": ".."
16
- }
17
- ],
18
- "settings":
19
- {
20
- "tab_size": 4,
21
- "translate_tabs_to_spaces": true,
22
- "use_tab_stops": false,
23
- "word_wrap": false
24
- }
2
+ "folders":
3
+ [
4
+ {
5
+ "file_exclude_patterns":
6
+ [
7
+ ".*",
8
+ "*.sublime*"
9
+ ],
10
+ "folder_exclude_patterns":
11
+ [
12
+ "backup",
13
+ "build"
14
+ ],
15
+ "path": "C:\\projects"
16
+ },
17
+ {
18
+ "path": "C:\\Ruby25-x64\\lib\\ruby\\gems\\2.5.0\\gems\\ceedling-0.29.0"
19
+ }
20
+ ],
21
+ "settings":
22
+ {
23
+ "tab_size": 4,
24
+ "translate_tabs_to_spaces": true,
25
+ "use_tab_stops": false,
26
+ "word_wrap": false
27
+ }
25
28
  }
@@ -259,7 +259,7 @@ Ceedling (more on this later).
259
259
  * `ceedling environment`:
260
260
 
261
261
  List all configured environment variable names and string values. This
262
- task is helpful in verifying the evaluatio of any Ruby expressions in
262
+ task is helpful in verifying the evaluation of any Ruby expressions in
263
263
  the [:environment] section of your config file.`: Note: Ceedling may
264
264
  set some convenience environment variables by default.
265
265
 
@@ -1414,6 +1414,21 @@ Example [:flags] YAML blurb
1414
1414
  - --baz
1415
1415
  ```
1416
1416
 
1417
+ **import**: allow to load other config files
1418
+
1419
+ In some cases it is nice to have config files (project.yml, options files) which can
1420
+ load other config files, for commonly re-used definitions (target processor,
1421
+ common code modules, etc).
1422
+ These can be recursively nested, the included files can include other files.
1423
+
1424
+ Example [:import] YAML blurb
1425
+
1426
+ ```yaml
1427
+ :import:
1428
+ - path/to/config.yml
1429
+ - path/to/another/config.yml
1430
+ ```
1431
+
1417
1432
  Ceedling sets values for a subset of CMock settings. All CMock
1418
1433
  options are available to be set, but only those options set by
1419
1434
  Ceedling in an automated fashion are documented below. See CMock
@@ -1876,7 +1891,7 @@ Notes:
1876
1891
  * `COLLECTION_DEFINES_RELEASE_AND_VENDOR`:
1877
1892
 
1878
1893
  All symbols specified in [:defines][:release] plus symbols defined by
1879
- [:cexception][:defines] if exceptions are ena bled
1894
+ [:cexception][:defines] if exceptions are enabled
1880
1895
 
1881
1896
 
1882
1897
  Notes:
@@ -0,0 +1,83 @@
1
+ # Upgrading Ceedling
2
+
3
+ You'd like to stay in sync with the latest Ceedling... and who wouldn't? Depending on
4
+ how you've made use of Ceedling, that may vary slightly. No matter what, though, our first
5
+ step is to update Ceedling itself.
6
+
7
+ ## Step 1: Update Ceedling Itself
8
+
9
+ ```
10
+ gem update ceedling
11
+ ```
12
+
13
+ That should do it... unless you don't have a valid connection to the internet. In that case,
14
+ you might have to download the gem from rubygems.org and then install it manually:
15
+
16
+ ```
17
+ gem update ceedling --local=ceedling-filename.zip
18
+ ```
19
+
20
+ ## Step 2: Udpate Projects Using Ceedling
21
+
22
+ When you set up your project(s), it was either configured to use the gem directly, or it was
23
+ configured to install itself locally (often into a vendor directory).
24
+
25
+ For projects that are of the first type, congratulations, you're finished. The project will
26
+ automatically use the new ceedling. There MAY be things that need to be tweaked if features have
27
+ moved significantly. (And we apologize if that's your situation... as we get to version 1, we're
28
+ going to have a stronger focus on backwards compatibility). If your project isn't working perfectly,
29
+ skip down to Step 3.
30
+
31
+ If the project was installed to have a copy of ceedling locally, you have a choice. You may
32
+ choose to continue to run THIS project on the old version of Ceedling. Often this is the
33
+ preferred method for legacy projects which only get occasional focus. Why go through the effort
34
+ of updating for new tools if it's serving its purpose and you're unlikely to actually use the new
35
+ features?
36
+
37
+ The other choice, of course, is to update it. To do so, we open a command prompt and address ceedling
38
+ from *outside* the project. For example, let's say we have the following structure:
39
+
40
+ - projects
41
+ - myproject
42
+ - project.yml
43
+ - src
44
+ - tgt
45
+ - vendor
46
+
47
+ In this case, we'd want to be in the `projects` directory. At that point, we can ask Ceedling to
48
+ update our project.
49
+
50
+ ```
51
+ ceedling upgrade myproject
52
+ ```
53
+
54
+ Ceedling will automatically look for your project yaml file and do its best to determine what needs
55
+ to be updated. If installed locally, this will mean copying the latest copy of Unity, CMock, and
56
+ Ceedling. It will also involve copying documentation, if you had that installed.
57
+
58
+ ## Step 3: Solving Problems
59
+
60
+ We wish every project would update seamlessly... unfortunately there is a lot of customization that
61
+ goes into each project, and Ceedling often isn't aware of all of these. To make matter worse, Ceedling
62
+ has been in pre-release for awhile, meaning it occasionally has significant changes that may break
63
+ current installations. We've tried to capture the common ones here:
64
+
65
+ ### rakefile
66
+
67
+ Ceedling is built in a utility called Rake. In the past, rake was the method that the user actually
68
+ interacted with Ceedling. That's no longer the case. Using a modern version of Ceedling means that
69
+ you issue commands like `ceedling test:all` instead of `rake test:all`. If you have a continuous
70
+ integration server or other calling service, it may need to be updated to comply.
71
+
72
+ Similarly, older versions of Ceedling actually placed a rakefile in the project directory, allowing
73
+ the project to customize its own flow. For the most part this went unused and better ways were later
74
+ introduced. At this point, the `rakefile` is more trouble than its worth and often should just be
75
+ removed.
76
+
77
+ ### plugins
78
+
79
+ If you have custom plugins installed to your project, the plugin architecture has gone through some
80
+ revisions and it may or may not be compatible at this time. Again, this is a problem which should
81
+ not exist soon.
82
+
83
+
@@ -9,7 +9,7 @@ class BuildInvokerUtils
9
9
  ##
10
10
  # Processes exceptions and tries to display a useful message for the user.
11
11
  #
12
- # ==== Attriboops...utes
12
+ # ==== Attributes
13
13
  #
14
14
  # * _exception_: The exception given by a rescue statement.
15
15
  # * _context_: A symbol representing where in the build the exception
@@ -4,8 +4,8 @@ class CacheinatorHelper
4
4
  constructor :file_wrapper, :yaml_wrapper
5
5
 
6
6
  def diff_cached_config?(cached_filepath, hash)
7
- return true if ( not @file_wrapper.exist?(cached_filepath) )
8
- return true if ( (@file_wrapper.exist?(cached_filepath)) and (!(@yaml_wrapper.load(cached_filepath) == hash)) )
7
+ return false if ( not @file_wrapper.exist?(cached_filepath) )
8
+ return true if (@yaml_wrapper.load(cached_filepath) != hash)
9
9
  return false
10
10
  end
11
11
 
@@ -91,8 +91,8 @@ class Dependinator
91
91
  end
92
92
 
93
93
 
94
- def setup_test_executable_dependencies(test, objects)
95
- @rake_wrapper.create_file_task( @file_path_utils.form_test_executable_filepath(test), objects )
94
+ def enhance_test_executable_dependencies(test, objects)
95
+ @rake_wrapper[ @file_path_utils.form_test_executable_filepath(test) ].enhance( objects )
96
96
  end
97
97
 
98
98
  end
@@ -37,6 +37,10 @@ class GeneratorTestResults
37
37
  elements = extract_line_elements(line, results[:source][:file])
38
38
  results[:successes] << elements[0]
39
39
  results[:stdout] << elements[1] if (!elements[1].nil?)
40
+ when /(:PASS \(.* ms\)$)/
41
+ elements = extract_line_elements(line, results[:source][:file])
42
+ results[:successes] << elements[0]
43
+ results[:stdout] << elements[1] if (!elements[1].nil?)
40
44
  when /(:FAIL)/
41
45
  elements = extract_line_elements(line, results[:source][:file])
42
46
  results[:failures] << elements[0]
@@ -73,6 +77,7 @@ class GeneratorTestResults
73
77
  # handle anything preceding filename in line as extra output to be collected
74
78
  stdout = nil
75
79
  stdout_regex = /(.+)#{Regexp.escape(filename)}.+/i
80
+ unity_test_time = 0
76
81
 
77
82
  if (line =~ stdout_regex)
78
83
  stdout = $1.clone
@@ -82,8 +87,14 @@ class GeneratorTestResults
82
87
  # collect up test results minus and extra output
83
88
  elements = (line.strip.split(':'))[1..-1]
84
89
 
85
- return {:test => elements[1], :line => elements[0].to_i, :message => (elements[3..-1].join(':')).strip}, stdout if elements.size >= 3
86
- return {:test => '???', :line => -1, :message => nil} #fallback safe option. TODO better handling
90
+ # find timestamp if available
91
+ if (elements[2] =~ / \((.*) ms\)/)
92
+ unity_test_time = $1.to_f / 1000
93
+ elements[2].sub!(/ \((.*) ms\)/, '')
94
+ end
95
+
96
+ return {:test => elements[1], :line => elements[0].to_i, :message => (elements[3..-1].join(':')).strip, :unity_test_time => unity_test_time}, stdout if elements.size >= 3
97
+ return {:test => '???', :line => -1, :message => nil, :unity_test_time => unity_test_time} #fallback safe option. TODO better handling
87
98
  end
88
99
 
89
100
  end
@@ -4,28 +4,10 @@ require 'ceedling/version'
4
4
 
5
5
  desc "Display build environment version info."
6
6
  task :version do
7
- puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
8
-
9
- [
10
- ['CException', File.join( CEEDLING_VENDOR, CEXCEPTION_ROOT_PATH)],
11
- [' CMock', File.join( CEEDLING_VENDOR, CMOCK_ROOT_PATH)],
12
- [' Unity', File.join( CEEDLING_VENDOR, UNITY_ROOT_PATH)],
13
- ].each do |tool|
14
- name = tool[0]
15
- base_path = tool[1]
16
-
17
- version_string = begin
18
- @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'version.info') ).strip
19
- rescue
20
- "UNKNOWN"
21
- end
22
- build_string = begin
23
- @ceedling[:file_wrapper].read( File.join(base_path, 'release', 'build.info') ).strip
24
- rescue
25
- "UNKNOWN"
26
- end
27
- puts "#{name}:: #{version_string.empty? ? '#.#.' : (version_string + '.')}#{build_string.empty? ? '?' : build_string}"
28
- end
7
+ puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
8
+ puts " Unity:: #{Ceedling::Version::UNITY}"
9
+ puts " CMock:: #{Ceedling::Version::CMOCK}"
10
+ puts " CException:: #{Ceedling::Version::CEXCEPTION}"
29
11
  end
30
12
 
31
13
  desc "Set verbose output (silent:[#{Verbosity::SILENT}] - obnoxious:[#{Verbosity::OBNOXIOUS}])."
@@ -65,6 +47,12 @@ task :sanity_checks, :level do |t, args|
65
47
  @ceedling[:configurator].sanity_checks = check_level
66
48
  end
67
49
 
50
+ # non advertised catch for calling upgrade in the wrong place
51
+ task :upgrade do
52
+ puts "WARNING: You're currently IN your project directory. Take a step out and try"
53
+ puts "again if you'd like to perform an upgrade."
54
+ end
55
+
68
56
  # list expanded environment variables
69
57
  if (not ENVIRONMENT.empty?)
70
58
  desc "List all configured environment variables."
@@ -88,7 +76,7 @@ namespace :options do
88
76
  option = File.basename(option_path, '.yml')
89
77
 
90
78
  desc "Merge #{option} project options."
91
- task option.downcase.to_sym do
79
+ task option.to_sym do
92
80
  hash = @ceedling[:project_config_manager].merge_options( @ceedling[:setupinator].config_hash, option_path )
93
81
  @ceedling[:setupinator].do_setup( hash )
94
82
  if @ceedling[:configurator].project_release_build
@@ -97,6 +85,12 @@ namespace :options do
97
85
  end
98
86
  end
99
87
 
88
+ # This is to give nice errors when typing options
89
+ rule /^options:.*/ do |t, args|
90
+ filename = t.to_s.split(':')[-1] + '.yml'
91
+ filelist = COLLECTION_PROJECT_OPTIONS.map{|s| File.basename(s) }
92
+ @ceedling[:file_finder].find_file_from_list(filename, filelist, :error)
93
+ end
100
94
  end
101
95
 
102
96
 
@@ -45,16 +45,25 @@ task(:clobber => [:clean]) do
45
45
  @ceedling[:streaminator].stdout_puts("\nClobbering all generated files...\n(For large projects, this task may take a long time to complete)\n\n")
46
46
  begin
47
47
  CLOBBER.each { |fn| REMOVE_FILE_PROC.call(fn) }
48
+ @ceedling[:rake_wrapper][:directories].invoke
49
+ @ceedling[:dependinator].touch_force_rebuild_files
48
50
  rescue
49
51
  end
50
52
  end
51
53
 
52
-
54
+ # create a directory task for each of the paths, so we know how to build them
53
55
  PROJECT_BUILD_PATHS.each { |path| directory(path) }
54
56
 
55
- # create directories that hold build output and generated files & touching rebuild dependency sources
56
- task(:directories => PROJECT_BUILD_PATHS) { @ceedling[:dependinator].touch_force_rebuild_files }
57
+ # create a single directory task which verifies all the others get built
58
+ task :directories => PROJECT_BUILD_PATHS
57
59
 
60
+ # when the force file doesn't exist, it probably means we clobbered or are on a fresh
61
+ # install. In either case, stuff was deleted, so assume we want to rebuild it all
62
+ file @ceedling[:configurator].project_test_force_rebuild_filepath do
63
+ unless File.exists?(@ceedling[:configurator].project_test_force_rebuild_filepath)
64
+ @ceedling[:dependinator].touch_force_rebuild_files
65
+ end
66
+ end
58
67
 
59
68
  # list paths discovered at load time
60
69
  namespace :paths do
@@ -8,7 +8,7 @@ namespace TEST_SYM do
8
8
 
9
9
  desc "Run all unit tests (also just 'test' works)."
10
10
  task :all => [:directories] do
11
- @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS)
11
+ @ceedling[:test_invoker].setup_and_invoke(COLLECTION_ALL_TESTS, TEST_SYM, {:force_run => false})
12
12
  end
13
13
 
14
14
  desc "Run single test ([*] real test or source file name, no path)."