Skip to content

Commit bd4b916

Browse files
committed
Address lint issues.
1 parent e0da3f7 commit bd4b916

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

exe/arduino_ci.rb

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -423,27 +423,24 @@ 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-
if build_shared_library(gcc_binary, p, config, cpp_library)
427-
# now build and run each test using the shared library build above
428-
config.allowable_unittest_files(cpp_library.test_files).each do |unittest_path|
429-
unittest_name = unittest_path.basename.to_s
430-
puts "--------------------------------------------------------------------------------"
431-
attempt_multiline("Unit testing #{unittest_name} with #{gcc_binary} for #{p}") do
432-
exe = cpp_library.build_for_test_with_configuration(
433-
unittest_path,
434-
config.aux_libraries_for_unittest,
435-
gcc_binary,
436-
config.gcc_config(p)
437-
)
438-
puts
439-
unless exe
440-
puts "Last command: #{cpp_library.last_cmd}"
441-
puts cpp_library.last_out
442-
puts cpp_library.last_err
443-
next false
444-
end
445-
cpp_library.run_test_file(exe)
426+
next unless build_shared_library(gcc_binary, p, config, cpp_library)
427+
# now build and run each test using the shared library build above
428+
config.allowable_unittest_files(cpp_library.test_files).each do |unittest_path|
429+
unittest_name = unittest_path.basename.to_s
430+
puts "--------------------------------------------------------------------------------"
431+
attempt_multiline("Unit testing #{unittest_name} with #{gcc_binary} for #{p}") do
432+
exe = cpp_library.build_for_test_with_configuration(
433+
unittest_path,
434+
gcc_binary
435+
)
436+
puts
437+
unless exe
438+
puts "Last command: #{cpp_library.last_cmd}"
439+
puts cpp_library.last_out
440+
puts cpp_library.last_err
441+
next false
446442
end
443+
cpp_library.run_test_file(exe)
447444
end
448445
end
449446
end

lib/arduino_ci/cpp_library.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
CI_CPP_DIR = Pathname.new(__dir__).parent.parent + "cpp"
1010
ARDUINO_HEADER_DIR = CI_CPP_DIR + "arduino"
1111
UNITTEST_HEADER_DIR = CI_CPP_DIR + "unittest"
12-
LIBRARY_NAME = "arduino"
13-
BUILD_DIR = "#{Dir.pwd}/.arduino_ci" # hide build artifacts
14-
12+
LIBRARY_NAME = "arduino".freeze
13+
BUILD_DIR = "#{Dir.pwd}/.arduino_ci".freeze # hide build artifacts
1514

1615
module ArduinoCI
1716

@@ -492,7 +491,7 @@ def test_args(aux_libraries, ci_gcc_config)
492491
# @param aux_libraries [Array<Pathname>] The external Arduino libraries required by this project
493492
# @param ci_gcc_config [Hash] The GCC config object
494493
# @return [Pathname] path to the compiled test executable
495-
def build_for_test_with_configuration(test_file, aux_libraries, gcc_binary, ci_gcc_config)
494+
def build_for_test_with_configuration(test_file, gcc_binary)
496495
executable = Pathname.new("#{BUILD_DIR}/#{test_file.basename}.bin").expand_path
497496
File.delete(executable) if File.exist?(executable)
498497
arg_sets = ["-std=c++0x", "-o", executable.to_s, "-L#{BUILD_DIR}", "-DARDUINO=100"]

0 commit comments

Comments
 (0)