From 614677a4e19acaafe4f4b429b996bbee52e87d2d Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Tue, 15 Jan 2019 07:49:10 -0500 Subject: [PATCH 1/3] Run tests [files] alphabetically --- CHANGELOG.md | 1 + lib/arduino_ci/arduino_cmd.rb | 2 +- lib/arduino_ci/cpp_library.rb | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e0d06dc..915608ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added ### Changed +- Unit tests and examples are now executed alphabetically by filename ### Deprecated diff --git a/lib/arduino_ci/arduino_cmd.rb b/lib/arduino_ci/arduino_cmd.rb index 88e8a818..96d8c0aa 100644 --- a/lib/arduino_ci/arduino_cmd.rb +++ b/lib/arduino_ci/arduino_cmd.rb @@ -319,7 +319,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 From a41cb369abcd292e8c694fc6cfb201e5515cc996 Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Tue, 15 Jan 2019 07:52:35 -0500 Subject: [PATCH 2/3] Don't fail library installation if it's already installed --- CHANGELOG.md | 1 + lib/arduino_ci/arduino_cmd.rb | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 915608ef..82b7cecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed ### Fixed +- Library installation no longer "fails" if the library is already installed ### Security diff --git a/lib/arduino_ci/arduino_cmd.rb b/lib/arduino_ci/arduino_cmd.rb index 96d8c0aa..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 From 52f45cbf872f19e2563d7d4003d18e8a850a95ad Mon Sep 17 00:00:00 2001 From: Ian Katz Date: Tue, 15 Jan 2019 08:02:33 -0500 Subject: [PATCH 3/3] mega2560 platform definition --- CHANGELOG.md | 1 + misc/default.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b7cecf..e55e85a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### 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/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: