ceedling 0.22.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fa78f4edc69d44667b522fa8d6774b5cba64bd1d
4
- data.tar.gz: a00d68217deb360e479bd5689c87facd4dedfbe0
3
+ metadata.gz: 300e156b4f9cbd9bfbea4221b4773dbe3cf122f8
4
+ data.tar.gz: 823a00ec8ef37579f01e9d444d45d01b6a9cd0f0
5
5
  SHA512:
6
- metadata.gz: 3ae2e3a928a4d7bce315ec4670d2fbe2d214f94fb17738d3e02e294687b80f3157cabbc9c94cbbf4339ad29edd933b31a063bfebceabcdd820bc6be7dfe154d1
7
- data.tar.gz: baae9e8307806303c0f5fbf511102930a772e7c574e1e69662cc858f840aa5a57f3ecbfce47ea8c1b1e263507507be22b0900226814dd3ff39514c03f492a6e6
6
+ metadata.gz: 8ffe3c8e7a34b6f1cbfd3571a6fd47af2312b7d11a2be722a95587e6cacc4282683614d7e976e7114d442ab0f2efd4ef4fc0a7e6868a7d050c21bb73e7ef84f9
7
+ data.tar.gz: c9fe93d947af1d5dea5d4f0b3af34f922ed21467364371bd6c2d83c2ec407f9d211baf71a2fe47578cbe7656147c6ed81435b0d0fd1a3ac13e003b211a93a05a
data/Gemfile CHANGED
@@ -9,7 +9,8 @@ gem "constructor"
9
9
  gem "diy"
10
10
  gem "rr"
11
11
  gem "thor"
12
- gem "curses"
13
12
 
13
+ #these will be used if present, but ignored otherwise
14
+ #gem "curses"
14
15
  #gem "pty", :platforms => [ :ruby ] #automatically included on *nix platforms
15
- gem "popen4", :platforms => [ :mswin ]
16
+ #gem "popen4", :platforms => [ :mswin ]
@@ -30,7 +30,6 @@ DEPENDENCIES
30
30
  bundler (>= 1.3.5)
31
31
  constructor
32
32
  diy
33
- popen4
34
33
  rake (>= 0.9.2.2)
35
34
  require_all
36
35
  rr
data/README.md CHANGED
@@ -29,107 +29,38 @@ If bundler isn't installed on your system or you run into problems, you might ha
29
29
 
30
30
  > sudo gem install bundler
31
31
 
32
- Using Ceedling inside of a project
33
- ==================================
32
+ Pulling Ceedling inside a Project
33
+ =================================
34
34
 
35
35
  Ceedling can deploy all of its guts into a folder. This allows it
36
36
  to be used without having to worry about external dependencies.
37
+ You don't have to worry about Ceedling changing for this particular
38
+ project just because you updated your gems.
39
+
40
+ ceedling new YourNewProjectName
41
+
42
+ This will install all of Unity, CMock, and Ceedling into a new folder
43
+ named YourNewProjectName. It will also create a simple directory structure
44
+ for you with src and test folders. SCORE! It's also creates a simple
45
+ rakefile and project.yml file that you can tweak to your own needs.
46
+
47
+ It'll also include documentation for all of these tools, unless you
48
+ specify --nodocs at when you issue the command above... then it skips
49
+ that step for you.
50
+
51
+ Using Ceedling From A Ruby Gem
52
+ ==============================
53
+
54
+ Ceedling can also be used as a gem. By installing it this way, you
55
+ can automatically update to the latest version of Ceedling, Unity,
56
+ and CMock just by running an update on your gems. Use this if you
57
+ are only running one project OR if you feel you want to keep all
58
+ your projects up to date.
59
+
60
+ ceedling new YourNewProjectName --as_gem
61
+
62
+ This creates a new folder named YourNewProjectName. Inside it will be your
63
+ shiny new project file, rakefile, and a couple of src and test directories
64
+ to get you started. You can then tweak all of those things to your heart's
65
+ content.
37
66
 
