Skip to content

Commit 00f10a0

Browse files
committed
Expand yml tests and verbosity
1 parent 6052593 commit 00f10a0

File tree

2 files changed

+27
-17
lines changed

2 files changed

+27
-17
lines changed

CHANGELOG.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
## [Unreleased]
88
### Added
99
- Arduino command wrapper now natively supports board manager URLs
10-
- CI checks for proper board manager URLs for requested platforms
11-
- CI reports on Arduino executable location
10+
- `arduino_ci_remote.rb` checks for proper board manager URLs for requested platforms
11+
- `arduino_ci_remote.rb` reports on Arduino executable location
1212

1313
### Changed
1414
- Centralized file listing code in `arduino_ci_remote.rb`
15+
- `arduino_ci_remote.rb` is verbose about platforms, packages, and URLs
1516

1617
### Deprecated
1718

exe/arduino_ci_remote.rb

+24-15
Original file line numberDiff line numberDiff line change
@@ -143,42 +143,51 @@ def display_files(pathname)
143143
inform("libasan availability for #{gcc_binary}") { cpp_library.libasan?(gcc_binary) }
144144
end
145145

146-
# gather up all required boards so we can install them up front.
146+
# Ensure platforms exist for unit test, and save their info in all_platform_info keyed by name
147+
all_platform_info = {}
148+
config.platforms_to_unittest.each { |p| all_platform_info[p] = assured_platform("unittest", p, config) }
149+
150+
# gather up all required boards for compilation so we can install them up front.
147151
# start with the "platforms to unittest" and add the examples
148152
# while we're doing that, get the aux libraries as well
149-
all_platforms = {}
150-
board_platform_url = {}
153+
example_platform_info = {}
154+
board_package_url = {}
151155
aux_libraries = Set.new(config.aux_libraries_for_unittest + config.aux_libraries_for_build)
152156
# while collecting the platforms, ensure they're defined
153-
config.platforms_to_unittest.each { |p| all_platforms[p] = assured_platform("unittest", p, config) }
154-
example_platforms = {}
155157
library_examples.each do |path|
156158
ovr_config = config.from_example(path)
157-
ovr_config.platforms_to_build.each do |p|
159+
ovr_config.platforms_to_build.each do |platform|
158160
# assure the platform if we haven't already
159-
example_platforms[p] = all_platforms[p] = assured_platform("library example", p, config) unless example_platforms.key?(p)
160-
board_platform_url[p] = ovr_config.package_url(p)
161+
next if example_platform_info.key?(platform)
162+
163+
platform_info = assured_platform("library example", platform, config)
164+
next if platform_info.nil?
165+
166+
example_platform_info[platform] = all_platform_info[platform] = platform_info
167+
package = platform_info[:package]
168+
board_package_url[package] = ovr_config.package_url(package)
161169
end
162170
aux_libraries.merge(ovr_config.aux_libraries_for_build)
163171
end
164172

165173
# with all platform info, we can extract unique packages and their urls
166174
# do that, set the URLs, and download the packages
167-
all_packages = all_platforms.values.map { |v| v[:package] }.uniq.reject(&:nil?)
175+
all_packages = all_platform_info.values.map { |v| v[:package] }.uniq.reject(&:nil?)
168176

169177
# inform about builtin packages
170-
all_packages.select { |p| config.package_builtin?(p) }.each do
178+
all_packages.select { |p| config.package_builtin?(p) }.each do |p|
171179
inform("Using built-in board package") { p }
172180
end
173181

174182
# make sure any non-builtin package has a URL defined
175-
all_packages.reject { |p| config.package_builtin?(p) }.each do
176-
assure("Board package #{p} has a defined URL") { board_platform_url[p] }
183+
all_packages.reject { |p| config.package_builtin?(p) }.each do |p|
184+
assure("Board package #{p} has a defined URL") { board_package_url[p] }
177185
end
178186

179187
# set up all the board manager URLs.
180188
# we can safely reject nils now, they would be for the builtins
181-
all_urls = all_packages.map { |p| board_platform_url(p) }.uniq.reject(&:nil?)
189+
all_urls = all_packages.map { |p| board_package_url[p] }.uniq.reject(&:nil?)
190+
182191
unless all_urls.empty?
183192
assure("Setting board manager URLs") do
184193
@arduino_cmd.board_manager_urls = all_urls
@@ -217,7 +226,7 @@ def display_files(pathname)
217226
inform("Skipping unit tests") { "no platforms were requested" }
218227
else
219228
config.platforms_to_unittest.each do |p|
220-
board = all_platforms[p][:board]
229+
board = all_platform_info[p][:board]
221230
assure("Switching to board for #{p} (#{board})") { @arduino_cmd.use_board(board) } unless last_board == board
222231
last_board = board
223232
cpp_library.test_files.each do |unittest_path|
@@ -262,7 +271,7 @@ def display_files(pathname)
262271
end
263272

264273
examples_by_platform.each do |platform, example_paths|
265-
board = all_platforms[platform][:board]
274+
board = all_platform_info[platform][:board]
266275
assure("Switching to board for #{platform} (#{board})") { @arduino_cmd.use_board(board) } unless last_board == board
267276
last_board = board
268277

0 commit comments

Comments
 (0)