@@ -423,22 +423,7 @@ def perform_unit_tests(cpp_library, file_config)
423
423
puts
424
424
compilers . each do |gcc_binary |
425
425
# 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 )
442
427
443
428
# now build and run each test using the shared library build above
444
429
config . allowable_unittest_files ( cpp_library . test_files ) . each do |unittest_path |
@@ -460,6 +445,23 @@ def perform_unit_tests(cpp_library, file_config)
460
445
end
461
446
end
462
447
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
+
463
465
def perform_example_compilation_tests ( cpp_library , config )
464
466
phase ( "Compilation of example sketches" )
465
467
if @cli_options [ :skip_compilation ]
0 commit comments