arduino_ci 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +203 -4
- data/cpp/arduino/Arduino.cpp +0 -21
- data/cpp/arduino/Arduino.h +0 -10
- data/cpp/arduino/ArduinoDefines.h +0 -1
- data/cpp/arduino/AvrMath.h +5 -6
- data/cpp/arduino/Godmode.cpp +26 -0
- data/cpp/arduino/Godmode.h +41 -19
- data/cpp/arduino/HardwareSerial.h +7 -3
- data/cpp/arduino/PinHistory.h +160 -0
- data/cpp/arduino/Print.h +4 -2
- data/cpp/arduino/SoftwareSerial.h +77 -0
- data/cpp/arduino/Stream.h +4 -1
- data/cpp/arduino/WString.h +15 -9
- data/cpp/arduino/{include → avr}/README.md +0 -0
- data/cpp/arduino/{include → avr}/common.h +0 -0
- data/cpp/arduino/{include → avr}/fuse.h +0 -0
- data/cpp/arduino/{include → avr}/io.h +0 -0
- data/cpp/arduino/{include → avr}/io1200.h +0 -0
- data/cpp/arduino/{include → avr}/io2313.h +0 -0
- data/cpp/arduino/{include → avr}/io2323.h +0 -0
- data/cpp/arduino/{include → avr}/io2333.h +0 -0
- data/cpp/arduino/{include → avr}/io2343.h +0 -0
- data/cpp/arduino/{include → avr}/io43u32x.h +0 -0
- data/cpp/arduino/{include → avr}/io43u35x.h +0 -0
- data/cpp/arduino/{include → avr}/io4414.h +0 -0
- data/cpp/arduino/{include → avr}/io4433.h +0 -0
- data/cpp/arduino/{include → avr}/io4434.h +0 -0
- data/cpp/arduino/{include → avr}/io76c711.h +0 -0
- data/cpp/arduino/{include → avr}/io8515.h +0 -0
- data/cpp/arduino/{include → avr}/io8534.h +0 -0
- data/cpp/arduino/{include → avr}/io8535.h +0 -0
- data/cpp/arduino/{include → avr}/io86r401.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwm1.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwm161.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwm216.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwm2b.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwm316.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwm3b.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwm81.h +0 -0
- data/cpp/arduino/{include → avr}/io90pwmx.h +0 -0
- data/cpp/arduino/{include → avr}/io90scr100.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5272.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5505.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5702m322.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5782.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5790.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5790n.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5791.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5795.h +0 -0
- data/cpp/arduino/{include → avr}/ioa5831.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6285.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6286.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6289.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6612c.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6613c.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6614q.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6616c.h +0 -0
- data/cpp/arduino/{include → avr}/ioa6617c.h +0 -0
- data/cpp/arduino/{include → avr}/ioa664251.h +0 -0
- data/cpp/arduino/{include → avr}/ioa8210.h +0 -0
- data/cpp/arduino/{include → avr}/ioa8510.h +0 -0
- data/cpp/arduino/{include → avr}/ioat94k.h +0 -0
- data/cpp/arduino/{include → avr}/iocan128.h +0 -0
- data/cpp/arduino/{include → avr}/iocan32.h +0 -0
- data/cpp/arduino/{include → avr}/iocan64.h +0 -0
- data/cpp/arduino/{include → avr}/iocanxx.h +0 -0
- data/cpp/arduino/{include → avr}/iom103.h +0 -0
- data/cpp/arduino/{include → avr}/iom128.h +0 -0
- data/cpp/arduino/{include → avr}/iom1280.h +0 -0
- data/cpp/arduino/{include → avr}/iom1281.h +0 -0
- data/cpp/arduino/{include → avr}/iom1284.h +0 -0
- data/cpp/arduino/{include → avr}/iom1284p.h +0 -0
- data/cpp/arduino/{include → avr}/iom1284rfr2.h +0 -0
- data/cpp/arduino/{include → avr}/iom128a.h +0 -0
- data/cpp/arduino/{include → avr}/iom128rfa1.h +0 -0
- data/cpp/arduino/{include → avr}/iom128rfr2.h +0 -0
- data/cpp/arduino/{include → avr}/iom16.h +0 -0
- data/cpp/arduino/{include → avr}/iom161.h +0 -0
- data/cpp/arduino/{include → avr}/iom162.h +0 -0
- data/cpp/arduino/{include → avr}/iom163.h +0 -0
- data/cpp/arduino/{include → avr}/iom164.h +0 -0
- data/cpp/arduino/{include → avr}/iom164a.h +0 -0
- data/cpp/arduino/{include → avr}/iom164p.h +0 -0
- data/cpp/arduino/{include → avr}/iom164pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom165.h +0 -0
- data/cpp/arduino/{include → avr}/iom165a.h +0 -0
- data/cpp/arduino/{include → avr}/iom165p.h +0 -0
- data/cpp/arduino/{include → avr}/iom165pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom168.h +0 -0
- data/cpp/arduino/{include → avr}/iom168a.h +0 -0
- data/cpp/arduino/{include → avr}/iom168p.h +0 -0
- data/cpp/arduino/{include → avr}/iom168pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom168pb.h +0 -0
- data/cpp/arduino/{include → avr}/iom169.h +0 -0
- data/cpp/arduino/{include → avr}/iom169a.h +0 -0
- data/cpp/arduino/{include → avr}/iom169p.h +0 -0
- data/cpp/arduino/{include → avr}/iom169pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom16a.h +0 -0
- data/cpp/arduino/{include → avr}/iom16hva.h +0 -0
- data/cpp/arduino/{include → avr}/iom16hva2.h +0 -0
- data/cpp/arduino/{include → avr}/iom16hvb.h +0 -0
- data/cpp/arduino/{include → avr}/iom16hvbrevb.h +0 -0
- data/cpp/arduino/{include → avr}/iom16m1.h +0 -0
- data/cpp/arduino/{include → avr}/iom16u2.h +0 -0
- data/cpp/arduino/{include → avr}/iom16u4.h +0 -0
- data/cpp/arduino/{include → avr}/iom2560.h +0 -0
- data/cpp/arduino/{include → avr}/iom2561.h +0 -0
- data/cpp/arduino/{include → avr}/iom2564rfr2.h +0 -0
- data/cpp/arduino/{include → avr}/iom256rfr2.h +0 -0
- data/cpp/arduino/{include → avr}/iom3000.h +0 -0
- data/cpp/arduino/{include → avr}/iom32.h +0 -0
- data/cpp/arduino/{include → avr}/iom323.h +0 -0
- data/cpp/arduino/{include → avr}/iom324a.h +0 -0
- data/cpp/arduino/{include → avr}/iom324p.h +0 -0
- data/cpp/arduino/{include → avr}/iom324pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom325.h +0 -0
- data/cpp/arduino/{include → avr}/iom3250.h +0 -0
- data/cpp/arduino/{include → avr}/iom3250a.h +0 -0
- data/cpp/arduino/{include → avr}/iom3250p.h +0 -0
- data/cpp/arduino/{include → avr}/iom3250pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom325a.h +0 -0
- data/cpp/arduino/{include → avr}/iom325p.h +0 -0
- data/cpp/arduino/{include → avr}/iom325pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom328.h +0 -0
- data/cpp/arduino/{include → avr}/iom328p.h +0 -0
- data/cpp/arduino/{include → avr}/iom329.h +0 -0
- data/cpp/arduino/{include → avr}/iom3290.h +0 -0
- data/cpp/arduino/{include → avr}/iom3290a.h +0 -0
- data/cpp/arduino/{include → avr}/iom3290pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom329a.h +0 -0
- data/cpp/arduino/{include → avr}/iom329p.h +0 -0
- data/cpp/arduino/{include → avr}/iom329pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom32a.h +0 -0
- data/cpp/arduino/{include → avr}/iom32c1.h +0 -0
- data/cpp/arduino/{include → avr}/iom32hvb.h +0 -0
- data/cpp/arduino/{include → avr}/iom32hvbrevb.h +0 -0
- data/cpp/arduino/{include → avr}/iom32m1.h +0 -0
- data/cpp/arduino/{include → avr}/iom32u2.h +0 -0
- data/cpp/arduino/{include → avr}/iom32u4.h +0 -0
- data/cpp/arduino/{include → avr}/iom32u6.h +0 -0
- data/cpp/arduino/{include → avr}/iom406.h +0 -0
- data/cpp/arduino/{include → avr}/iom48.h +0 -0
- data/cpp/arduino/{include → avr}/iom48a.h +0 -0
- data/cpp/arduino/{include → avr}/iom48p.h +0 -0
- data/cpp/arduino/{include → avr}/iom48pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom48pb.h +0 -0
- data/cpp/arduino/{include → avr}/iom64.h +0 -0
- data/cpp/arduino/{include → avr}/iom640.h +0 -0
- data/cpp/arduino/{include → avr}/iom644.h +0 -0
- data/cpp/arduino/{include → avr}/iom644a.h +0 -0
- data/cpp/arduino/{include → avr}/iom644p.h +0 -0
- data/cpp/arduino/{include → avr}/iom644pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom644rfr2.h +0 -0
- data/cpp/arduino/{include → avr}/iom645.h +0 -0
- data/cpp/arduino/{include → avr}/iom6450.h +0 -0
- data/cpp/arduino/{include → avr}/iom6450a.h +0 -0
- data/cpp/arduino/{include → avr}/iom6450p.h +0 -0
- data/cpp/arduino/{include → avr}/iom645a.h +0 -0
- data/cpp/arduino/{include → avr}/iom645p.h +0 -0
- data/cpp/arduino/{include → avr}/iom649.h +0 -0
- data/cpp/arduino/{include → avr}/iom6490.h +0 -0
- data/cpp/arduino/{include → avr}/iom6490a.h +0 -0
- data/cpp/arduino/{include → avr}/iom6490p.h +0 -0
- data/cpp/arduino/{include → avr}/iom649a.h +0 -0
- data/cpp/arduino/{include → avr}/iom649p.h +0 -0
- data/cpp/arduino/{include → avr}/iom64a.h +0 -0
- data/cpp/arduino/{include → avr}/iom64c1.h +0 -0
- data/cpp/arduino/{include → avr}/iom64hve.h +0 -0
- data/cpp/arduino/{include → avr}/iom64hve2.h +0 -0
- data/cpp/arduino/{include → avr}/iom64m1.h +0 -0
- data/cpp/arduino/{include → avr}/iom64rfr2.h +0 -0
- data/cpp/arduino/{include → avr}/iom8.h +0 -0
- data/cpp/arduino/{include → avr}/iom8515.h +0 -0
- data/cpp/arduino/{include → avr}/iom8535.h +0 -0
- data/cpp/arduino/{include → avr}/iom88.h +0 -0
- data/cpp/arduino/{include → avr}/iom88a.h +0 -0
- data/cpp/arduino/{include → avr}/iom88p.h +0 -0
- data/cpp/arduino/{include → avr}/iom88pa.h +0 -0
- data/cpp/arduino/{include → avr}/iom88pb.h +0 -0
- data/cpp/arduino/{include → avr}/iom8a.h +0 -0
- data/cpp/arduino/{include → avr}/iom8hva.h +0 -0
- data/cpp/arduino/{include → avr}/iom8u2.h +0 -0
- data/cpp/arduino/{include → avr}/iomx8.h +0 -0
- data/cpp/arduino/{include → avr}/iomxx0_1.h +0 -0
- data/cpp/arduino/{include → avr}/iomxx4.h +0 -0
- data/cpp/arduino/{include → avr}/iomxxhva.h +0 -0
- data/cpp/arduino/{include → avr}/iotn10.h +0 -0
- data/cpp/arduino/{include → avr}/iotn11.h +0 -0
- data/cpp/arduino/{include → avr}/iotn12.h +0 -0
- data/cpp/arduino/{include → avr}/iotn13.h +0 -0
- data/cpp/arduino/{include → avr}/iotn13a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn15.h +0 -0
- data/cpp/arduino/{include → avr}/iotn1634.h +0 -0
- data/cpp/arduino/{include → avr}/iotn167.h +0 -0
- data/cpp/arduino/{include → avr}/iotn20.h +0 -0
- data/cpp/arduino/{include → avr}/iotn22.h +0 -0
- data/cpp/arduino/{include → avr}/iotn2313.h +0 -0
- data/cpp/arduino/{include → avr}/iotn2313a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn24.h +0 -0
- data/cpp/arduino/{include → avr}/iotn24a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn25.h +0 -0
- data/cpp/arduino/{include → avr}/iotn26.h +0 -0
- data/cpp/arduino/{include → avr}/iotn261.h +0 -0
- data/cpp/arduino/{include → avr}/iotn261a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn28.h +0 -0
- data/cpp/arduino/{include → avr}/iotn4.h +0 -0
- data/cpp/arduino/{include → avr}/iotn40.h +0 -0
- data/cpp/arduino/{include → avr}/iotn4313.h +0 -0
- data/cpp/arduino/{include → avr}/iotn43u.h +0 -0
- data/cpp/arduino/{include → avr}/iotn44.h +0 -0
- data/cpp/arduino/{include → avr}/iotn441.h +0 -0
- data/cpp/arduino/{include → avr}/iotn44a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn45.h +0 -0
- data/cpp/arduino/{include → avr}/iotn461.h +0 -0
- data/cpp/arduino/{include → avr}/iotn461a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn48.h +0 -0
- data/cpp/arduino/{include → avr}/iotn5.h +0 -0
- data/cpp/arduino/{include → avr}/iotn828.h +0 -0
- data/cpp/arduino/{include → avr}/iotn84.h +0 -0
- data/cpp/arduino/{include → avr}/iotn841.h +0 -0
- data/cpp/arduino/{include → avr}/iotn84a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn85.h +0 -0
- data/cpp/arduino/{include → avr}/iotn861.h +0 -0
- data/cpp/arduino/{include → avr}/iotn861a.h +0 -0
- data/cpp/arduino/{include → avr}/iotn87.h +0 -0
- data/cpp/arduino/{include → avr}/iotn88.h +0 -0
- data/cpp/arduino/{include → avr}/iotn9.h +0 -0
- data/cpp/arduino/{include → avr}/iotnx4.h +0 -0
- data/cpp/arduino/{include → avr}/iotnx5.h +0 -0
- data/cpp/arduino/{include → avr}/iotnx61.h +0 -0
- data/cpp/arduino/{include → avr}/iousb1286.h +0 -0
- data/cpp/arduino/{include → avr}/iousb1287.h +0 -0
- data/cpp/arduino/{include → avr}/iousb162.h +0 -0
- data/cpp/arduino/{include → avr}/iousb646.h +0 -0
- data/cpp/arduino/{include → avr}/iousb647.h +0 -0
- data/cpp/arduino/{include → avr}/iousb82.h +0 -0
- data/cpp/arduino/{include → avr}/iousbxx2.h +0 -0
- data/cpp/arduino/{include → avr}/iousbxx6_7.h +0 -0
- data/cpp/arduino/{include → avr}/iox128a1.h +0 -0
- data/cpp/arduino/{include → avr}/iox128a1u.h +0 -0
- data/cpp/arduino/{include → avr}/iox128a3.h +0 -0
- data/cpp/arduino/{include → avr}/iox128a3u.h +0 -0
- data/cpp/arduino/{include → avr}/iox128a4u.h +0 -0
- data/cpp/arduino/{include → avr}/iox128b1.h +0 -0
- data/cpp/arduino/{include → avr}/iox128b3.h +0 -0
- data/cpp/arduino/{include → avr}/iox128c3.h +0 -0
- data/cpp/arduino/{include → avr}/iox128d3.h +0 -0
- data/cpp/arduino/{include → avr}/iox128d4.h +0 -0
- data/cpp/arduino/{include → avr}/iox16a4.h +0 -0
- data/cpp/arduino/{include → avr}/iox16a4u.h +0 -0
- data/cpp/arduino/{include → avr}/iox16c4.h +0 -0
- data/cpp/arduino/{include → avr}/iox16d4.h +0 -0
- data/cpp/arduino/{include → avr}/iox16e5.h +0 -0
- data/cpp/arduino/{include → avr}/iox192a3.h +0 -0
- data/cpp/arduino/{include → avr}/iox192a3u.h +0 -0
- data/cpp/arduino/{include → avr}/iox192c3.h +0 -0
- data/cpp/arduino/{include → avr}/iox192d3.h +0 -0
- data/cpp/arduino/{include → avr}/iox256a3.h +0 -0
- data/cpp/arduino/{include → avr}/iox256a3b.h +0 -0
- data/cpp/arduino/{include → avr}/iox256a3bu.h +0 -0
- data/cpp/arduino/{include → avr}/iox256a3u.h +0 -0
- data/cpp/arduino/{include → avr}/iox256c3.h +0 -0
- data/cpp/arduino/{include → avr}/iox256d3.h +0 -0
- data/cpp/arduino/{include → avr}/iox32a4.h +0 -0
- data/cpp/arduino/{include → avr}/iox32a4u.h +0 -0
- data/cpp/arduino/{include → avr}/iox32c3.h +0 -0
- data/cpp/arduino/{include → avr}/iox32c4.h +0 -0
- data/cpp/arduino/{include → avr}/iox32d3.h +0 -0
- data/cpp/arduino/{include → avr}/iox32d4.h +0 -0
- data/cpp/arduino/{include → avr}/iox32e5.h +0 -0
- data/cpp/arduino/{include → avr}/iox384c3.h +0 -0
- data/cpp/arduino/{include → avr}/iox384d3.h +0 -0
- data/cpp/arduino/{include → avr}/iox64a1.h +0 -0
- data/cpp/arduino/{include → avr}/iox64a1u.h +0 -0
- data/cpp/arduino/{include → avr}/iox64a3.h +0 -0
- data/cpp/arduino/{include → avr}/iox64a3u.h +0 -0
- data/cpp/arduino/{include → avr}/iox64a4u.h +0 -0
- data/cpp/arduino/{include → avr}/iox64b1.h +0 -0
- data/cpp/arduino/{include → avr}/iox64b3.h +0 -0
- data/cpp/arduino/{include → avr}/iox64c3.h +0 -0
- data/cpp/arduino/{include → avr}/iox64d3.h +0 -0
- data/cpp/arduino/{include → avr}/iox64d4.h +0 -0
- data/cpp/arduino/{include → avr}/iox8e5.h +0 -0
- data/cpp/arduino/{include → avr}/lock.h +0 -0
- data/cpp/arduino/avr/pgmspace.h +94 -0
- data/cpp/arduino/{include → avr}/portpins.h +0 -0
- data/cpp/arduino/{include → avr}/version.h +0 -0
- data/cpp/arduino/{include → avr}/xmega.h +0 -0
- data/cpp/arduino/binary.h +1 -0
- data/cpp/arduino/ci/DeviceUsingBytes.h +56 -0
- data/cpp/arduino/ci/ObservableDataStream.h +124 -0
- data/cpp/arduino/ci/Queue.h +73 -0
- data/cpp/arduino/ci/README.md +5 -0
- data/cpp/arduino/ci/Table.h +125 -0
- data/cpp/unittest/ArduinoUnitTests.h +16 -16
- data/cpp/unittest/Assertion.h +2 -2
- data/cpp/unittest/Compare.h +1 -1
- data/exe/arduino_ci_remote.rb +34 -21
- data/lib/arduino_ci/arduino_cmd.rb +1 -0
- data/lib/arduino_ci/arduino_installation.rb +13 -19
- data/lib/arduino_ci/ci_config.rb +42 -10
- data/lib/arduino_ci/cpp_library.rb +6 -1
- data/lib/arduino_ci/version.rb +1 -1
- data/misc/{default.yaml → default.yml} +0 -0
- metadata +285 -277
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1553aff5cd187c7db5ea325fd2ee878914fae57692d70042f1ceb0a6cd184f18
|
4
|
+
data.tar.gz: 8c948d1eec2967ee364fc2fa983bed1746dc1204089d2ea0f355ab27b0aa97f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43bbc201c5d38e8852a71e3a0b4da85400d764fc2e4b248e0fd14f6d79c1111c4bc778aecdc7e49bea8c7c73e4417b28f4ae9d3e5c3ba4814768929bf5ae2c7b
|
7
|
+
data.tar.gz: '069ce22a67dc335c5b1d97bdecc91476bf8f6484740b9acfd063e4c2741db0cfa808c5b5599dce970721f2d808825ebf0297857e88fe7a75bfa2611a4cda23bf'
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/arduino_ci.svg)](https://rubygems.org/gems/arduino_ci)
|
2
2
|
[![Build Status](https://travis-ci.org/ifreecarve/arduino_ci.svg)](https://travis-ci.org/ifreecarve/arduino_ci)
|
3
|
-
[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/arduino_ci/0.1.
|
3
|
+
[![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/arduino_ci/0.1.5)
|
4
4
|
|
5
5
|
# ArduinoCI Ruby gem (`arduino_ci`)
|
6
6
|
|
@@ -28,6 +28,8 @@ script:
|
|
28
28
|
|
29
29
|
That's literally all there is to it on the repository side. You'll need to go to https://travis-ci.org/profile/ and enable testing for your Arduino project. Once that happens, you should be all set. The script will test all example projects of the library and all unit tests.
|
30
30
|
|
31
|
+
> **Note:** `arduino_ci_remote.rb` expects to be run from the root directory of your Arduino project library.
|
32
|
+
|
31
33
|
### Unit tests in `test/`
|
32
34
|
|
33
35
|
All `.cpp` files in the `test/` directory of your Arduino library are assumed to contain unit tests. Each and every one will be compiled and executed on its own.
|
@@ -61,13 +63,85 @@ unittest(example_godmode_stuff)
|
|
61
63
|
state->resetClock(); // - you can reset just the clock (to zero)
|
62
64
|
state->resetPins(); // - or just the pins
|
63
65
|
state->micros = 1; // manually set the clock such that micros() returns 1
|
64
|
-
state->digitalPin[4]; //
|
66
|
+
state->digitalPin[4]; // tells you the commanded state of digital pin 4
|
65
67
|
state->digitalPin[4] = HIGH; // digitalRead(4) will now return HIGH
|
66
|
-
state->analogPin[3]; //
|
68
|
+
state->analogPin[3]; // tells you the commanded state of analog pin 3
|
67
69
|
state->analogPin[3] = 99; // analogRead(3) will now return 99
|
68
70
|
}
|
69
71
|
```
|
70
72
|
|
73
|
+
#### Pin Histories
|
74
|
+
|
75
|
+
Of course, it's possible that your code might flip the bit more than once in a function. For that scenario, you may want to examine the history of a pin's commanded outputs:
|
76
|
+
|
77
|
+
```C++
|
78
|
+
unittest(pin_history)
|
79
|
+
{
|
80
|
+
GodmodeState* state = GODMODE();
|
81
|
+
int myPin = 3;
|
82
|
+
state->reset(); // pin will start LOW
|
83
|
+
digitalWrite(myPin, HIGH);
|
84
|
+
digitalWrite(myPin, LOW);
|
85
|
+
digitalWrite(myPin, LOW);
|
86
|
+
digitalWrite(myPin, HIGH);
|
87
|
+
digitalWrite(myPin, HIGH);
|
88
|
+
|
89
|
+
assertEqual(6, state->digitalPin[1].size());
|
90
|
+
bool expected[6] = {LOW, HIGH, LOW, LOW, HIGH, HIGH};
|
91
|
+
bool actual[6];
|
92
|
+
|
93
|
+
// move history queue into an array because at the moment, reading
|
94
|
+
// the history is destructive -- it's a linked-list queue. this
|
95
|
+
// means that if toArray or hasElements fails, the queue will be in
|
96
|
+
// an unknown state and you should reset it before continuing with
|
97
|
+
// other tests
|
98
|
+
int numMoved = state->digitalPin[myPin].toArray(actual, 6);
|
99
|
+
assertEqual(6, numMoved);
|
100
|
+
|
101
|
+
// verify each element
|
102
|
+
for (int i = 0; i < 6; ++i) {
|
103
|
+
assertEqual(expected[i], actual[i]);
|
104
|
+
}
|
105
|
+
```
|
106
|
+
|
107
|
+
|
108
|
+
#### Pin Futures
|
109
|
+
|
110
|
+
Reading the pin more than once per function is also a possibility. In that case, we want to queue up a few values for the `digitalRead` or `analogRead` to find.
|
111
|
+
|
112
|
+
```C++
|
113
|
+
unittest(pin_read_history)
|
114
|
+
{
|
115
|
+
GodmodeState* state = GODMODE();
|
116
|
+
state->reset();
|
117
|
+
|
118
|
+
int future[6] = {33, 22, 55, 11, 44, 66};
|
119
|
+
state->analogPin[1].fromArray(future, 6);
|
120
|
+
for (int i = 0; i < 6; ++i)
|
121
|
+
{
|
122
|
+
assertEqual(future[i], analogRead(1));
|
123
|
+
}
|
124
|
+
|
125
|
+
// for digital pins, we have the added possibility of specifying
|
126
|
+
// a stream of input bytes encoded as ASCII
|
127
|
+
bool bigEndian = true;
|
128
|
+
state->digitalPin[1].fromAscii("Yo", bigEndian);
|
129
|
+
|
130
|
+
// digitial history as serial data, big-endian
|
131
|
+
bool expectedBits[16] = {
|
132
|
+
0, 1, 0, 1, 1, 0, 0, 1, // Y
|
133
|
+
0, 1, 1, 0, 1, 1, 1, 1 // o
|
134
|
+
};
|
135
|
+
|
136
|
+
for (int i = 0; i < 16; ++i) {
|
137
|
+
assertEqual(expectedBits[i], digitalRead(1));
|
138
|
+
}
|
139
|
+
}
|
140
|
+
```
|
141
|
+
|
142
|
+
#### Serial Data
|
143
|
+
|
144
|
+
|
71
145
|
A more complicated example: working with serial port IO. Let's say I have the following function:
|
72
146
|
|
73
147
|
```C++
|
@@ -125,6 +199,132 @@ unittest(two_flips)
|
|
125
199
|
}
|
126
200
|
```
|
127
201
|
|
202
|
+
#### Pin History as ASCII
|
203
|
+
|
204
|
+
|
205
|
+
For additional complexity, there are some cases where you want to use a pin as a serial port. There are history functions for that too.
|
206
|
+
|
207
|
+
```C++
|
208
|
+
int myPin = 3;
|
209
|
+
|
210
|
+
// digitial history as serial data, big-endian
|
211
|
+
bool bigEndian = true;
|
212
|
+
bool binaryAscii[24] = {
|
213
|
+
0, 1, 0, 1, 1, 0, 0, 1, // Y
|
214
|
+
0, 1, 1, 0, 0, 1, 0, 1, // e
|
215
|
+
0, 1, 1, 1, 0, 0, 1, 1 // s
|
216
|
+
};
|
217
|
+
|
218
|
+
// "send" these bits
|
219
|
+
for (int i = 0; i < 24; digitalWrite(myPin, binaryAscii[i++]));
|
220
|
+
|
221
|
+
// The first bit in the history is the initial value, which we will ignore
|
222
|
+
int offset = 1;
|
223
|
+
|
224
|
+
// We should be able to parse the bits as ascii
|
225
|
+
assertEqual("Yes", state->digitalPin[myPin].toAscii(offset, bigEndian));
|
226
|
+
```
|
227
|
+
|
228
|
+
Instead of queueing bits as ASCII for future use with `toAscii`, you can send those bits directly (and immediately) to the output using `outgoingFromAscii`. Likewise, you can reinterpret/examine (as ASCII) the bits you have previously queued up by calling `incomingToAscii` on the PinHistory object.
|
229
|
+
|
230
|
+
|
231
|
+
#### Interactivity of "Devices" with Observers
|
232
|
+
|
233
|
+
Even pin history and input/output buffers aren't capable of testing interactive code. For example, queueing the canned responses from a serial device before the requests are even sent to it is not a sane test environment; the library under test will see the entire future waiting for it on the input pin instead of a buffer that fills and empties over time. This calls for something more complicated.
|
234
|
+
|
235
|
+
In this example, we create a simple class to emulate a Hayes modem. (For more information, dig into the `DataStreamObserver` code on which `DeviceUsingBytes` is based.
|
236
|
+
|
237
|
+
```c++
|
238
|
+
class FakeHayesModem : public DeviceUsingBytes {
|
239
|
+
public:
|
240
|
+
String mLast;
|
241
|
+
|
242
|
+
FakeHayesModem() : DeviceUsingBytes() {
|
243
|
+
mLast = "";
|
244
|
+
addResponseLine("AT", "OK");
|
245
|
+
addResponseLine("ATV1", "NO CARRIER");
|
246
|
+
}
|
247
|
+
virtual ~FakeHayesModem() {}
|
248
|
+
virtual void onMatchInput(String output) { mLast = output; }
|
249
|
+
};
|
250
|
+
|
251
|
+
unittest(modem_hardware)
|
252
|
+
{
|
253
|
+
GodmodeState* state = GODMODE();
|
254
|
+
state->reset();
|
255
|
+
FakeHayesModem m;
|
256
|
+
m.attach(&Serial);
|
257
|
+
|
258
|
+
Serial.write("AT\n");
|
259
|
+
assertEqual("AT\n", state->serialPort[0].dataOut);
|
260
|
+
assertEqual("OK\n", m.mLast);
|
261
|
+
}
|
262
|
+
```
|
263
|
+
|
264
|
+
Note that instead of setting `mLast = output` in the `onMatchInput()` function for test purposes, we could just as easily queue some bytes to state->serialPort[0].dataIn for the library under test to find on its next `peek()` or `read()`. Or we could execute some action on a digital or analog input pin; the possibilities are fairly endless in this regard, although you will have to define them yourself -- from scratch -- extending the `DataStreamObserver` class to emulate your physical device.
|
265
|
+
|
266
|
+
|
267
|
+
## Overriding default build behavior
|
268
|
+
|
269
|
+
You can add `.arduino-ci.yml` files to the project directory (which will then apply to both `test/` and `examples/`), as well as to the `test/` directory and each example directory in `examples/`. All defined fields can be overridden.
|
270
|
+
|
271
|
+
You may define new platforms, or edit existing platform definitions:
|
272
|
+
|
273
|
+
```yaml
|
274
|
+
platforms:
|
275
|
+
bogo:
|
276
|
+
board: fakeduino:beep:bogo
|
277
|
+
package: potato:salad
|
278
|
+
gcc:
|
279
|
+
features:
|
280
|
+
- omit-frame-pointer # becomes -fomit-frame-pointer flag
|
281
|
+
defines:
|
282
|
+
- HAVE_THING # becomes -DHAVE_THING flag
|
283
|
+
warnings:
|
284
|
+
- no-implicit # becomes -Wno-implicit flag
|
285
|
+
flags:
|
286
|
+
- -foobar # becomes -foobar flag
|
287
|
+
|
288
|
+
zero: ~ # undefines the `zero` board completely
|
289
|
+
|
290
|
+
esp8266: # redefines the existing esp8266
|
291
|
+
board: esp8266:esp8266:booo
|
292
|
+
package: esp8266:esp8266
|
293
|
+
gcc:
|
294
|
+
features:
|
295
|
+
defines:
|
296
|
+
warnings:
|
297
|
+
flags:
|
298
|
+
```
|
299
|
+
|
300
|
+
|
301
|
+
For your example programs, you may set external libraries to be installed and included. You may also choose the platforms on which the compilation will be attempted:
|
302
|
+
|
303
|
+
```yaml
|
304
|
+
compile:
|
305
|
+
libraries:
|
306
|
+
- "Adafruit FONA Library"
|
307
|
+
platforms:
|
308
|
+
- esp8266
|
309
|
+
```
|
310
|
+
|
311
|
+
|
312
|
+
For your unit tests, in addition to setting specific libraries and platforms, you may filter the list of test files that are compiled and tested. This may help speed up targeted testing.
|
313
|
+
|
314
|
+
```yaml
|
315
|
+
unittest:
|
316
|
+
testfiles:
|
317
|
+
select:
|
318
|
+
- "*-*.*"
|
319
|
+
reject:
|
320
|
+
- "sam-squamsh.*"
|
321
|
+
libraries:
|
322
|
+
- "abc123"
|
323
|
+
- "def456"
|
324
|
+
platforms:
|
325
|
+
- bogo
|
326
|
+
```
|
327
|
+
|
128
328
|
## More Documentation
|
129
329
|
|
130
330
|
This software is in alpha. But [SampleProjects/DoSomething](SampleProjects/DoSomething) has a decent writeup and is a good bare-bones example of all the features.
|
@@ -133,7 +333,6 @@ This software is in alpha. But [SampleProjects/DoSomething](SampleProjects/DoSo
|
|
133
333
|
|
134
334
|
* The Arduino library is not fully mocked.
|
135
335
|
* I don't have preprocessor defines for all the Arduino board flavors
|
136
|
-
* Arduino Zero boards don't work in CI. I'm confused.
|
137
336
|
* https://github.com/ifreecarve/arduino_ci/issues
|
138
337
|
|
139
338
|
|
data/cpp/arduino/Arduino.cpp
CHANGED
@@ -1,23 +1,2 @@
|
|
1
|
-
#include "Arduino.h"
|
2
1
|
#include "Godmode.h"
|
3
2
|
|
4
|
-
|
5
|
-
void digitalWrite(unsigned char pin, unsigned char val) {
|
6
|
-
GodmodeState* godmode = GODMODE();
|
7
|
-
godmode->digitalPin[pin] = val;
|
8
|
-
}
|
9
|
-
|
10
|
-
int digitalRead(unsigned char pin) {
|
11
|
-
GodmodeState* godmode = GODMODE();
|
12
|
-
return godmode->digitalPin[pin];
|
13
|
-
}
|
14
|
-
|
15
|
-
int analogRead(unsigned char pin) {
|
16
|
-
GodmodeState* godmode = GODMODE();
|
17
|
-
return godmode->analogPin[pin];
|
18
|
-
}
|
19
|
-
|
20
|
-
void analogWrite(unsigned char pin, int val) {
|
21
|
-
GodmodeState* godmode = GODMODE();
|
22
|
-
godmode->analogPin[pin] = val;
|
23
|
-
}
|
data/cpp/arduino/Arduino.h
CHANGED
@@ -57,16 +57,6 @@ typedef unsigned int word;
|
|
57
57
|
|
58
58
|
#define bit(b) (1UL << (b))
|
59
59
|
|
60
|
-
// io pins
|
61
|
-
#define pinMode(...) _NOP()
|
62
|
-
#define analogReference(...) _NOP()
|
63
|
-
|
64
|
-
void digitalWrite(uint8_t, uint8_t);
|
65
|
-
int digitalRead(uint8_t);
|
66
|
-
int analogRead(uint8_t);
|
67
|
-
void analogWrite(uint8_t, int);
|
68
|
-
#define analogReadResolution(...) _NOP()
|
69
|
-
#define analogWriteResolution(...) _NOP()
|
70
60
|
|
71
61
|
|
72
62
|
/*
|
data/cpp/arduino/AvrMath.h
CHANGED
@@ -4,6 +4,11 @@
|
|
4
4
|
#define constrain(x,l,h) ((x)<(l)?(l):((x)>(h)?(h):(x)))
|
5
5
|
#define map(x,inMin,inMax,outMin,outMax) (((x)-(inMin))*((outMax)-(outMin))/((inMax)-(inMin))+outMin)
|
6
6
|
|
7
|
+
#define sq(x) ((x)*(x))
|
8
|
+
|
9
|
+
#define radians(deg) ((deg)*DEG_TO_RAD)
|
10
|
+
#define degrees(rad) ((rad)*RAD_TO_DEG)
|
11
|
+
|
7
12
|
#ifdef abs
|
8
13
|
#undef abs
|
9
14
|
#endif
|
@@ -19,9 +24,3 @@
|
|
19
24
|
#endif
|
20
25
|
#define min(a,b) ((a)<(b)?(a):(b))
|
21
26
|
|
22
|
-
#define sq(x) ((x)*(x))
|
23
|
-
|
24
|
-
#define radians(deg) ((deg)*DEG_TO_RAD)
|
25
|
-
#define degrees(rad) ((rad)*RAD_TO_DEG)
|
26
|
-
|
27
|
-
|
data/cpp/arduino/Godmode.cpp
CHANGED
@@ -46,6 +46,27 @@ long random(long vmin, long vmax)
|
|
46
46
|
return vmin < vmax ? (random(vmax - vmin) + vmin) : vmin;
|
47
47
|
}
|
48
48
|
|
49
|
+
void digitalWrite(unsigned char pin, unsigned char val) {
|
50
|
+
GodmodeState* godmode = GODMODE();
|
51
|
+
godmode->digitalPin[pin] = val;
|
52
|
+
}
|
53
|
+
|
54
|
+
int digitalRead(unsigned char pin) {
|
55
|
+
GodmodeState* godmode = GODMODE();
|
56
|
+
return godmode->digitalPin[pin].retrieve();
|
57
|
+
}
|
58
|
+
|
59
|
+
void analogWrite(unsigned char pin, int val) {
|
60
|
+
GodmodeState* godmode = GODMODE();
|
61
|
+
godmode->analogPin[pin] = val;
|
62
|
+
}
|
63
|
+
|
64
|
+
int analogRead(unsigned char pin) {
|
65
|
+
GodmodeState* godmode = GODMODE();
|
66
|
+
return godmode->analogPin[pin].retrieve();
|
67
|
+
}
|
68
|
+
|
69
|
+
|
49
70
|
// Serial ports
|
50
71
|
#if defined(HAVE_HWSERIAL0)
|
51
72
|
HardwareSerial Serial(&godmode.serialPort[0].dataIn, &godmode.serialPort[0].dataOut, &godmode.serialPort[0].readDelayMicros);
|
@@ -60,3 +81,8 @@ long random(long vmin, long vmax)
|
|
60
81
|
HardwareSerial Serial3(&godmode.serialPort[3].dataIn, &godmode.serialPort[3].dataOut, &godmode.serialPort[3].readDelayMicros);
|
61
82
|
#endif
|
62
83
|
|
84
|
+
template <typename T>
|
85
|
+
inline std::ostream& operator << ( std::ostream& out, const PinHistory<T>& ph ) {
|
86
|
+
out << ph;
|
87
|
+
return out;
|
88
|
+
}
|
data/cpp/arduino/Godmode.h
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
#pragma once
|
2
2
|
#include "ArduinoDefines.h"
|
3
|
+
#include <avr/io.h>
|
3
4
|
#include "WString.h"
|
5
|
+
#include "PinHistory.h"
|
6
|
+
|
7
|
+
// random
|
8
|
+
void randomSeed(unsigned long seed);
|
9
|
+
long random(long vmax);
|
10
|
+
long random(long vmin, long vmax);
|
11
|
+
|
12
|
+
|
13
|
+
// Time
|
14
|
+
void delay(unsigned long millis);
|
15
|
+
void delayMicroseconds(unsigned long micros);
|
16
|
+
unsigned long millis();
|
17
|
+
unsigned long micros();
|
18
|
+
|
4
19
|
|
5
20
|
#define MOCK_PINS_COUNT 256
|
6
21
|
|
@@ -16,7 +31,6 @@
|
|
16
31
|
#define NUM_SERIAL_PORTS 0
|
17
32
|
#endif
|
18
33
|
|
19
|
-
|
20
34
|
class GodmodeState {
|
21
35
|
struct PortDef {
|
22
36
|
String dataIn;
|
@@ -28,14 +42,14 @@ class GodmodeState {
|
|
28
42
|
unsigned long micros;
|
29
43
|
unsigned long seed;
|
30
44
|
// not going to put pinmode here unless its really needed. can't think of why it would be
|
31
|
-
bool digitalPin[MOCK_PINS_COUNT];
|
32
|
-
int analogPin[MOCK_PINS_COUNT];
|
45
|
+
PinHistory<bool> digitalPin[MOCK_PINS_COUNT];
|
46
|
+
PinHistory<int> analogPin[MOCK_PINS_COUNT];
|
33
47
|
struct PortDef serialPort[NUM_SERIAL_PORTS];
|
34
48
|
|
35
49
|
void resetPins() {
|
36
50
|
for (int i = 0; i < MOCK_PINS_COUNT; ++i) {
|
37
|
-
digitalPin[i]
|
38
|
-
analogPin[i]
|
51
|
+
digitalPin[i].reset(LOW);
|
52
|
+
analogPin[i].reset(0);
|
39
53
|
}
|
40
54
|
}
|
41
55
|
|
@@ -49,26 +63,34 @@ class GodmodeState {
|
|
49
63
|
seed = 1;
|
50
64
|
}
|
51
65
|
|
52
|
-
|
66
|
+
int serialPorts() {
|
67
|
+
return NUM_SERIAL_PORTS;
|
68
|
+
}
|
69
|
+
|
70
|
+
GodmodeState()
|
71
|
+
{
|
53
72
|
reset();
|
54
|
-
for (int i = 0; i <
|
55
|
-
|
73
|
+
for (int i = 0; i < serialPorts(); ++i)
|
74
|
+
{
|
75
|
+
serialPort[i].dataIn = "";
|
76
|
+
serialPort[i].dataOut = "";
|
77
|
+
serialPort[i].readDelayMicros = 0;
|
56
78
|
}
|
57
|
-
|
79
|
+
}
|
58
80
|
|
59
81
|
};
|
60
82
|
|
61
|
-
|
83
|
+
// io pins
|
84
|
+
#define pinMode(...) _NOP()
|
85
|
+
#define analogReference(...) _NOP()
|
62
86
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
87
|
+
void digitalWrite(uint8_t, uint8_t);
|
88
|
+
int digitalRead(uint8_t);
|
89
|
+
int analogRead(uint8_t);
|
90
|
+
void analogWrite(uint8_t, int);
|
91
|
+
#define analogReadResolution(...) _NOP()
|
92
|
+
#define analogWriteResolution(...) _NOP()
|
67
93
|
|
68
94
|
|
69
|
-
|
70
|
-
void delay(unsigned long millis);
|
71
|
-
void delayMicroseconds(unsigned long micros);
|
72
|
-
unsigned long millis();
|
73
|
-
unsigned long micros();
|
95
|
+
GodmodeState* GODMODE();
|
74
96
|
|