@@ -90,9 +90,20 @@ def assured_platform(purpose, name, config)
90
90
installed_library_path = attempt ( "Installing library under test" ) do
91
91
@arduino_cmd . install_local_library ( Pathname . new ( "." ) )
92
92
end
93
+ if installed_library_path . exist?
94
+ inform ( "Library installed at" ) { installed_library_path . to_s }
95
+ else
96
+ assure_multiline ( "Library installed successfully" ) do
97
+ @arduino_cmd . lib_dir . ascend do |path_part |
98
+ next unless path_part . exist?
99
+
100
+ break puts path_part . find . to_a . to_s
101
+ end
102
+ false
103
+ end
104
+ end
93
105
library_examples = @arduino_cmd . library_examples ( installed_library_path )
94
106
cpp_library = ArduinoCI ::CppLibrary . new ( installed_library_path , @arduino_cmd . lib_dir )
95
- attempt ( "Library installed at #{ installed_library_path } " ) { true }
96
107
97
108
# check GCC
98
109
compilers = config . compilers_to_use
@@ -138,7 +149,7 @@ def assured_platform(purpose, name, config)
138
149
139
150
aux_libraries . each do |l |
140
151
if @arduino_cmd . library_present? ( l )
141
- assure ( "Using pre-existing library ' #{ l } ' " ) { true }
152
+ inform ( "Using pre-existing library" ) { l . to_s }
142
153
else
143
154
assure ( "Installing aux library '#{ l } '" ) { @arduino_cmd . install_library ( l ) }
144
155
end
@@ -147,11 +158,17 @@ def assured_platform(purpose, name, config)
147
158
# iterate boards / tests
148
159
last_board = nil
149
160
if !cpp_library . tests_dir . exist?
150
- attempt ( "Skipping unit tests; no tests dir at #{ cpp_library . tests_dir } " ) { true }
161
+ inform_multiline ( "Skipping unit tests; no tests dir at #{ cpp_library . tests_dir } " ) do
162
+ puts cpp_library . tests_dir . find . to_a . to_s
163
+ true
164
+ end
151
165
elsif cpp_library . test_files . empty?
152
- attempt ( "Skipping unit tests; no test files were found in #{ cpp_library . tests_dir } " ) { true }
166
+ inform_multiline ( "Skipping unit tests; no test files were found in #{ cpp_library . tests_dir } " ) do
167
+ puts cpp_library . tests_dir . find . to_a . to_s
168
+ true
169
+ end
153
170
elsif config . platforms_to_unittest . empty?
154
- attempt ( "Skipping unit tests; no platforms were requested" ) { true }
171
+ inform ( "Skipping unit tests" ) { " no platforms were requested" }
155
172
else
156
173
config . platforms_to_unittest . each do |p |
157
174
board = all_platforms [ p ] [ :board ]
@@ -181,26 +198,30 @@ def assured_platform(purpose, name, config)
181
198
end
182
199
end
183
200
184
- unless library_examples . empty?
201
+ if library_examples . empty?
202
+ inform_multiline ( "Skipping libraries; no examples found in #{ installed_library_path } " ) do
203
+ puts installed_library_path . find . to_a . to_s
204
+ end
205
+ else
185
206
attempt ( "Setting compiler warning level" ) { @arduino_cmd . set_pref ( "compiler.warning_level" , "all" ) }
186
- end
187
207
188
- # unlike previous, iterate examples / boards
189
- library_examples . each do |example_path |
190
- ovr_config = config . from_example ( example_path )
191
- ovr_config . platforms_to_build . each do |p |
192
- board = all_platforms [ p ] [ :board ]
193
- assure ( "Switching to board for #{ p } (#{ board } )" ) { @arduino_cmd . use_board ( board ) } unless last_board == board
194
- last_board = board
195
- example_name = File . basename ( example_path )
196
- attempt ( "Verifying #{ example_name } " ) do
197
- ret = @arduino_cmd . verify_sketch ( example_path )
198
- unless ret
199
- puts
200
- puts "Last command: #{ @arduino_cmd . last_msg } "
201
- puts @arduino_cmd . last_err
208
+ # unlike previous, iterate examples / boards
209
+ library_examples . each do |example_path |
210
+ ovr_config = config . from_example ( example_path )
211
+ ovr_config . platforms_to_build . each do |p |
212
+ board = all_platforms [ p ] [ :board ]
213
+ assure ( "Switching to board for #{ p } (#{ board } )" ) { @arduino_cmd . use_board ( board ) } unless last_board == board
214
+ last_board = board
215
+ example_name = File . basename ( example_path )
216
+ attempt ( "Verifying #{ example_name } " ) do
217
+ ret = @arduino_cmd . verify_sketch ( example_path )
218
+ unless ret
219
+ puts
220
+ puts "Last command: #{ @arduino_cmd . last_msg } "
221
+ puts @arduino_cmd . last_err
222
+ end
223
+ ret
202
224
end
203
- ret
204
225
end
205
226
end
206
227
end
0 commit comments