38
- ceedling new [your new project name]
39
-
40
- Using Ceedling outside of a project as a gem
41
- ============================================
42
-
43
- Ceedling can also be used as a gem. The following Rakefile is the
44
- bare minimum required in order to use Ceedling this way:
45
-
46
- require 'ceedling'
47
- Ceedling.load_project
48
-
49
- If you want to load a Ceedling project YAML file other than the default `project.yml` (i.e. `./my_config.yml`), you can do:
50
-
51
- Ceedling.load_project(config: './my_config.yml')
52
-
53
- Additionally, a project.yml is required. Here is one to get you
54
- started:
55
-
56
- ---
57
- :project:
58
- :use_exceptions: FALSE
59
- :use_test_preprocessor: TRUE
60
- :use_deep_dependencies: TRUE
61
- :build_root: build
62
- # :release_build: TRUE
63
- :test_file_prefix: test_
64
-
65
- #:release_build:
66
- # :output: MyApp.out
67
- # :use_assembly: FALSE
68
-
69
- :environment:
70
-
71
- :extension:
72
- :executable: .out
73
-
74
- :paths:
75
- :test:
76
- - +:test/**
77
- - -:test/support
78
- :source:
79
- - src/**
80
- :support:
81
- - test/support
82
-
83
- :defines:
84
- # in order to add common defines:
85
- # 1) remove the trailing [] from the :common: section
86
- # 2) add entries to the :common: section (e.g. :test: has TEST defined)
87
- :commmon: &common_defines []
88
- :test:
89
- - *common_defines
90
- - TEST
91
- :test_preprocess:
92
- - *common_defines
93
- - TEST
94
-
95
- :cmock:
96
- :when_no_prototypes: :warn
97
- :enforce_strict_ordering: TRUE
98
- :plugins:
99
- - :ignore
100
- :treat_as:
101
- uint8: HEX8
102
- uint16: HEX16
103
- uint32: UINT32
104
- int8: INT8
105
- bool: UINT8
106
-
107
- #:tools:
108
- # Ceedling defaults to using gcc for compiling, linking, etc.
109
- # As [:tools] is blank, gcc will be used (so long as it's in your system path)
110
- # See documentation to configure a given toolchain for use
111
-
112
- :plugins:
113
- :load_paths:
114
- # This is required to use builtin ceedling plugins
115
- - "#{Ceedling.load_path}"
116
- # Uncomment this and create the directory in order to use your own
117
- # custom ceedling plugins
118
- # - ceedling_plugins
119
- :enabled:
120
- # These plugins ship with Ceedling.
121
- - stdout_pretty_tests_report
122
- # - stdout_ide_tests_report # IDE parseable output
123
- # - teamcity_tests_report # TeamCity CI output (only enabled in TeamCity builds)
124
- - module_generator # Adds tasks for creating code module files
125
- ...
126
-
127
- Finally, you'll need to create something like the following directory structure. This one matches the project.yml
128
- defined above:
129
-
130
- ./test
131
- ./test/support
132
- ./src
133
- ./project.yml
134
- ./Rakefile
135
- ./build
@@ -132,6 +132,15 @@ unless (File.exists?("project.yml"))
132
132
  puts " - Execute 'rake -T' to view available test & build tasks"
133
133
  puts ''
134
134
  end
135
+
136
+ desc "version", "return the version of the tools installed"
137
+ def version()
138
+ require 'ceedling/version.rb'
139
+ puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
140
+ puts " CMock:: #{Ceedling::Version::CMOCK}"
141
+ puts " Unity:: #{Ceedling::Version::UNITY}"
142
+ puts " CException:: #{Ceedling::Version::CEXCEPTION}"
143
+ end
135
144
  end
136
145
 
137
146
  if (ARGV[0] =~ /^\-T$/)
@@ -184,18 +193,23 @@ else
184
193
 
185
194
  #if neither of these libraries were available, we can just shell out to the command and collect results
186
195
  def spawn_command(cmd, &block)
187
- block.call( `#{cmd}` )
196
+ block.call( StringIO.new(`#{cmd}`) )
188
197
  end
189
198
  end
190
199
 
191
200
  end
192
201
 
193
- require 'curses'
194
202
  require 'yaml'
195
203
  require 'rbconfig'
196
204
 
197
- Curses.init_screen()
198
- cols = Curses.cols
205
+ #determine the width of the screen
206
+ cols = 80
207
+ begin
208
+ require 'curses'
209
+ Curses.init_screen()
210
+ cols = Curses.cols
211
+ rescue LoadError
212
+ end
199
213
 
200
214
  #determine platform
201
215
  platform = begin
@@ -230,23 +244,29 @@ else
230
244
 
231
245
  #merge in project settings if they can be found here
232
246
  yaml_options = YAML.load_file('project.yml')
233
- options[:pretend_we_are_gtest] = (yaml_options[:plugins][:enabled].include? :stdout_gtestlike_tests_report)
234
- options[:add_path] = yaml_options[:paths][:tools] || []
247
+ options[:pretend_we_are_gtest] = (yaml_options[:plugins][:enabled].include? :stdout_gtestlike_tests_report) if (yaml_options[:plugins] && yaml_options[:plugins][:enabled])
248
+ if (yaml_options[:paths])
249
+ options[:add_path] = yaml_options[:paths][:tools] || []
250
+ else
251
+ options[:add_path] = []
252
+ end
235
253
 
236
254
  #sort through command line options
237
255
  options[:args]
238
256
  ARGV.each do |v|
239
257
  case(v)
240
- when /^(?:new|examples?)$/
258
+ when /^(?:new|examples?|templates?)$/
241
259
  puts "\nOops. You called ceedling with argument '#{v}'.\n" +
242
260
  " This is an operation that will create a new project... \n" +
243
261
  " but it looks like you're already in a project. If you really \n" +
244
262
  " want to do this, try moving to an empty folder.\n\n"
245
263
  abort
246
- when /--gtest/
264
+ when /^--gtest/
247
265
  options[:pretend_we_are_gtest] = true
248
- when /--debug/
266
+ when /^--debug/
249
267
  options[:outfile] = "debug.txt"
268
+ when /^help$/
269
+ options[:args] += "-T "
250
270
  else
251
271
  options[:args] += v + " "
252
272
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency "thor", ">= 0.14.5"
18
18
  s.add_dependency "rake", ">= 0.8.7"
19
- s.add_dependency "curses", ">= 1.0.0"
19
+ # s.add_dependency "curses", ">= 1.0.0"
20
20
 
21
21
  # Files needed from submodules
22
22
  s.files = []
@@ -124,7 +124,7 @@ source file (plus two C header files) and from the nature of its
124
124
  implementation - Unity will build in any C toolchain and is configurable
125
125
  for even the very minimalist of processors.
126
126
 
127
- [Unity]: http://unity.sourceforge.net/
127
+ [Unity]: http://github.com/ThrowTheSwitch/Unity
128
128
  [test]: http://en.wikipedia.org/wiki/Unit_testing
129
129
 
130
130
  [CMock] is a tool written in Ruby able to generate entire
@@ -132,7 +132,7 @@ for even the very minimalist of processors.
132
132
  functions are invaluable in [interaction-based unit testing][ut].
133
133
  CMock's generated C code uses Unity.
134
134
 
135
- [CMock]: http://cmock.sourceforge.net/
135
+ [CMock]: http://github.com/ThrowTheSwitch/CMock
136
136
  [mock]: http://en.wikipedia.org/wiki/Mock_object
137
137
  [ut]: http://martinfowler.com/articles/mocksArentStubs.html
138
138
 
@@ -142,7 +142,7 @@ CMock's generated C code uses Unity.
142
142
  cleaner and preferable alternative to managing and passing error codes
143
143
  up your return call trace.
144
144
 
145
- [CException]: http://cexception.sourceforge.net/
145
+ [CException]: http://github.com/ThrowTheSwitch/CException
146
146
  [exn]: http://en.wikipedia.org/wiki/Exception_handling
147
147
  [setjmp]: http://en.wikipedia.org/wiki/Setjmp.h
148
148
 
@@ -164,74 +164,22 @@ As a [Ruby gem](http://docs.rubygems.org/read/chapter/1):
164
164
 
165
165
  1. [Download and install Ruby](http://www.ruby-lang.org/en/downloads/)
166
166
 
167
- 2. Use Ruby's command line gem package manager to install Rake:
168
- `gem install rake`
169
-
170
- 3. Use Ruby's command line gem package manager to install Ceedling:
167
+ 2. Use Ruby's command line gem package manager to install Ceedling:
171
168
  `gem install ceedling` {text:line-break} (Unity, CMock,
172
169
  and CException come along with Ceedling for free)
173
170
 
174
- 4. Execute Ceedling at command line to create example project
171
+ 3. Execute Ceedling at command line to create example project
175
172
  or an empty Ceedling project in your filesystem (executing
176
173
  `ceedling help` first is, well, helpful).
177
174
 
178
175
  Gem install notes:
179
176
 
180
- 1. Steps 1-3 are a one time affair for your local environment.
181
- When steps 1-3 are completed once, only step 4 is needed for
177
+ 1. Steps 1-2 are a one time affair for your local environment.
178
+ When steps 1-2 are completed once, only step 3 is needed for
182
179
  each new project.
183
180
 
184
181
 
185
182
 
186
- Alternatively, from scratch:
187
-
188
- 1. [Download and install Ruby](http://www.ruby-lang.org/en/downloads/)
189
-
190
- 2. Use Ruby's command line gem package manager to install Rake:
191
- `gem install rake`
192
-
193
- 3. Grab the Ceedling package (from sourceforge as download
194
- or from svn) and place in your filesystem {text:line-break}
195
- (it already contains Unity, CMock, and CException)
196
-
197
- 4. Create an empty build directory for your project {text:line-break}
198
- (Ceedling will fill out the directory structure below the
199
- build root when executed)
200
-
201
- 5. Create a simple Rakefile (`rakefile.rb`) that contains
202
- a load call to Ceedling on your filesystem and a default task
203
- (tasks available to tie to `default` are listed in the next
204
- section):
205
-
206
- ```ruby
207
- load '<path>/ceedling/lib/rakefile.rb'
208
- # ex. run all tests & build release artifact
209
- task :default => ['test:all', :release]
210
- # namespaced tasks must be quoted
211
- # top-level tasks are Ruby symbols denoted by a leading ':'`
212
- ```
213
-
214
- 6. Create your project YAML file (more on this later in this document).
215
- `project.yml` is the default file name Ceedling recognizes
216
- in the working directory from which Rake is run (Rake is the
217
- tool we actually use to take advantage of what Ceedling provides).
218
-
219
-
220
- From scratch install notes:
221
-
222
- 1. Steps 1-3 are a one time affair for your local environment.
223
- When steps 1-3 are completed once, only steps 4-6 are needed
224
- for each new project.
225
-
226
- 2. See the sample starter project for a working setup. When steps
227
- 1-3 are complete and assuming you have gcc in your path (Ceedling's
228
- default toolchain), you will only need to edit the path within
229
- the sample Rakefile (see step 5 above) to yield a working,
230
- albeit simple, project. The default task need not be defined,
231
- but it's not a bad idea to do so.
232
-
233
-
234
-
235
183
  General notes:
236
184
 
237
185
  1. Certain advanced features of Ceedling rely on gcc and cpp
@@ -9,14 +9,14 @@ class Configurator
9
9
 
10
10
  attr_reader :project_config_hash, :script_plugins, :rake_plugins
11
11
  attr_accessor :project_logging, :project_debug, :project_verbosity, :sanity_checks
12
-
12
+
13
13
  constructor(:configurator_setup, :configurator_builder, :configurator_plugins, :cmock_builder, :yaml_wrapper, :system_wrapper) do
14
14
  @project_logging = false
15
15
  @project_debug = false
16
16
  @project_verbosity = Verbosity::NORMAL
17
17
  @sanity_checks = TestResultsSanityChecks::NORMAL
18
18
  end
19
-
19
+
20
20
  def setup
21
21
  # special copy of cmock config to provide to cmock for construction
22
22
  @cmock_config_hash = {}
@@ -25,23 +25,23 @@ class Configurator
25
25
  # in eval() statements in build() have something of proper scope and persistence to reference
26
26
  @project_config_hash = {}
27
27
  @project_config_hash_backup = {}
28
-
28
+
29
29
  @script_plugins = []
30
30
  @rake_plugins = []
31
31
  end
32
-
33
-
32
+
33
+
34
34
  def replace_flattened_config(config)
35
35
  @project_config_hash.merge!(config)
36
36
  @configurator_setup.build_constants_and_accessors(@project_config_hash, binding())
37
37
  end
38
38
 
39
-
39
+
40
40
  def store_config
41
41
  @project_config_hash_backup = @project_config_hash.clone
42
42
  end
43
-
44
-
43
+
44
+
45
45
  def restore_config
46
46
  @project_config_hash = @project_config_hash_backup
47
47
  @configurator_setup.build_constants_and_accessors(@project_config_hash, binding())
@@ -72,13 +72,13 @@ class Configurator
72
72
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST )
73
73
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_PREPROCESSORS ) if (config[:project][:use_test_preprocessor])
74
74
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_TEST_DEPENDENCIES ) if (config[:project][:use_deep_dependencies])
75
-
75
+
76
76
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE ) if (config[:project][:release_build])
77
77
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_ASSEMBLER ) if (config[:project][:release_build] and config[:release_build][:use_assembly])
78
78
  @configurator_builder.populate_defaults( config, DEFAULT_TOOLS_RELEASE_DEPENDENCIES ) if (config[:project][:release_build] and config[:project][:use_deep_dependencies])
79
79
  end
80
-
81
-
80
+
81
+
82
82
  def populate_unity_defaults(config)
83
83
  unity = config[:unity] || {}
84
84
  @runner_config = unity.merge(@runner_config || config[:test_runner] || {})
@@ -92,10 +92,10 @@ class Configurator
92
92
 
93
93
  # yes, we're duplicating the default mock_prefix in cmock, but it's because we need CMOCK_MOCK_PREFIX always available in Ceedling's environment
94
94
  cmock[:mock_prefix] = 'Mock' if (cmock[:mock_prefix].nil?)
95
-
95
+
96
96
  # just because strict ordering is the way to go
97
97
  cmock[:enforce_strict_ordering] = true if (cmock[:enforce_strict_ordering].nil?)
98
-
98
+
99
99
  cmock[:mock_path] = File.join(config[:project][:build_root], TESTS_BASE_PATH, 'mocks') if (cmock[:mock_path].nil?)
100
100
  cmock[:verbosity] = @project_verbosity if (cmock[:verbosity].nil?)
101
101
 
@@ -105,7 +105,7 @@ class Configurator
105
105
  cmock[:plugins].uniq!
106
106
 
107
107
  cmock[:unity_helper] = false if (cmock[:unity_helper].nil?)
108
-
108
+
109
109
  if (cmock[:unity_helper])
110
110
  cmock[:includes] << File.basename(cmock[:unity_helper])
111
111
  cmock[:includes].uniq!
@@ -115,8 +115,8 @@ class Configurator
115
115
 
116
116
  @cmock_builder.manufacture(cmock)
117
117
  end
118
-
119
-
118
+
119
+
120
120
  def get_runner_config
121
121
  @runner_config
122
122
  end
@@ -128,7 +128,7 @@ class Configurator
128
128
  config[:tools].each_key do |name|
129
129
  tool = config[:tools][name]
130
130
 
131
- # populate name if not given
131
+ # populate name if not given
132
132
  tool[:name] = name.to_s if (tool[:name].nil?)
133
133
 
134
134
  # handle inline ruby string substitution in executable
@@ -146,8 +146,8 @@ class Configurator
146
146
  tool[:optional] = false if (tool[:optional].nil?)
147
147
  end
148
148
  end
149
-
150
-
149
+
150
+
151
151
  def tools_supplement_arguments(config)
152
152
  tools_name_prefix = 'tools_'
153
153
  config[:tools].each_key do |name|
@@ -171,49 +171,49 @@ class Configurator
171
171
  path.replace(@system_wrapper.module_eval(path)) if (path =~ RUBY_STRING_REPLACEMENT_PATTERN)
172
172
  FilePathUtils::standardize(path)
173
173
  end
174
-
174
+
175
175
  paths_hash = @configurator_plugins.add_load_paths(config)
176
-
176
+
177
177
  @rake_plugins = @configurator_plugins.find_rake_plugins(config)
178
178
  @script_plugins = @configurator_plugins.find_script_plugins(config)
179
179
  config_plugins = @configurator_plugins.find_config_plugins(config)
180
180
  plugin_defaults = @configurator_plugins.find_plugin_defaults(config)
181
-
181
+
182
182
  config_plugins.each do |plugin|
183
183
  config.deep_merge( @yaml_wrapper.load(plugin) )
184
184
  end
185
-
185
+
186
186
  plugin_defaults.each do |defaults|
187
187
  @configurator_builder.populate_defaults( config, @yaml_wrapper.load(defaults) )
188
188
  end
189
-
189
+
190
190
  # special plugin setting for results printing
191
191
  config[:plugins][:display_raw_test_results] = true if (config[:plugins][:display_raw_test_results].nil?)
192
-
192
+
193
193
  paths_hash.each_pair { |name, path| config[:plugins][name] = path }
194
194
  end
195
195
 
196
-
196
+
197
197
  def eval_environment_variables(config)
198
198
  config[:environment].each do |hash|
199
199
  key = hash.keys[0]
200
200
  value = hash[key]
201
201
  items = []
202
-
202
+
203
203
  interstitial = ((key == :path) ? File::PATH_SEPARATOR : '')
204
204
  items = ((value.class == Array) ? hash[key] : [value])
205
-
205
+
206
206
  items.each { |item| item.replace( @system_wrapper.module_eval( item ) ) if (item =~ RUBY_STRING_REPLACEMENT_PATTERN) }
207
207
  hash[key] = items.join( interstitial )
208
-
208
+
209
209
  @system_wrapper.env_set( key.to_s.upcase, hash[key] )
210
210
  end
211
211
  end
212
212
 
213
-
213
+
214
214
  def eval_paths(config)
215
215
  # [:plugins]:[load_paths] already handled
216
-
216
+
217
217
  paths = [ # individual paths that don't follow convention processed below
218
218
  config[:project][:build_root],
219
219
  config[:release_build][:artifacts]]
@@ -223,16 +223,16 @@ class Configurator
223
223
  config[:paths].each_pair { |collection, paths| eval_path_list( paths ) }
224
224
 
225
225
  config[:files].each_pair { |collection, files| eval_path_list( files ) }
226
-
226
+
227
227
  # all other paths at secondary hash key level processed by convention:
228
228
  # ex. [:toplevel][:foo_path] & [:toplevel][:bar_paths] are evaluated
229
- config.each_pair { |parent, child| eval_path_list( collect_path_list( child ) ) }
229
+ config.each_pair { |parent, child| eval_path_list( collect_path_list( child ) ) }
230
230
  end
231
-
232
-
231
+
232
+
233
233
  def standardize_paths(config)
234
234
  # [:plugins]:[load_paths] already handled
235
-
235
+
236
236
  paths = [ # individual paths that don't follow convention processed below
237
237
  config[:project][:build_root],
238
238
  config[:release_build][:artifacts]] # cmock path in case it was explicitly set in config
@@ -247,45 +247,45 @@ class Configurator
247
247
 
248
248
  config[:files].each_pair { |collection, files| files.each{ |path| FilePathUtils::standardize( path ) } }
249
249
 
250
- config[:tools].each_pair { |tool, config| FilePathUtils::standardize( config[:executable] ) }
251
-
250
+ config[:tools].each_pair { |tool, config| FilePathUtils::standardize( config[:executable] ) if (config.include? :executable) }
251
+
252
252
  # all other paths at secondary hash key level processed by convention:
253
253
  # ex. [:toplevel][:foo_path] & [:toplevel][:bar_paths] are standardized
254
254
  config.each_pair do |parent, child|
255
255
  collect_path_list( child ).each { |path| FilePathUtils::standardize( path ) }
256
- end
256
+ end
257
257
  end
258
258
 
259
259
 
260
260
  def validate(config)
261
261
  # collect felonies and go straight to jail
262
262
  raise if (not @configurator_setup.validate_required_sections( config ))
263
-
263
+
264
264
  # collect all misdemeanors, everybody on probation
265
265
  blotter = []
266
266
  blotter << @configurator_setup.validate_required_section_values( config )
267
267
  blotter << @configurator_setup.validate_paths( config )
268
268
  blotter << @configurator_setup.validate_tools( config )
269
269
  blotter << @configurator_setup.validate_plugins( config )
270
-
270
+
271
271
  raise if (blotter.include?( false ))
272
272
  end
273
-
274
-
273
+
274
+
275
275
  # create constants and accessors (attached to this object) from given hash
276
276
  def build(config, *keys)
277
277
  # create flattened & expanded configuration hash
278
278
  built_config = @configurator_setup.build_project_config( config, @configurator_builder.flattenify( config ) )
279
-
279
+
280
280
  @project_config_hash = built_config.clone
281
281
  store_config()
282
282
 
283
283
  @configurator_setup.build_constants_and_accessors(built_config, binding())
284
-
284
+
285
285
  # top-level keys disappear when we flatten, so create global constants & accessors to any specified keys
286
286
  keys.each do |key|
287
287
  hash = { key => config[key] }
288
- @configurator_setup.build_constants_and_accessors(hash, binding())
288
+ @configurator_setup.build_constants_and_accessors(hash, binding())
289
289
  end
290
290
  end
291
291
 
@@ -297,30 +297,30 @@ class Configurator
297
297
 
298
298
  # flatten our addition hash
299
299
  config_more_flattened = @configurator_builder.flattenify( config_more )
300
-
300
+
301
301
  # merge our flattened hash with built hash from previous build
302
302
  @project_config_hash.deep_merge!( config_more_flattened )
303
303
  store_config()
304
304
 
305
305
  # create more constants and accessors
306
306
  @configurator_setup.build_constants_and_accessors(config_more_flattened, binding())
307
-
307
+
308
308
  # recreate constants & update accessors with new merged, base values
309
309
  config_more.keys.each do |key|
310
310
  hash = { key => config_base[key] }
311
311
  @configurator_setup.build_constants_and_accessors(hash, binding())
312
312
  end
313
313
  end
314
-
315
-
314
+
315
+
316
316
  def insert_rake_plugins(plugins)
317
317
  plugins.each do |plugin|
318
318
  @project_config_hash[:project_rakefile_component_files] << plugin
319
319
  end
320
320
  end
321
-
321
+
322
322
  ### private ###
323
-
323
+
324
324
  private
325
325
 
326
326
  def collect_path_list( container )
@@ -328,12 +328,12 @@ class Configurator
328
328
  container.each_key { |key| paths << container[key] if (key.to_s =~ /_path(s)?$/) } if (container.class == Hash)
329
329
  return paths.flatten
330
330
  end
331
-
331
+
332
332
  def eval_path_list( paths )
333
333
  paths.flatten.each do |path|
334
334
  path.replace( @system_wrapper.module_eval( path ) ) if (path =~ RUBY_STRING_REPLACEMENT_PATTERN)
335
335
  end
336
336
  end
337
-
338
-
337
+
338
+
339
339
  end
@@ -2,7 +2,7 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.22.0"
5
+ GEM = "0.24.0"
6
6
  # @private
7
7
  CEEDLING = GEM
8
8
  # @private
@@ -2,7 +2,7 @@
2
2
  module Ceedling
3
3
  module Version
4
4
  # @private
5
- GEM = "0.20.4"
5
+ GEM = "0.24.0"
6
6
  # @private
7
7
  CEEDLING = "<%= versions["CEEDLING"] %>"
8
8
  # @private
@@ -23,6 +23,7 @@ class UnityTestRunnerGenerator
23
23
  def self.default_options
24
24
  {
25
25
  :includes => [],
26
+ :defines => [],
26
27
  :plugins => [],
27
28
  :framework => :unity,
28
29
  :test_prefix => "test|spec|should",
@@ -167,6 +168,9 @@ class UnityTestRunnerGenerator
167
168
  output.puts('#include <setjmp.h>')
168
169
  output.puts('#include <stdio.h>')
169
170
  output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
171
+ if (@options[:defines] && !@options[:defines].empty?)
172
+ @options[:defines].each {|d| output.puts("#define #{d}")}
173
+ end
170
174
  if (@options[:header_file] && !@options[:header_file].empty?)
171
175
  output.puts("#include \"#{File.basename(@options[:header_file])}\"")
172
176
  else
@@ -733,13 +733,13 @@ void UnityAssertFloatSpecial(const _UF actual,
733
733
 
734
734
  case UNITY_FLOAT_IS_NAN:
735
735
  case UNITY_FLOAT_IS_NOT_NAN:
736
- is_trait = isnan(actual);
736
+ is_trait = isnan(actual) ? 1 : 0;
737
737
  break;
738
738
 
739
739
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
740
740
  case UNITY_FLOAT_IS_DET:
741
741
  case UNITY_FLOAT_IS_NOT_DET:
742
- if (isinf(actual) | isnan(actual))
742
+ if (isinf(actual) || isnan(actual))
743
743
  is_trait = 0;
744
744
  else
745
745
  is_trait = 1;
@@ -876,13 +876,13 @@ void UnityAssertDoubleSpecial(const _UD actual,
876
876
 
877
877
  case UNITY_FLOAT_IS_NAN:
878
878
  case UNITY_FLOAT_IS_NOT_NAN:
879
- is_trait = isnan(actual);
879
+ is_trait = isnan(actual) ? 1 : 0;
880
880
  break;
881
881
 
882
882
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
883
883
  case UNITY_FLOAT_IS_DET:
884
884
  case UNITY_FLOAT_IS_NOT_DET:
885
- if (isinf(actual) | isnan(actual))
885
+ if (isinf(actual) || isnan(actual))
886
886
  is_trait = 0;
887
887
  else
888
888
  is_trait = 1;
@@ -23,6 +23,7 @@ class UnityTestRunnerGenerator
23
23
  def self.default_options
24
24
  {
25
25
  :includes => [],
26
+ :defines => [],
26
27
  :plugins => [],
27
28
  :framework => :unity,
28
29
  :test_prefix => "test|spec|should",
@@ -167,6 +168,9 @@ class UnityTestRunnerGenerator
167
168
  output.puts('#include <setjmp.h>')
168
169
  output.puts('#include <stdio.h>')
169
170
  output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
171
+ if (@options[:defines] && !@options[:defines].empty?)
172
+ @options[:defines].each {|d| output.puts("#define #{d}")}
173
+ end
170
174
  if (@options[:header_file] && !@options[:header_file].empty?)
171
175
  output.puts("#include \"#{File.basename(@options[:header_file])}\"")
172
176
  else
@@ -733,13 +733,13 @@ void UnityAssertFloatSpecial(const _UF actual,
733
733
 
734
734
  case UNITY_FLOAT_IS_NAN:
735
735
  case UNITY_FLOAT_IS_NOT_NAN:
736
- is_trait = isnan(actual);
736
+ is_trait = isnan(actual) ? 1 : 0;
737
737
  break;
738
738
 
739
739
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
740
740
  case UNITY_FLOAT_IS_DET:
741
741
  case UNITY_FLOAT_IS_NOT_DET:
742
- if (isinf(actual) | isnan(actual))
742
+ if (isinf(actual) || isnan(actual))
743
743
  is_trait = 0;
744
744
  else
745
745
  is_trait = 1;
@@ -876,13 +876,13 @@ void UnityAssertDoubleSpecial(const _UD actual,
876
876
 
877
877
  case UNITY_FLOAT_IS_NAN:
878
878
  case UNITY_FLOAT_IS_NOT_NAN:
879
- is_trait = isnan(actual);
879
+ is_trait = isnan(actual) ? 1 : 0;
880
880
  break;
881
881
 
882
882
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
883
883
  case UNITY_FLOAT_IS_DET:
884
884
  case UNITY_FLOAT_IS_NOT_DET:
885
- if (isinf(actual) | isnan(actual))
885
+ if (isinf(actual) || isnan(actual))
886
886
  is_trait = 0;
887
887
  else
888
888
  is_trait = 1;
@@ -23,6 +23,7 @@ class UnityTestRunnerGenerator
23
23
  def self.default_options
24
24
  {
25
25
  :includes => [],
26
+ :defines => [],
26
27
  :plugins => [],
27
28
  :framework => :unity,
28
29
  :test_prefix => "test|spec|should",
@@ -167,6 +168,9 @@ class UnityTestRunnerGenerator
167
168
  output.puts('#include <setjmp.h>')
168
169
  output.puts('#include <stdio.h>')
169
170
  output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
171
+ if (@options[:defines] && !@options[:defines].empty?)
172
+ @options[:defines].each {|d| output.puts("#define #{d}")}
173
+ end
170
174
  if (@options[:header_file] && !@options[:header_file].empty?)
171
175
  output.puts("#include \"#{File.basename(@options[:header_file])}\"")
172
176
  else
@@ -733,13 +733,13 @@ void UnityAssertFloatSpecial(const _UF actual,
733
733
 
734
734
  case UNITY_FLOAT_IS_NAN:
735
735
  case UNITY_FLOAT_IS_NOT_NAN:
736
- is_trait = isnan(actual);
736
+ is_trait = isnan(actual) ? 1 : 0;
737
737
  break;
738
738
 
739
739
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
740
740
  case UNITY_FLOAT_IS_DET:
741
741
  case UNITY_FLOAT_IS_NOT_DET:
742
- if (isinf(actual) | isnan(actual))
742
+ if (isinf(actual) || isnan(actual))
743
743
  is_trait = 0;
744
744
  else
745
745
  is_trait = 1;
@@ -876,13 +876,13 @@ void UnityAssertDoubleSpecial(const _UD actual,
876
876
 
877
877
  case UNITY_FLOAT_IS_NAN:
878
878
  case UNITY_FLOAT_IS_NOT_NAN:
879
- is_trait = isnan(actual);
879
+ is_trait = isnan(actual) ? 1 : 0;
880
880
  break;
881
881
 
882
882
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
883
883
  case UNITY_FLOAT_IS_DET:
884
884
  case UNITY_FLOAT_IS_NOT_DET:
885
- if (isinf(actual) | isnan(actual))
885
+ if (isinf(actual) || isnan(actual))
886
886
  is_trait = 0;
887
887
  else
888
888
  is_trait = 1;
@@ -23,6 +23,7 @@ class UnityTestRunnerGenerator
23
23
  def self.default_options
24
24
  {
25
25
  :includes => [],
26
+ :defines => [],
26
27
  :plugins => [],
27
28
  :framework => :unity,
28
29
  :test_prefix => "test|spec|should",
@@ -167,6 +168,9 @@ class UnityTestRunnerGenerator
167
168
  output.puts('#include <setjmp.h>')
168
169
  output.puts('#include <stdio.h>')
169
170
  output.puts('#include "CException.h"') if @options[:plugins].include?(:cexception)
171
+ if (@options[:defines] && !@options[:defines].empty?)
172
+ @options[:defines].each {|d| output.puts("#define #{d}")}
173
+ end
170
174
  if (@options[:header_file] && !@options[:header_file].empty?)
171
175
  output.puts("#include \"#{File.basename(@options[:header_file])}\"")
172
176
  else
@@ -733,13 +733,13 @@ void UnityAssertFloatSpecial(const _UF actual,
733
733
 
734
734
  case UNITY_FLOAT_IS_NAN:
735
735
  case UNITY_FLOAT_IS_NOT_NAN:
736
- is_trait = isnan(actual);
736
+ is_trait = isnan(actual) ? 1 : 0;
737
737
  break;
738
738
 
739
739
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
740
740
  case UNITY_FLOAT_IS_DET:
741
741
  case UNITY_FLOAT_IS_NOT_DET:
742
- if (isinf(actual) | isnan(actual))
742
+ if (isinf(actual) || isnan(actual))
743
743
  is_trait = 0;
744
744
  else
745
745
  is_trait = 1;
@@ -876,13 +876,13 @@ void UnityAssertDoubleSpecial(const _UD actual,
876
876
 
877
877
  case UNITY_FLOAT_IS_NAN:
878
878
  case UNITY_FLOAT_IS_NOT_NAN:
879
- is_trait = isnan(actual);
879
+ is_trait = isnan(actual) ? 1 : 0;
880
880
  break;
881
881
 
882
882
  /* A determinate number is non infinite and not NaN. (therefore the opposite of the two above) */
