diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e0d06dc..e55e85a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,12 +8,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added ### Changed +- Unit tests and examples are now executed alphabetically by filename ### Deprecated ### Removed ### Fixed +- Library installation no longer "fails" if the library is already installed +- Platform definition for `mega2560` now includes proper AVR compiler flag ### Security diff --git a/lib/arduino_ci/arduino_cmd.rb b/lib/arduino_ci/arduino_cmd.rb index 88e8a818..c5787a1f 100644 --- a/lib/arduino_ci/arduino_cmd.rb +++ b/lib/arduino_ci/arduino_cmd.rb @@ -190,7 +190,10 @@ def install_boards(boardfamily) # @param name [String] the library name # @return [bool] whether the command succeeded def _install_library(library_name) - success = run_and_capture(flag_install_library, library_name)[:success] + result = run_and_capture(flag_install_library, library_name) + + already_installed = result[:err].include?("Library is already installed: #{library_name}") + success = result[:success] || already_installed @libraries_indexed = (@libraries_indexed || success) if library_name == WORKAROUND_LIB success @@ -237,7 +240,7 @@ def library_present?(library_name) def update_library_index # install random lib so the arduino IDE grabs a new library index # see: https://github.com/arduino/Arduino/issues/3535 - install_library("USBHost") + install_library(WORKAROUND_LIB) end # use a particular board for compilation @@ -319,7 +322,7 @@ def library_examples(installed_library_path) proj_file = example_path + e + "#{e}.ino" proj_file.exist? ? proj_file.to_s : nil end - files.reject(&:nil?) + files.reject(&:nil?).sort_by(&:to_s) end end end diff --git a/lib/arduino_ci/cpp_library.rb b/lib/arduino_ci/cpp_library.rb index ed338a9e..ce632a68 100644 --- a/lib/arduino_ci/cpp_library.rb +++ b/lib/arduino_ci/cpp_library.rb @@ -109,7 +109,8 @@ def cpp_files_in(some_dir) real = some_dir.realpath files = Find.find(real).map { |p| Pathname.new(p) }.reject(&:directory?) cpp = files.select { |path| CPP_EXTENSIONS.include?(path.extname.downcase) } - cpp.reject { |path| path.basename.to_s.start_with?(".") } # ignore hidden + not_hidden = cpp.reject { |path| path.basename.to_s.start_with?(".") } + not_hidden.sort_by(&:to_s) end # CPP files that are part of the project library under test diff --git a/misc/default.yml b/misc/default.yml index 6ee00ce4..c4baff87 100644 --- a/misc/default.yml +++ b/misc/default.yml @@ -98,6 +98,7 @@ platforms: gcc: features: defines: + - __AVR_ATmega2560__ warnings: flags: cplayClassic: