arduino_ci 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/exe/arduino_ci_remote.rb +11 -9
- data/exe/libasan.rb +29 -0
- data/lib/arduino_ci/cpp_library.rb +1 -1
- data/lib/arduino_ci/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4f20d94ac4bedc4752bd3e1654d82e975495178e03acb376bde929706a29f99
|
4
|
+
data.tar.gz: e759bee8b5ab8150575f14f54bba4c94923a5c7da0de888cf6f81cb563e2f12d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b50125ea2dd1b132bbe7caf9b79153cedffa340ca75cac954c9ebc183755dc31cf81033699792a727f9a594aceb779c278b306871e7df44467e5d385951763f5
|
7
|
+
data.tar.gz: a48e40b8f1d92be759f545196410bf09f2870737f7c3254d87a16f78bcbbf6798f79ed1f155bc70b98bdbcc1ad3432a735dfb0bdedc1b60b132530634000759a
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
# ArduinoCI Ruby gem (`arduino_ci`) [![Gem Version](https://badge.fury.io/rb/arduino_ci.svg)](https://rubygems.org/gems/arduino_ci) [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/arduino_ci/0.1.
|
2
|
+
# ArduinoCI Ruby gem (`arduino_ci`) [![Gem Version](https://badge.fury.io/rb/arduino_ci.svg)](https://rubygems.org/gems/arduino_ci) [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/arduino_ci/0.1.12)
|
3
3
|
|
4
4
|
You want your Arduino library to be automatically built and tested every time someone contributes code to your project on GitHub, but the Arduino IDE lacks the ability to run unit tests. [Arduino CI](https://github.com/ianfixes/arduino_ci) provides that ability.
|
5
5
|
|
@@ -13,7 +13,7 @@ Platform | CI Status
|
|
13
13
|
---------|:---------
|
14
14
|
OSX | [![OSX Build Status](http://badges.herokuapp.com/travis/ianfixes/arduino_ci?env=BADGE=osx&label=build&branch=master)](https://travis-ci.org/ianfixes/arduino_ci)
|
15
15
|
Linux | [![Linux Build Status](http://badges.herokuapp.com/travis/ianfixes/arduino_ci?env=BADGE=linux&label=build&branch=master)](https://travis-ci.org/ianfixes/arduino_ci)
|
16
|
-
Windows | [![Windows Build status](https://ci.appveyor.com/api/projects/status/8f6e39dea319m83q?svg=true)](https://ci.appveyor.com/project/ianfixes/arduino-ci)
|
16
|
+
Windows | [![Windows Build status](https://ci.appveyor.com/api/projects/status/8f6e39dea319m83q/branch/master?svg=true)](https://ci.appveyor.com/project/ianfixes/arduino-ci)
|
17
17
|
|
18
18
|
|
19
19
|
## Installation In Your GitHub Project And Using Travis CI
|
data/exe/arduino_ci_remote.rb
CHANGED
@@ -23,7 +23,7 @@ def terminate(final = nil)
|
|
23
23
|
end
|
24
24
|
|
25
25
|
# make a nice status line for an action and react to the action
|
26
|
-
def perform_action(message, multiline, mark_fn, on_fail_msg, abort_on_fail)
|
26
|
+
def perform_action(message, multiline, mark_fn, on_fail_msg, tally_on_fail, abort_on_fail)
|
27
27
|
line = "#{message}... "
|
28
28
|
endline = "...#{message} "
|
29
29
|
if multiline
|
@@ -36,10 +36,10 @@ def perform_action(message, multiline, mark_fn, on_fail_msg, abort_on_fail)
|
|
36
36
|
mark = mark_fn.nil? ? "" : mark_fn.call(result)
|
37
37
|
# if multline, put checkmark at full width
|
38
38
|
print endline if multiline
|
39
|
-
puts mark.rjust(WIDTH - line.length, " ")
|
39
|
+
puts mark.to_s.rjust(WIDTH - line.length, " ")
|
40
40
|
unless result
|
41
41
|
puts on_fail_msg unless on_fail_msg.nil?
|
42
|
-
@failure_count += 1
|
42
|
+
@failure_count += 1 if tally_on_fail
|
43
43
|
# print out error messaging here if we've captured it
|
44
44
|
terminate if abort_on_fail
|
45
45
|
end
|
@@ -48,29 +48,30 @@ end
|
|
48
48
|
|
49
49
|
# Make a nice status for something that defers any failure code until script exit
|
50
50
|
def attempt(message, &block)
|
51
|
-
perform_action(message, false, @passfail, nil, false, &block)
|
51
|
+
perform_action(message, false, @passfail, nil, true, false, &block)
|
52
52
|
end
|
53
53
|
|
54
54
|
# Make a nice status for something that defers any failure code until script exit
|
55
55
|
def attempt_multiline(message, &block)
|
56
|
-
perform_action(message, true, @passfail, nil, false, &block)
|
56
|
+
perform_action(message, true, @passfail, nil, true, false, &block)
|
57
57
|
end
|
58
58
|
|
59
59
|
# Make a nice status for something that kills the script immediately on failure
|
60
|
+
FAILED_ASSURANCE_MESSAGE = "This may indicate a problem with ArduinoCI, or your configuration".freeze
|
60
61
|
def assure(message, &block)
|
61
|
-
perform_action(message, false, @passfail,
|
62
|
+
perform_action(message, false, @passfail, FAILED_ASSURANCE_MESSAGE, true, true, &block)
|
62
63
|
end
|
63
64
|
|
64
65
|
def assure_multiline(message, &block)
|
65
|
-
perform_action(message, true, @passfail,
|
66
|
+
perform_action(message, true, @passfail, FAILED_ASSURANCE_MESSAGE, true, true, &block)
|
66
67
|
end
|
67
68
|
|
68
69
|
def inform(message, &block)
|
69
|
-
perform_action(message, false, proc { |x| x }, nil, false, &block)
|
70
|
+
perform_action(message, false, proc { |x| x }, nil, false, false, &block)
|
70
71
|
end
|
71
72
|
|
72
73
|
def inform_multiline(message, &block)
|
73
|
-
perform_action(message, true, nil, nil, false, &block)
|
74
|
+
perform_action(message, true, nil, nil, false, false, &block)
|
74
75
|
end
|
75
76
|
|
76
77
|
# Assure that a platform exists and return its definition
|
@@ -116,6 +117,7 @@ compilers.each do |gcc_binary|
|
|
116
117
|
puts version.split("\n").map { |l| " #{l}" }.join("\n")
|
117
118
|
version
|
118
119
|
end
|
120
|
+
inform("libasan availability for #{gcc_binary}") { cpp_library.libasan?(gcc_binary) }
|
119
121
|
end
|
120
122
|
|
121
123
|
# gather up all required boards so we can install them up front.
|
data/exe/libasan.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'arduino_ci'
|
3
|
+
require 'set'
|
4
|
+
require 'pathname'
|
5
|
+
|
6
|
+
WIDTH = 80
|
7
|
+
|
8
|
+
# initialize command and config
|
9
|
+
config = ArduinoCI::CIConfig.default.from_project_library
|
10
|
+
@arduino_cmd = ArduinoCI::ArduinoInstallation.autolocate!
|
11
|
+
|
12
|
+
# initialize library under test
|
13
|
+
installed_library_path = @arduino_cmd.install_local_library(Pathname.new("."))
|
14
|
+
cpp_library = ArduinoCI::CppLibrary.new(installed_library_path, @arduino_cmd.lib_dir)
|
15
|
+
|
16
|
+
# check GCC
|
17
|
+
compilers = config.compilers_to_use
|
18
|
+
compilers.each do |gcc_binary|
|
19
|
+
puts "Checking #{gcc_binary} version"
|
20
|
+
puts cpp_library.gcc_version(gcc_binary).split("\n").map { |l| " #{l}" }.join("\n")
|
21
|
+
exists = cpp_library.libasan?(gcc_binary)
|
22
|
+
puts "libasan availability for #{gcc_binary}: #{exists}"
|
23
|
+
next unless exists
|
24
|
+
|
25
|
+
puts "========== Stdout:"
|
26
|
+
puts @arduino_cmd.last_out
|
27
|
+
puts "========== Stderr:"
|
28
|
+
puts @arduino_cmd.last_err
|
29
|
+
end
|
@@ -70,7 +70,7 @@ module ArduinoCI
|
|
70
70
|
# @param gcc_binary [String]
|
71
71
|
def libasan?(gcc_binary)
|
72
72
|
unless @has_libasan_cache.key?(gcc_binary)
|
73
|
-
file = Tempfile.new(
|
73
|
+
file = Tempfile.new(["arduino_ci_libasan_check", ".cpp"])
|
74
74
|
begin
|
75
75
|
file.write "int main(){}"
|
76
76
|
file.close
|
data/lib/arduino_ci/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arduino_ci
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ian Katz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: os
|
@@ -101,6 +101,7 @@ executables:
|
|
101
101
|
- arduino_ci_remote.rb
|
102
102
|
- arduino_ci_remote.rb.orig
|
103
103
|
- ensure_arduino_installation.rb
|
104
|
+
- libasan.rb
|
104
105
|
extensions: []
|
105
106
|
extra_rdoc_files: []
|
106
107
|
files:
|
@@ -408,6 +409,7 @@ files:
|
|
408
409
|
- exe/arduino_ci_remote.rb
|
409
410
|
- exe/arduino_ci_remote.rb.orig
|
410
411
|
- exe/ensure_arduino_installation.rb
|
412
|
+
- exe/libasan.rb
|
411
413
|
- lib/arduino_ci.rb
|
412
414
|
- lib/arduino_ci/arduino_cmd.rb
|
413
415
|
- lib/arduino_ci/arduino_cmd_linux.rb
|