Skip to content

Commit cf47379

Browse files
committed
Restore build_shared_library and fix its bug
1 parent 4cc00b9 commit cf47379

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

exe/arduino_ci.rb

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -423,22 +423,7 @@ def perform_unit_tests(cpp_library, file_config)
423423
puts
424424
compilers.each do |gcc_binary|
425425
# before compiling the tests, build a shared library of everything except the test code
426-
got_shared_library = true
427-
attempt_multiline("Build shared library with #{gcc_binary} for #{p}") do
428-
exe = cpp_library.build_shared_library(
429-
config.aux_libraries_for_unittest,
430-
gcc_binary,
431-
config.gcc_config(p)
432-
)
433-
unless exe
434-
puts "Last command: #{cpp_library.last_cmd}"
435-
puts cpp_library.last_out
436-
puts cpp_library.last_err
437-
got_shared_library = false
438-
end
439-
next got_shared_library
440-
end
441-
next unless got_shared_library
426+
next unless build_shared_library(gcc_binary, p, config, cpp_library)
442427

443428
# now build and run each test using the shared library build above
444429
config.allowable_unittest_files(cpp_library.test_files).each do |unittest_path|
@@ -460,6 +445,23 @@ def perform_unit_tests(cpp_library, file_config)
460445
end
461446
end
462447

448+
def build_shared_library(gcc_binary, platform, config, cpp_library)
449+
attempt_multiline("Build shared library with #{gcc_binary} for #{platform}") do
450+
exe = cpp_library.build_shared_library(
451+
config.aux_libraries_for_unittest,
452+
gcc_binary,
453+
config.gcc_config(platform)
454+
)
455+
puts
456+
unless exe
457+
puts "Last command: #{cpp_library.last_cmd}"
458+
puts cpp_library.last_out
459+
puts cpp_library.last_err
460+
end
461+
exe
462+
end
463+
end
464+
463465
def perform_example_compilation_tests(cpp_library, config)
464466
phase("Compilation of example sketches")
465467
if @cli_options[:skip_compilation]

0 commit comments

Comments
 (0)