arduino_ci 0.1.11 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +136 -43
- data/REFERENCE.md +625 -0
- data/cpp/arduino/Arduino.h +1 -3
- data/cpp/arduino/AvrMath.h +117 -17
- data/cpp/arduino/Client.h +27 -0
- data/cpp/arduino/EEPROM.h +64 -0
- data/cpp/arduino/Godmode.cpp +38 -19
- data/cpp/arduino/Godmode.h +88 -22
- data/cpp/arduino/HardwareSerial.h +9 -28
- data/cpp/arduino/IPAddress.h +59 -0
- data/cpp/arduino/MockEventQueue.h +86 -0
- data/cpp/arduino/PinHistory.h +64 -24
- data/cpp/arduino/Print.h +9 -12
- data/cpp/arduino/Printable.h +8 -0
- data/cpp/arduino/SPI.h +11 -3
- data/cpp/arduino/Server.h +5 -0
- data/cpp/arduino/Udp.h +27 -0
- data/cpp/arduino/Wire.h +234 -0
- data/cpp/arduino/avr/io.h +10 -1
- data/cpp/arduino/avr/pgmspace.h +91 -60
- data/cpp/arduino/ci/StreamTape.h +36 -0
- data/cpp/arduino/stdlib.cpp +61 -0
- data/cpp/arduino/stdlib.h +14 -0
- data/cpp/unittest/ArduinoUnitTests.cpp +3 -0
- data/cpp/unittest/ArduinoUnitTests.h +64 -23
- data/cpp/unittest/Assertion.h +4 -0
- data/cpp/unittest/Compare.h +94 -888
- data/cpp/unittest/OstreamHelpers.h +9 -0
- data/exe/arduino_ci.rb +400 -0
- data/exe/arduino_ci_remote.rb +2 -228
- data/exe/arduino_library_location.rb +7 -0
- data/lib/arduino_ci/arduino_backend.rb +218 -0
- data/lib/arduino_ci/arduino_downloader.rb +54 -92
- data/lib/arduino_ci/arduino_downloader_linux.rb +17 -55
- data/lib/arduino_ci/arduino_downloader_osx.rb +20 -36
- data/lib/arduino_ci/arduino_downloader_windows.rb +14 -56
- data/lib/arduino_ci/arduino_installation.rb +25 -74
- data/lib/arduino_ci/ci_config.rb +63 -11
- data/lib/arduino_ci/cpp_library.rb +320 -63
- data/lib/arduino_ci/host.rb +59 -4
- data/lib/arduino_ci/library_properties.rb +96 -0
- data/lib/arduino_ci/version.rb +1 -1
- data/lib/arduino_ci.rb +1 -0
- data/misc/default.yml +108 -5
- metadata +24 -69
- data/cpp/arduino/ci/Queue.h +0 -73
- data/exe/arduino_ci_remote.rb.orig +0 -216
- data/lib/arduino_ci/arduino_cmd.rb +0 -302
- data/lib/arduino_ci/arduino_cmd_linux.rb +0 -75
- data/lib/arduino_ci/arduino_cmd_linux_builder.rb +0 -19
- data/lib/arduino_ci/arduino_cmd_osx.rb +0 -17
- data/lib/arduino_ci/arduino_cmd_windows.rb +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: c195767b10bc2c1a3e837b89f087962251fb514c
|
|
4
|
+
data.tar.gz: 2188e52c1fa37664c72067bec73281fc8d5582e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef354ff7e588004f7d8394999d3044edd1a40aeb2187fe607a4cd76535f7bd23aabfb916226640dfa3778f084b67f32ffd1a30e22b86e7a9b06094ac021d7130
|
|
7
|
+
data.tar.gz: 3e53f5fefb40d4fe7593e66118f7e51b73b01921cff1b2489787ccadcca5dadac2be3f9d9b2947ad0018f692747984c092365157d3a22a7cbdc180c51cde0ef4
|
data/README.md
CHANGED
|
@@ -1,28 +1,58 @@
|
|
|
1
1
|
|
|
2
|
-
# ArduinoCI Ruby gem (`arduino_ci`)
|
|
2
|
+
# ArduinoCI Ruby gem (`arduino_ci`)
|
|
3
|
+
[](https://rubygems.org/gems/arduino_ci)
|
|
4
|
+
[](http://www.rubydoc.info/gems/arduino_ci/1.0.0)
|
|
5
|
+
[](https://gitter.im/Arduino-CI/arduino_ci?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
|
3
6
|
|
|
4
|
-
You want
|
|
5
|
-
|
|
6
|
-
You want to run tests on your Arduino library without hardware present, but the IDE doesn't support that. Arduino CI proivdes that ability.
|
|
7
|
+
You want to run tests on your Arduino library (bonus: without hardware present), but the IDE doesn't support that. Arduino CI provides that ability.
|
|
7
8
|
|
|
8
9
|
You want to precisely replicate certain software states in your library, but you don't have sub-millisecond reflexes for physically faking the inputs, outputs, and serial port. Arduino CI fakes 100% of the physical input and output of an Arduino board, including the clock.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
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/Arduino-CI/arduino_ci) provides that ability.
|
|
12
|
+
|
|
13
|
+
`arduino_ci` is a cross-platform build/test system, consisting of a Ruby gem and a series of C++ mocks. It enables tests to be run both locally and as part of a CI service like GitHub Actions, TravisCI, Appveyor, etc. Any OS that can run the Arduino IDE can run `arduino_ci`.
|
|
14
|
+
|
|
11
15
|
|
|
12
16
|
Platform | CI Status
|
|
13
17
|
---------|:---------
|
|
14
|
-
OSX | [](https://github.com/Arduino-CI/arduino_ci/actions?workflow=macos)
|
|
19
|
+
Linux | [](https://github.com/Arduino-CI/arduino_ci/actions?workflow=linux)
|
|
20
|
+
Windows | [](https://github.com/Arduino-CI/arduino_ci/actions?workflow=windows)
|
|
17
21
|
|
|
18
22
|
|
|
19
|
-
##
|
|
23
|
+
## Comparison to Other Arduino Testing Tools
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
| Project | CI | Builds Examples | Unittest | Arduino Mocks | Windows | OSX | Linux | License |
|
|
26
|
+
|-----------------------------------------------------------------------------|:--:|:---------------:|:--------:|:-------------:|:-------:|:---:|:-----:|:--------|
|
|
27
|
+
|[ArduinoCI](https://github.com/Arduino-CI/arduino_ci) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |Free (Apache-2.0)|
|
|
28
|
+
|[ArduinoUnit](https://github.com/mmurdoch/arduinounit) | ❌ | ❌ | ⚠️ Hardware-based|❌ | ✅ | ✅ | ✅ |Free (MIT)|
|
|
29
|
+
|[Adafruit `ci-arduino`](https://github.com/adafruit/ci-arduino)| ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |Free (MIT)|
|
|
30
|
+
|[PlatformIO](https://platformio.org) | ✅ | ✅ | ⚠️ Paid only | ❌ | ✅ | ✅ | ✅ |⚠️ EULA|
|
|
31
|
+
|Official [Arduino IDE](https://www.arduino.cc/en/main/software) | ❌ | ⚠️ Manually | ❌ |N/A 😉| ✅ | ✅ | ✅ |Free (GPLv2)|
|
|
22
32
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
33
|
+
|
|
34
|
+
## Quick Start
|
|
35
|
+
|
|
36
|
+
For a bare-bones example that you can copy from, see [SampleProjects/DoSomething](SampleProjects/DoSomething).
|
|
37
|
+
|
|
38
|
+
The complete set of C++ unit tests for the `arduino_ci` library itself are in the [SampleProjects/TestSomething](SampleProjects/TestSomething) project. The [test files](SampleProjects/TestSomething/test/) are named after the type of feature being tested.
|
|
39
|
+
|
|
40
|
+
> Arduino expects all libraries to be in a specific `Arduino/libraries` directory on your system. If your library is elsewhere, `arduino_ci` will _automatically_ create a symbolic link in the `libraries` directory that points to the directory of the project being tested. This simplifieds working with project dependencies, but **it can have unintended consequences on Windows systems** because [in some cases deleting a folder that contains a symbolic link to another folder can cause the _entire linked folder_ to be removed instead of just the link itself](https://superuser.com/a/306618).
|
|
41
|
+
>
|
|
42
|
+
> If you use a Windows system **it is recommended that you only run `arduino_ci` from project directories that are already inside the `libraries` directory**
|
|
43
|
+
|
|
44
|
+
### You Need Ruby and Bundler
|
|
45
|
+
|
|
46
|
+
You'll need Ruby version 2.2 or higher, and to `gem install bundler` if it's not already there.
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### You Need A Compiler (`g++`)
|
|
50
|
+
|
|
51
|
+
For unit testing, you will need a compiler; [g++](https://gcc.gnu.org/) is preferred.
|
|
52
|
+
|
|
53
|
+
* **Linux**: `gcc`/`g++` is likely pre-installed.
|
|
54
|
+
* **OSX**: `g++` is an alias for `clang`, which is provided by Xcode and the developer tools. You are free to `brew install gcc` as well; this is also tested and working.
|
|
55
|
+
* **Windows**: you will need Cygwin, and the `mingw-gcc-g++` package. A full set of (working) install instructions can be found in `appveyor.yml`, as this is how CI runs for this project.
|
|
26
56
|
|
|
27
57
|
|
|
28
58
|
### Changes to Your Repo
|
|
@@ -34,7 +64,93 @@ source 'https://rubygems.org'
|
|
|
34
64
|
gem 'arduino_ci'
|
|
35
65
|
```
|
|
36
66
|
|
|
37
|
-
|
|
67
|
+
It would also make sense to add the following to your `.gitignore`, or copy [the `.gitignore` used by this project](.gitignore):
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
/.bundle/
|
|
71
|
+
/.yardoc
|
|
72
|
+
Gemfile.lock
|
|
73
|
+
/_yardoc/
|
|
74
|
+
/coverage/
|
|
75
|
+
/doc/
|
|
76
|
+
/pkg/
|
|
77
|
+
/spec/reports/
|
|
78
|
+
vendor
|
|
79
|
+
*.gem
|
|
80
|
+
|
|
81
|
+
# rspec failure tracking
|
|
82
|
+
.rspec_status
|
|
83
|
+
|
|
84
|
+
# C++ stuff
|
|
85
|
+
*.bin
|
|
86
|
+
*.bin.dSYM
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
### Installing the Dependencies
|
|
91
|
+
|
|
92
|
+
Fulfilling the `arduino_ci` library dependency is as easy as running either of these two commands:
|
|
93
|
+
```
|
|
94
|
+
$ bundle install # adds packages to global library (may require admin rights)
|
|
95
|
+
$ bundle install --path vendor/bundle # adds packages to local library
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
### Running tests
|
|
100
|
+
|
|
101
|
+
With that installed, just the following shell command each time you want the tests to execute:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
$ bundle exec arduino_ci.rb
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`arduino_ci.rb` is the main entry point for this library. This command will iterate over all the library's `examples/` and attempt to compile them. If you set up unit tests, it will run those as well.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Reference
|
|
111
|
+
|
|
112
|
+
For more information on the usage of `arduino_ci.rb`, see [REFERENCE.md](REFERENCE.md). It contains information such as:
|
|
113
|
+
|
|
114
|
+
* How to configure build options (platforms to test, Arduino library dependencies to install) with an `.arduino-ci.yml` file
|
|
115
|
+
* Where to put unit test files
|
|
116
|
+
* How to structure unit test files
|
|
117
|
+
* How to control the global (physical) state of the Arduino board
|
|
118
|
+
* How to modify the Arduino platforms, compilers, test plans, etc
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## Setting up Pull Request Testing and/or External CI
|
|
122
|
+
|
|
123
|
+
The following prerequisites must be fulfilled:
|
|
124
|
+
|
|
125
|
+
* A GitHub (or other repository-hosting) project for your library
|
|
126
|
+
* A CI system like [Travis CI](https://travis-ci.org/) or [Appveyor](https://www.appveyor.com/) that is linked to your project
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
### Testing with remote CI
|
|
130
|
+
|
|
131
|
+
> **Note:** `arduino_ci.rb` expects to be run from the root directory of your Arduino project library.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
#### GitHub Actions
|
|
135
|
+
|
|
136
|
+
GitHub Actions allows you to automate your workflows directly in GitHub.
|
|
137
|
+
No additional steps are needed.
|
|
138
|
+
Just create a YAML file with the information below in your repo under the `.github/workflows/` directory.
|
|
139
|
+
|
|
140
|
+
```yaml
|
|
141
|
+
on: [push, pull_request]
|
|
142
|
+
jobs:
|
|
143
|
+
runTest:
|
|
144
|
+
runs-on: ubuntu-latest
|
|
145
|
+
steps:
|
|
146
|
+
- uses: actions/checkout@v2
|
|
147
|
+
- uses: ruby/setup-ruby@v1
|
|
148
|
+
with:
|
|
149
|
+
ruby-version: 2.6
|
|
150
|
+
- run: |
|
|
151
|
+
bundle install
|
|
152
|
+
bundle exec arduino_ci_remote.rb
|
|
153
|
+
```
|
|
38
154
|
|
|
39
155
|
|
|
40
156
|
#### Travis CI
|
|
@@ -47,10 +163,11 @@ Next, you need this in `.travis.yml` in your repo
|
|
|
47
163
|
sudo: false
|
|
48
164
|
language: ruby
|
|
49
165
|
script:
|
|
50
|
-
|
|
51
|
-
|
|
166
|
+
- bundle install
|
|
167
|
+
- bundle exec arduino_ci.rb
|
|
52
168
|
```
|
|
53
169
|
|
|
170
|
+
|
|
54
171
|
#### Appveyor CI
|
|
55
172
|
|
|
56
173
|
You'll need to go to https://ci.appveyor.com/projects and add your project.
|
|
@@ -61,40 +178,17 @@ Next, you'll need this in `appveyor.yml` in your repo.
|
|
|
61
178
|
build: off
|
|
62
179
|
test_script:
|
|
63
180
|
- bundle install
|
|
64
|
-
- bundle exec
|
|
181
|
+
- bundle exec arduino_ci.rb
|
|
65
182
|
```
|
|
66
183
|
|
|
67
|
-
## Quick Start
|
|
68
|
-
|
|
69
|
-
This software is in beta. But [SampleProjects/DoSomething](SampleProjects/DoSomething) has a decent writeup and is a good bare-bones example of all the features.
|
|
70
|
-
|
|
71
|
-
## Reference
|
|
72
|
-
|
|
73
|
-
For more information on the usage of `arduino_ci`, see [REFERENCE.md](REFERENCE.md). It contains information such as:
|
|
74
|
-
|
|
75
|
-
* Where to put unit test files
|
|
76
|
-
* How to structure unit test files
|
|
77
|
-
* How to control the global (physical) state of the Arduino board
|
|
78
|
-
* How to modify the Arduino platforms, compilers, test plans, etc
|
|
79
|
-
|
|
80
184
|
|
|
81
185
|
## Known Problems
|
|
82
186
|
|
|
83
187
|
* The Arduino library is not fully mocked.
|
|
84
188
|
* I don't have preprocessor defines for all the Arduino board flavors
|
|
85
|
-
* https://github.com/
|
|
189
|
+
* https://github.com/Arduino-CI/arduino_ci/issues
|
|
86
190
|
|
|
87
191
|
|
|
88
|
-
## Comparison to Other Arduino Testing Tools
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
| Project | CI | Builds Examples | Unittest | Arduino Mocks | Windows | OSX | Linux | License |
|
|
92
|
-
|---------|----|-----------------|----------|---------------|---------|-----|-------|---------|
|
|
93
|
-
|[ArduinoCI](https://github.com/ianfixes/arduino_ci)| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |Free (Apache-2.0)|
|
|
94
|
-
|[ArduinoUnit](https://github.com/mmurdoch/arduinounit)|❌ |❌ |Hardware-based|❌ | ✅ | ✅ | ✅ |Free (MIT)| |
|
|
95
|
-
|[Adafruit `travis-ci-arduino`](https://github.com/adafruit/travis-ci-arduino) | ✅ | ✅ | ❌| ❌ | ❌ | ❌ | ✅ |Free (MIT)|
|
|
96
|
-
|[PlatformIO](https://platformio.org)| ✅ | ✅ | Paid only | ❌ | ✅ | ✅ | ✅ |Proprietary (EULA)|
|
|
97
|
-
|
|
98
192
|
## Author
|
|
99
193
|
|
|
100
194
|
This gem was written by Ian Katz (ianfixes@gmail.com) in 2018. It's released under the Apache 2.0 license.
|
|
@@ -103,6 +197,5 @@ This gem was written by Ian Katz (ianfixes@gmail.com) in 2018. It's released un
|
|
|
103
197
|
## See Also
|
|
104
198
|
|
|
105
199
|
* [Contributing](CONTRIBUTING.md)
|
|
106
|
-
* [Adafruit/
|
|
200
|
+
* [Adafruit/ci-arduino](https://github.com/adafruit/ci-arduino) which inspired this project
|
|
107
201
|
* [mmurdoch/arduinounit](https://github.com/mmurdoch/arduinounit) from which the unit test macros were adopted
|
|
108
|
-
|