Skip to content

Commit 96079b6

Browse files
authored
Merge pull request #90 from ianfixes/2019-01-15_small_fixes
Small fixes
2 parents 23b20f0 + 52f45cb commit 96079b6

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
### Added
99

1010
### Changed
11+
- Unit tests and examples are now executed alphabetically by filename
1112

1213
### Deprecated
1314

1415
### Removed
1516

1617
### Fixed
18+
- Library installation no longer "fails" if the library is already installed
19+
- Platform definition for `mega2560` now includes proper AVR compiler flag
1720

1821
### Security
1922

lib/arduino_ci/arduino_cmd.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ def install_boards(boardfamily)
190190
# @param name [String] the library name
191191
# @return [bool] whether the command succeeded
192192
def _install_library(library_name)
193-
success = run_and_capture(flag_install_library, library_name)[:success]
193+
result = run_and_capture(flag_install_library, library_name)
194+
195+
already_installed = result[:err].include?("Library is already installed: #{library_name}")
196+
success = result[:success] || already_installed
194197

195198
@libraries_indexed = (@libraries_indexed || success) if library_name == WORKAROUND_LIB
196199
success
@@ -237,7 +240,7 @@ def library_present?(library_name)
237240
def update_library_index
238241
# install random lib so the arduino IDE grabs a new library index
239242
# see: https://github.com/arduino/Arduino/issues/3535
240-
install_library("USBHost")
243+
install_library(WORKAROUND_LIB)
241244
end
242245

243246
# use a particular board for compilation
@@ -319,7 +322,7 @@ def library_examples(installed_library_path)
319322
proj_file = example_path + e + "#{e}.ino"
320323
proj_file.exist? ? proj_file.to_s : nil
321324
end
322-
files.reject(&:nil?)
325+
files.reject(&:nil?).sort_by(&:to_s)
323326
end
324327
end
325328
end

lib/arduino_ci/cpp_library.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ def cpp_files_in(some_dir)
109109
real = some_dir.realpath
110110
files = Find.find(real).map { |p| Pathname.new(p) }.reject(&:directory?)
111111
cpp = files.select { |path| CPP_EXTENSIONS.include?(path.extname.downcase) }
112-
cpp.reject { |path| path.basename.to_s.start_with?(".") } # ignore hidden
112+
not_hidden = cpp.reject { |path| path.basename.to_s.start_with?(".") }
113+
not_hidden.sort_by(&:to_s)
113114
end
114115

115116
# CPP files that are part of the project library under test

misc/default.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ platforms:
9898
gcc:
9999
features:
100100
defines:
101+
- __AVR_ATmega2560__
101102
warnings:
102103
flags:
103104
cplayClassic:

0 commit comments

Comments
 (0)