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
@@ -0,0 +1,5 @@
|
|
1
|
+
The parent directory is for files that must stand in for their Arduino counterparts -- any `SomeFile` that might be requested as `#include <SomeFile.h>`.
|
2
|
+
|
3
|
+
This directory is specificially for support files required by those other files. That's because we don't want to create collisions on filenames for common data structures like Queue.
|
4
|
+
|
5
|
+
If there end up being class-level conflicts, it is this developer's stated intention to rename our classes such that `class Float` becomes `class FloatyMcFloatFace`.
|
@@ -0,0 +1,125 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
// A template-ized lookup table implementation
|
4
|
+
//
|
5
|
+
// this is this stupidest table implementation ever but it's
|
6
|
+
// an MVP for unit testing. O(n).
|
7
|
+
template <typename K, typename V>
|
8
|
+
class Table {
|
9
|
+
private:
|
10
|
+
struct Node {
|
11
|
+
K key;
|
12
|
+
V val;
|
13
|
+
Node *next;
|
14
|
+
};
|
15
|
+
|
16
|
+
Node* mStart;
|
17
|
+
unsigned long mSize;
|
18
|
+
// to alow const reference signatures, pre-allocate nil values
|
19
|
+
K mNilK;
|
20
|
+
V mNilV;
|
21
|
+
|
22
|
+
void init() {
|
23
|
+
mStart = NULL;
|
24
|
+
mSize = 0;
|
25
|
+
}
|
26
|
+
|
27
|
+
public:
|
28
|
+
Table() : mNilK(), mNilV() { init(); }
|
29
|
+
|
30
|
+
// number of things in the table
|
31
|
+
inline unsigned long size() const { return mSize; }
|
32
|
+
|
33
|
+
// whether there are no things
|
34
|
+
inline bool empty() const { return 0 == mSize; }
|
35
|
+
|
36
|
+
// whether there is a thing stored at the given key
|
37
|
+
bool has(K const key) const {
|
38
|
+
for (Node* p = mStart; p; p = p->next) {
|
39
|
+
if (p->key == key) return true;
|
40
|
+
}
|
41
|
+
return false;
|
42
|
+
}
|
43
|
+
|
44
|
+
// allow find operations on keys
|
45
|
+
template <typename T>
|
46
|
+
const K& getMatchingKey(T const firstArg, bool (*isMatch)(const T, const K)) const {
|
47
|
+
for (Node* p = mStart; p; p = p->next) {
|
48
|
+
if (isMatch(firstArg, p->key)) return p->key;
|
49
|
+
}
|
50
|
+
return mNilK;
|
51
|
+
}
|
52
|
+
|
53
|
+
// allow iteration over entire table, with a work function that takes key/value pairs
|
54
|
+
void iterate(void (*work)(const K&, const V&)) const {
|
55
|
+
for (Node* p = mStart; p; p = p->next) work(p->key, p->val);
|
56
|
+
}
|
57
|
+
void iterate(void (*work)(K, V)) const {
|
58
|
+
for (Node* p = mStart; p; p = p->next) work(p->key, p->val);
|
59
|
+
}
|
60
|
+
|
61
|
+
// allow iteration over entire table, with a work function that takes key/value pairs
|
62
|
+
// plus an initial argument. this enables member function passing (via workaround)
|
63
|
+
template <typename T>
|
64
|
+
void iterate(void (*work)(T&, const K&, const V&), T& firstArg) const {
|
65
|
+
for (Node* p = mStart; p; p = p->next) work(firstArg, p->key, p->val);
|
66
|
+
}
|
67
|
+
|
68
|
+
template <typename T>
|
69
|
+
void iterate(void (*work)(T&, K, V), T& firstArg) const {
|
70
|
+
for (Node* p = mStart; p; p = p->next) work(firstArg, p->key, p->val);
|
71
|
+
}
|
72
|
+
|
73
|
+
template <typename T>
|
74
|
+
void iterate(void (*work)(T, K, V), T firstArg) const {
|
75
|
+
for (Node* p = mStart; p; p = p->next) work(firstArg, p->key, p->val);
|
76
|
+
}
|
77
|
+
|
78
|
+
// return the value for a given key
|
79
|
+
const V& get(K const key) const {
|
80
|
+
for (Node* p = mStart; p; p = p->next) {
|
81
|
+
if (p->key == key) return p->val;
|
82
|
+
}
|
83
|
+
return mNilV;
|
84
|
+
}
|
85
|
+
|
86
|
+
// remove an item by key
|
87
|
+
bool remove(K const key) {
|
88
|
+
Node *o = NULL;
|
89
|
+
for (Node* p = mStart; p; p = p->next) {
|
90
|
+
if (p->key == key) {
|
91
|
+
(o ? o->next : mStart) = p->next;
|
92
|
+
delete p;
|
93
|
+
--mSize;
|
94
|
+
return true;
|
95
|
+
}
|
96
|
+
o = p;
|
97
|
+
}
|
98
|
+
return false;
|
99
|
+
}
|
100
|
+
|
101
|
+
// add a key/value pair. deletes any existing key by that name.
|
102
|
+
bool add(K const key, V const val) {
|
103
|
+
remove(key);
|
104
|
+
Node *n = new Node;
|
105
|
+
if (n == NULL) return false;
|
106
|
+
n->key = key;
|
107
|
+
n->val = val;
|
108
|
+
n->next = mStart;
|
109
|
+
mStart = n;
|
110
|
+
++mSize;
|
111
|
+
return true;
|
112
|
+
}
|
113
|
+
|
114
|
+
// remove everything
|
115
|
+
void clear() {
|
116
|
+
Node* p;
|
117
|
+
while (mStart) {
|
118
|
+
p = mStart;
|
119
|
+
mStart = mStart->next;
|
120
|
+
delete p;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
~Table() { clear(); }
|
125
|
+
};
|
@@ -28,23 +28,23 @@ class Test
|
|
28
28
|
~ReporterTAP() {}
|
29
29
|
|
30
30
|
void onTestRunInit(int numTests) {
|
31
|
-
|
32
|
-
|
31
|
+
cerr << "TAP version 13" << endl;
|
32
|
+
cerr << 1 << ".." << numTests << endl; // we know how many tests, in advance
|
33
33
|
mTestCounter = 0;
|
34
34
|
}
|
35
35
|
|
36
36
|
void onTestStart(TestData td) {
|
37
37
|
mAssertCounter = 0;
|
38
38
|
++mTestCounter;
|
39
|
-
|
39
|
+
cerr << "# Subtest: " << td.name << endl;
|
40
40
|
}
|
41
41
|
|
42
42
|
void onTestEnd(TestData td) {
|
43
|
-
|
43
|
+
cerr << " 1.." << mAssertCounter << endl;
|
44
44
|
if (td.result == RESULT_PASS) {
|
45
|
-
|
45
|
+
cerr << "ok " << mTestCounter << " - " << td.name << endl;
|
46
46
|
} else {
|
47
|
-
|
47
|
+
cerr << "not ok " << mTestCounter << " - " << td.name << endl;
|
48
48
|
}
|
49
49
|
}
|
50
50
|
|
@@ -61,17 +61,17 @@ class Test
|
|
61
61
|
const char* rhsLabel,
|
62
62
|
const B &rhs
|
63
63
|
) {
|
64
|
-
|
65
|
-
|
64
|
+
cerr << " " << (pass ? "" : "not ") << "ok " << ++mAssertCounter << " - ";
|
65
|
+
cerr << description << " " << lhsLabel << " " << opLabel << " " << rhsLabel << endl;
|
66
66
|
if (!pass) {
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
67
|
+
cerr << " ---" << endl;
|
68
|
+
cerr << " operator: " << opLabel << endl;
|
69
|
+
cerr << " " << lhsRelevance << ": " << lhs << endl;
|
70
|
+
cerr << " " << rhsRelevance << ": " << rhs << endl;
|
71
|
+
cerr << " at:" << endl;
|
72
|
+
cerr << " file: " << file << endl;
|
73
|
+
cerr << " line: " << line << endl;
|
74
|
+
cerr << " ..." << endl;
|
75
75
|
}
|
76
76
|
}
|
77
77
|
};
|
data/cpp/unittest/Assertion.h
CHANGED
@@ -46,6 +46,6 @@
|
|
46
46
|
#define assureMore(arg1,arg2) assureOp("assureMore","upperBound",arg1,compareMore,">","lowerBound",arg2)
|
47
47
|
#define assureLessOrEqual(arg1,arg2) assureOp("assureLessOrEqual","lowerBound",arg1,compareLessOrEqual,"<=","upperBound",arg2)
|
48
48
|
#define assureMoreOrEqual(arg1,arg2) assureOp("assureMoreOrEqual","upperBound",arg1,compareMoreOrEqual,">=","lowerBound",arg2)
|
49
|
-
#define assureTrue(arg)
|
50
|
-
#define assureFalse(arg)
|
49
|
+
#define assureTrue(arg) assureEqual(true, arg)
|
50
|
+
#define assureFalse(arg) assureEqual(false, arg)
|
51
51
|
|
data/cpp/unittest/Compare.h
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
#pragma once
|
2
2
|
#include "string.h"
|
3
3
|
|
4
|
-
|
5
4
|
template < typename A, typename B > struct Compare
|
6
5
|
{
|
7
6
|
inline static int between(const A &a,const B &b)
|
@@ -418,6 +417,7 @@ template <typename T> struct Compare<T, bool>
|
|
418
417
|
return between(a,b) >= 0;
|
419
418
|
} // moreOrEqual
|
420
419
|
};
|
420
|
+
|
421
421
|
template <typename A, typename B> int compareBetween(const A &a, const B &b) { return Compare<A,B>::between(a,b); }
|
422
422
|
template <typename A, typename B> bool compareEqual(const A &a, const B &b) { return Compare<A,B>::equal(a,b); }
|
423
423
|
template <typename A, typename B> bool compareNotEqual(const A &a, const B &b) { return Compare<A,B>::notEqual(a,b); }
|
data/exe/arduino_ci_remote.rb
CHANGED
@@ -25,7 +25,7 @@ def perform_action(message, on_fail_msg, abort_on_fail)
|
|
25
25
|
line = "#{message}..."
|
26
26
|
print line
|
27
27
|
result = yield
|
28
|
-
mark = result ? "✓" : "
|
28
|
+
mark = result ? "✓" : "✗"
|
29
29
|
puts mark.rjust(WIDTH - line.length, " ")
|
30
30
|
unless result
|
31
31
|
puts on_fail_msg unless on_fail_msg.nil?
|
@@ -88,36 +88,49 @@ aux_libraries.each do |l|
|
|
88
88
|
assure("Installing aux library '#{l}'") { @arduino_cmd.install_library(l) }
|
89
89
|
end
|
90
90
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
91
|
+
# iterate boards / tests
|
92
|
+
last_board = nil
|
93
|
+
if cpp_library.test_files.empty?
|
94
|
+
attempt("Skipping unit tests; no test files were found") { true }
|
95
|
+
elsif config.platforms_to_unittest.empty?
|
96
|
+
attempt("Skipping unit tests; no platforms were requestsed") { true }
|
97
|
+
else
|
98
|
+
config.platforms_to_unittest.each do |p|
|
99
|
+
board = all_platforms[p][:board]
|
100
|
+
# assure("Switching to board for #{p} (#{board})") { @arduino_cmd.use_board(board) } unless last_board == board
|
101
|
+
last_board = board
|
102
|
+
cpp_library.test_files.each do |unittest_path|
|
103
|
+
unittest_name = File.basename(unittest_path)
|
104
|
+
attempt("Unit testing #{unittest_name}") do
|
105
|
+
exe = cpp_library.build_for_test_with_configuration(
|
106
|
+
unittest_path,
|
107
|
+
config.aux_libraries_for_unittest,
|
108
|
+
config.gcc_config(p)
|
109
|
+
)
|
110
|
+
puts
|
111
|
+
unless exe
|
112
|
+
puts "Last command: #{cpp_library.last_cmd}"
|
113
|
+
puts cpp_library.last_out
|
114
|
+
puts cpp_library.last_err
|
115
|
+
next false
|
116
|
+
end
|
117
|
+
cpp_library.run_test_file(exe)
|
108
118
|
end
|
109
|
-
cpp_library.run_test_file(exe)
|
110
119
|
end
|
111
120
|
end
|
112
121
|
end
|
113
122
|
|
114
|
-
|
123
|
+
unless library_examples.empty?
|
124
|
+
attempt("Setting compiler warning level") { @arduino_cmd.set_pref("compiler.warning_level", "all") }
|
125
|
+
end
|
115
126
|
|
127
|
+
# unlike previous, iterate examples / boards
|
116
128
|
library_examples.each do |example_path|
|
117
129
|
ovr_config = config.from_example(example_path)
|
118
130
|
ovr_config.platforms_to_build.each do |p|
|
119
131
|
board = all_platforms[p][:board]
|
120
|
-
assure("Switching to board for #{p} (#{board})") { @arduino_cmd.use_board(board) }
|
132
|
+
assure("Switching to board for #{p} (#{board})") { @arduino_cmd.use_board(board) } unless last_board == board
|
133
|
+
last_board = board
|
121
134
|
example_name = File.basename(example_path)
|
122
135
|
attempt("Verifying #{example_name}") do
|
123
136
|
ret = @arduino_cmd.verify_sketch(example_path)
|
@@ -281,6 +281,7 @@ module ArduinoCI
|
|
281
281
|
# @return [Array<String>] Example sketch files
|
282
282
|
def library_examples(installed_library_path)
|
283
283
|
example_path = File.join(installed_library_path, "examples")
|
284
|
+
return [] unless File.exist?(example_path)
|
284
285
|
examples = Pathname.new(example_path).children.select(&:directory?).map(&:to_path).map(&File.method(:basename))
|
285
286
|
files = examples.map do |e|
|
286
287
|
proj_file = File.join(example_path, e, "#{e}.ino")
|
@@ -29,28 +29,22 @@ module ArduinoCI
|
|
29
29
|
# @return [ArduinoCI::ArduinoCmdOSX] an instance of a command
|
30
30
|
def autolocate_osx
|
31
31
|
osx_root = "/Applications/Arduino.app/Contents"
|
32
|
-
old_way = false
|
33
32
|
return nil unless File.exist? osx_root
|
34
33
|
|
35
34
|
ret = ArduinoCmdOSX.new
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
"-Xms128M",
|
50
|
-
"-Xmx512M",
|
51
|
-
"processing.app.Base",
|
52
|
-
]
|
53
|
-
end
|
35
|
+
|
36
|
+
# old_way
|
37
|
+
# ret.base_cmd = [File.join("#{osx_root}/MacOS", "Arduino")]
|
38
|
+
ret.base_cmd = [
|
39
|
+
"java",
|
40
|
+
"-cp", "#{osx_root}/Java/*",
|
41
|
+
"-DAPP_DIR=#{osx_root}/Java",
|
42
|
+
"-Dfile.encoding=UTF-8",
|
43
|
+
"-Dapple.awt.UIElement=true",
|
44
|
+
"-Xms128M",
|
45
|
+
"-Xmx512M",
|
46
|
+
"processing.app.Base",
|
47
|
+
]
|
54
48
|
ret
|
55
49
|
end
|
56
50
|
|
data/lib/arduino_ci/ci_config.rb
CHANGED
@@ -27,12 +27,19 @@ COMPILE_SCHEMA = {
|
|
27
27
|
UNITTEST_SCHEMA = {
|
28
28
|
platforms: Array,
|
29
29
|
libraries: Array,
|
30
|
+
testfiles: {
|
31
|
+
select: Array,
|
32
|
+
reject: Array,
|
33
|
+
}
|
30
34
|
}.freeze
|
31
35
|
module ArduinoCI
|
32
36
|
|
33
37
|
# The filename controlling (overriding) the defaults for testing.
|
34
38
|
# Files with this name can be used in the root directory of the Arduino library and in any/all of the example directories
|
35
|
-
|
39
|
+
CONFIG_FILENAMES = [
|
40
|
+
".arduino-ci.yml",
|
41
|
+
".arduino-ci.yaml",
|
42
|
+
].freeze
|
36
43
|
|
37
44
|
# Provide the configuration and CI plan
|
38
45
|
# - Read from a base config with default platforms defined
|
@@ -46,7 +53,7 @@ module ArduinoCI
|
|
46
53
|
# @return [ArudinoCI::CIConfig] The configuration with defaults filled in
|
47
54
|
def default
|
48
55
|
ret = new
|
49
|
-
ret.load_yaml(File.expand_path("../../../misc/default.
|
56
|
+
ret.load_yaml(File.expand_path("../../../misc/default.yml", __FILE__))
|
50
57
|
ret
|
51
58
|
end
|
52
59
|
end
|
@@ -99,6 +106,8 @@ module ArduinoCI
|
|
99
106
|
# @return [ArduinoCI::CIConfig] a reference to self
|
100
107
|
def load_yaml(path)
|
101
108
|
yml = YAML.load_file(path)
|
109
|
+
raise "The YAML file at #{path} failed to load" unless yml
|
110
|
+
|
102
111
|
if yml.include?("packages")
|
103
112
|
yml["packages"].each do |k, v|
|
104
113
|
valid_data = validate_data("packages", v, PACKAGE_SCHEMA)
|
@@ -139,18 +148,26 @@ module ArduinoCI
|
|
139
148
|
overridden_config
|
140
149
|
end
|
141
150
|
|
142
|
-
#
|
143
|
-
#
|
144
|
-
# @
|
145
|
-
|
146
|
-
|
147
|
-
|
151
|
+
# Get the config file at a given path, if it exists, and pass that to a block.
|
152
|
+
# Many config files may exist, but only the first match is used
|
153
|
+
# @param base_dir [String] The directory in which to search for a config file
|
154
|
+
# @param val_when_no_match [Object] The value to return if no config files are found
|
155
|
+
# @yield [path] Process the configuration file at the given path
|
156
|
+
# @yieldparam [String] The path of an existing config file
|
157
|
+
# @yieldreturn [ArduinoCI::CIConfig] a settings object
|
158
|
+
# @return [ArduinoCI::CIConfig]
|
159
|
+
def with_config(base_dir, val_when_no_match)
|
160
|
+
CONFIG_FILENAMES.each do |f|
|
161
|
+
path = base_dir.nil? ? f : File.join(base_dir, f)
|
162
|
+
return (yield path) if File.exist?(path)
|
163
|
+
end
|
164
|
+
val_when_no_match
|
148
165
|
end
|
149
166
|
|
150
167
|
# Produce a configuration, assuming the CI script runs from the working directory of the base project
|
151
168
|
# @return [ArduinoCI::CIConfig] the new settings object
|
152
169
|
def from_project_library
|
153
|
-
|
170
|
+
with_config(nil, self) { |path| with_override(path) }
|
154
171
|
end
|
155
172
|
|
156
173
|
# Produce a configuration override taken from an Arduino library example path
|
@@ -159,7 +176,7 @@ module ArduinoCI
|
|
159
176
|
# @return [ArduinoCI::CIConfig] the new settings object
|
160
177
|
def from_example(example_path)
|
161
178
|
base_dir = File.directory?(example_path) ? example_path : File.dirname(example_path)
|
162
|
-
|
179
|
+
with_config(base_dir, self) { |path| with_override(path) }
|
163
180
|
end
|
164
181
|
|
165
182
|
# get information about a given platform: board name, package name, compiler stuff, etc
|
@@ -204,6 +221,21 @@ module ArduinoCI
|
|
204
221
|
@unittest_info[:libraries]
|
205
222
|
end
|
206
223
|
|
224
|
+
# Config allows select / reject (aka whitelist / blacklist) criteria. Enforce on a dir
|
225
|
+
# @param paths [Array<String>] the initial set of test files
|
226
|
+
# @return [Array<String>] files that match the select/reject criteria
|
227
|
+
def allowable_unittest_files(paths)
|
228
|
+
return paths if @unittest_info[:testfiles].nil?
|
229
|
+
ret = paths
|
230
|
+
unless @unittest_info[:testfiles][:select].nil? || @unittest_info[:testfiles][:select].empty?
|
231
|
+
ret = ret.select { |p| unittest_info[:testfiles][:select].any? { |glob| File.fnmatch(glob, File.basename(p)) } }
|
232
|
+
end
|
233
|
+
unless @unittest_info[:testfiles][:reject].nil?
|
234
|
+
ret = ret.reject { |p| unittest_info[:testfiles][:reject].any? { |glob| File.fnmatch(glob, File.basename(p)) } }
|
235
|
+
end
|
236
|
+
ret
|
237
|
+
end
|
238
|
+
|
207
239
|
# get GCC configuration for a given platform
|
208
240
|
# @param platform_name [String] The name of the platform as defined in yaml
|
209
241
|
# @return [Hash] the settings
|