883
883
  case UNITY_FLOAT_IS_DET:
884
884
  case UNITY_FLOAT_IS_NOT_DET:
885
- if (isinf(actual) | isnan(actual))
885
+ if (isinf(actual) || isnan(actual))
886
886
  is_trait = 0;
887
887
  else
888
888
  is_trait = 1;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ceedling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Karlesky, Mark VanderVoord
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-10-28 00:00:00.000000000 Z
13
+ date: 2016-11-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -40,20 +40,6 @@ dependencies:
40
40
  - - '>='
41
41
  - !ruby/object:Gem::Version
42
42
  version: 0.8.7
43
- - !ruby/object:Gem::Dependency
44
- name: curses
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - '>='
48
- - !ruby/object:Gem::Version
49
- version: 1.0.0
50
- type: :runtime
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - '>='
55
- - !ruby/object:Gem::Version
56
- version: 1.0.0
57
43
  description: Ceedling provides a set of tools to deploy its guts in a folder or which
58
44
  can be required in a Rakefile
59
45
  email:
@@ -75,7 +61,6 @@ files:
75
61
  - assets/rakefile_with_guts.rb
76
62
  - assets/test_example_file.c
77
63
  - bin/ceedling
78
- - ceedling-0.21.0.gem
79
64
  - ceedling.gemspec
80
65
  - config/test_environment.rb
81
66
  - docs/CeedlingPacket.md
Binary file