Skip to content

Commit a652212

Browse files
committed
update ceedling to 0.31.1
1 parent d9817eb commit a652212

File tree

98 files changed

+2697
-6603
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2697
-6603
lines changed

test/project.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# :release_build: TRUE
1616
:test_file_prefix: test_
1717
:which_ceedling: vendor/ceedling
18+
:ceedling_version: 0.31.1
1819
:default_tasks:
1920
- test:all
2021

test/test/support/tusb_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
5353
#ifndef CFG_TUSB_DEBUG
54-
#define CFG_TUSB_DEBUG 0
54+
#define CFG_TUSB_DEBUG 1
5555
#endif
5656

5757
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.

test/vendor/ceedling/bin/ceedling

Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ unless (project_found)
4949
end
5050

5151
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
6052
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})
6262
end
6363

6464
no_commands do
@@ -90,26 +90,30 @@ unless (project_found)
9090
FileUtils.touch(File.join(test_support_path, '.gitkeep'))
9191

9292
# If documentation requested, create a place to dump them and do so
93+
doc_path = ""
9394
if use_docs
94-
doc_path = File.join(ceedling_path, 'docs')
95+
doc_path = use_gem ? File.join(name, 'docs') : File.join(ceedling_path, 'docs')
9596
FileUtils.mkdir_p doc_path
9697

9798
in_doc_path = lambda {|f| File.join(doc_path, f)}
9899

99-
doc_files = [
100-
'docs/CeedlingPacket.md',
101-
'vendor/c_exception/docs/CException.md',
102-
'vendor/cmock/docs/CMock_Summary.md',
103-
'vendor/unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf',
104-
'vendor/unity/docs/UnityAssertionsReference.md',
105-
'vendor/unity/docs/UnityConfigurationGuide.md',
106-
'vendor/unity/docs/UnityGettingStartedGuide.md',
107-
'vendor/unity/docs/UnityHelperScriptsGuide.md',
108-
'vendor/unity/docs/ThrowTheSwitchCodingStandard.md',
109-
]
110-
111-
doc_files.each do |f|
112-
copy_file(f, in_doc_path.call(File.basename(f)), :force => force)
100+
# Add documentation from main projects to list
101+
doc_files = {}
102+
['docs','vendor/unity/docs','vendor/cmock/docs','vendor/cexception/docs'].each do |p|
103+
Dir[ File.expand_path(File.join(here, p, '*.md')) ].each do |f|
104+
doc_files[ File.basename(f) ] = f unless(doc_files.include? f)
105+
end
106+
end
107+
108+
# Add documentation from plugins to list
109+
Dir[ File.join(here, 'plugins/**/README.md') ].each do |plugin_path|
110+
k = "plugin_" + plugin_path.split(/\\|\//)[-2] + ".md"
111+
doc_files[ k ] = File.expand_path(plugin_path)
112+
end
113+
114+
# Copy all documentation
115+
doc_files.each_pair do |k, v|
116+
copy_file(v, in_doc_path.call(k), :force => force)
113117
end
114118
end
115119

@@ -133,7 +137,6 @@ unless (project_found)
133137
{:src => 'vendor/cmock/config/', :dst => 'vendor/cmock/config'},
134138
{:src => 'vendor/cmock/lib/', :dst => 'vendor/cmock/lib'},
135139
{:src => 'vendor/cmock/src/', :dst => 'vendor/cmock/src'},
136-
{:src => 'vendor/deep_merge/lib/', :dst => 'vendor/deep_merge/lib'},
137140
{:src => 'vendor/diy/lib', :dst => 'vendor/diy/lib'},
138141
{:src => 'vendor/unity/auto/', :dst => 'vendor/unity/auto'},
139142
{:src => 'vendor/unity/src/', :dst => 'vendor/unity/src'},
@@ -146,16 +149,24 @@ unless (project_found)
146149

147150
# We're copying in a configuration file if we haven't said not to
148151
if (use_configs)
149-
if use_gem
150-
copy_file(File.join('assets', 'project_as_gem.yml'), File.join(name, 'project.yml'), :force => force)
152+
dst_yaml = File.join(name, 'project.yml')
153+
src_yaml = if use_gem
154+
File.join(here, 'assets', 'project_as_gem.yml')
151155
else
152-
copy_file(File.join('assets', 'project_with_guts.yml'), File.join(name, 'project.yml'), :force => force)
153156
if is_windows?
154157
copy_file(File.join('assets', 'ceedling.cmd'), File.join(name, 'ceedling.cmd'), :force => force)
155158
else
156159
copy_file(File.join('assets', 'ceedling'), File.join(name, 'ceedling'), :force => force)
157160
File.chmod(0755, File.join(name, 'ceedling'))
158161
end
162+
File.join(here, 'assets', 'project_with_guts.yml')
163+
end
164+
165+
# Perform the actual clone of the config file, while updating the version
166+
File.open(dst_yaml,'w') do |dst|
167+
require File.expand_path(File.join(File.dirname(__FILE__),"..","lib","ceedling","version.rb"))
168+
dst << File.read(src_yaml).gsub(":ceedling_version: '?'",":ceedling_version: #{Ceedling::Version::CEEDLING}")
169+
puts " create #{dst_yaml}"
159170
end
160171
end
161172

@@ -167,8 +178,8 @@ unless (project_found)
167178
unless silent
168179
puts "\n"
169180
puts "Project '#{name}' #{force ? "upgraded" : "created"}!"
170-
puts " - Tool documentation is located in vendor/ceedling/docs" if use_docs
171-
puts " - Execute 'ceedling help' to view available test & build tasks"
181+
puts " - Tool documentation is located in #{doc_path}" if use_docs
182+
puts " - Execute 'ceedling help' from #{name} to view available test & build tasks"
172183
puts ''
173184
end
174185
end
@@ -206,10 +217,10 @@ unless (project_found)
206217

207218
desc "version", "return the version of the tools installed"
208219
def version()
209-
require 'ceedling/version.rb'
210-
puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
211-
puts " CMock:: #{Ceedling::Version::CMOCK}"
212-
puts " Unity:: #{Ceedling::Version::UNITY}"
220+
require File.expand_path(File.join(File.dirname(__FILE__),"..","lib","ceedling","version.rb"))
221+
puts " Ceedling:: #{Ceedling::Version::CEEDLING}"
222+
puts " CMock:: #{Ceedling::Version::CMOCK}"
223+
puts " Unity:: #{Ceedling::Version::UNITY}"
213224
puts " CException:: #{Ceedling::Version::CEXCEPTION}"
214225
end
215226
end
@@ -287,6 +298,8 @@ else
287298
options[:list_tasks] = true
288299
when /^-T$/
289300
options[:list_tasks] = true
301+
when /^--tasks$/
302+
options[:list_tasks] = true
290303
when /^project:(\w+)/
291304
ENV['CEEDLING_USER_PROJECT_FILE'] = "#{$1}.yml"
292305
else

0 commit comments

Comments
 (0)