Skip to content

Commit ce538ab

Browse files
committed
add CI script to gem
1 parent 64e272d commit ce538ab

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ script:
1313
- bundle exec rubocop --version
1414
- bundle exec rubocop -D .
1515
- bundle exec rspec
16+
- bundle exec ci_system_check.rb

arduino_ci.gemspec

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ Gem::Specification.new do |spec|
1414
spec.description = spec.description
1515
spec.homepage = "http://github.com/ifreecarve/arduino_ci"
1616

17-
spec.files = ['README.md', '.yardopts'] + Dir['lib/**/*.*'].reject { |f| f.match(%r{^(test|spec|features)/}) }
18-
1917
spec.bindir = "exe"
18+
rejection_regex = %r{^(test|spec|features)/}
19+
libfiles = Dir['lib/**/*.*'].reject { |f| f.match(rejection_regex) }
20+
binfiles = Dir[File.join(spec.bindir, '/**/*.*')].reject { |f| f.match(rejection_regex) }
21+
spec.files = ['README.md', '.yardopts'] + libfiles + binfiles
22+
2023
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
2124
spec.require_paths = ["lib"]
2225

exe/ci_system_check.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
require 'arduino_ci'
2+
3+
puts "Enabling display with display manager"
4+
ArduinoCI::DisplayManager::instance.enable
5+
6+
puts "Autlocating Arduino command"
7+
arduino_cmd = ArduinoCI::ArduinoCmd.autolocate!
8+
9+
board_tests = {
10+
"arduino:avr:uno" => true,
11+
"eggs:milk:wheat" => false,
12+
}
13+
14+
got_problem = false
15+
board_tests.each do |k, v|
16+
puts "I expect arduino_cmd.board_installed?(#{k}) to be #{v}"
17+
result = arduino_cmd.board_installed?(k)
18+
puts " board_installed?(#{k}) returns #{result}. expected #{v}"
19+
got_problem = true if v != result
20+
end
21+
22+
abort if got_problem
23+
exit(0)

0 commit comments

Comments
 (0)