arduino_ci 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70602a4768ed2df9cbd04f83888f229119f00267
4
- data.tar.gz: 337f60474895f3cfdecd9497328a7772adcc9254
3
+ metadata.gz: 36ae4dec579913479fdb655f0bf7be717b055149
4
+ data.tar.gz: ba9d142cd8c840a9bd54ec84efa4e6351ddc45b0
5
5
  SHA512:
6
- metadata.gz: 78f6e93158cd15a1398396a631646f20b4ce843d5fd386185505ea84b230f2fc5da927e532bdb174818bf73c060bdb09d2e870ab742653df58fa68c802a37c49
7
- data.tar.gz: 2cf0fb5e0755ed5fe2ac989fa591a923fb162c922499c6467a45edb7dd6bd811a2e23ceb945597cf48311656fee45cb0eddbc5005d0688a52179dedf4cce01ec
6
+ metadata.gz: dfaefbfed33fa5dc78c8c106311c8896328f3416557a640f1b5366bb3f2278de8993da41386073aca8d274c8de03b405f7b991fdd91068ecf80ff9c3f3bff421
7
+ data.tar.gz: 7c56fe74249b2849338a6f439361d658ed49ff9e68b7e5cb3b73d686542a08ada22d45b036d03e0b6196807ed229fa6c0a330f88ba6723b45de2add5b6f351c1
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.19)
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.20)
3
3
 
4
4
  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.
5
5
 
@@ -0,0 +1,143 @@
1
+ #pragma once
2
+ /*
3
+ Mock Arduino.h library.
4
+
5
+ Where possible, variable names from the Arduino library are used to avoid conflicts
6
+
7
+ */
8
+ // Chars and strings
9
+
10
+ #include "ArduinoDefines.h"
11
+
12
+ #include "WCharacter.h"
13
+ #include "WString.h"
14
+ #include "Print.h"
15
+ #include "Stream.h"
16
+ #include "HardwareSerial.h"
17
+ #include "SPI.h"
18
+ #include "Nullptr.h"
19
+
20
+ typedef bool boolean;
21
+ typedef uint8_t byte;
22
+
23
+ #include "binary.h"
24
+
25
+ // Math and Trig
26
+ #include "AvrMath.h"
27
+
28
+ #include "Godmode.h"
29
+
30
+
31
+ // Bits and Bytes
32
+ #define bit(b) (1UL << (b))
33
+ #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
34
+ #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
35
+ #define bitSet(value, bit) ((value) |= (1UL << (bit)))
36
+ #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
37
+ #define highByte(w) ((uint8_t) ((w) >> 8))
38
+ #define lowByte(w) ((uint8_t) ((w) & 0xff))
39
+
40
+ // Arduino defines this
41
+ #define _NOP() do { 0; } while (0)
42
+
43
+ // might as well use that NO-op macro for these, while unit testing
44
+ // you need interrupts? interrupt yourself
45
+ #define yield() _NOP()
46
+ #define interrupts() _NOP()
47
+ #define noInterrupts() _NOP()
48
+
49
+ // TODO: correctly establish this per-board!
50
+ #define F_CPU 1000000UL
51
+ #define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
52
+ #define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
53
+ #define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )
54
+
55
+ typedef unsigned int word;
56
+
57
+ #define bit(b) (1UL << (b))
58
+
59
+
60
+
61
+ /*
62
+ unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
63
+ unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout);
64
+
65
+ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
66
+ uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder);
67
+
68
+ */
69
+
70
+ // Get the bit location within the hardware port of the given virtual pin.
71
+ // This comes from the pins_*.c file for the active board configuration.
72
+
73
+ #define analogInPinToBit(P) (P)
74
+ #define digitalPinToInterrupt(P) (P)
75
+
76
+ /*
77
+ // On the ATmega1280, the addresses of some of the port registers are
78
+ // greater than 255, so we can't store them in uint8_t's.
79
+ extern const uint16_t PROGMEM port_to_mode_PGM[];
80
+ extern const uint16_t PROGMEM port_to_input_PGM[];
81
+ extern const uint16_t PROGMEM port_to_output_PGM[];
82
+
83
+ extern const uint8_t PROGMEM digital_pin_to_port_PGM[];
84
+ // extern const uint8_t PROGMEM digital_pin_to_bit_PGM[];
85
+ extern const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[];
86
+ extern const uint8_t PROGMEM digital_pin_to_timer_PGM[];
87
+
88
+ // Get the bit location within the hardware port of the given virtual pin.
89
+ // This comes from the pins_*.c file for the active board configuration.
90
+ //
91
+ // These perform slightly better as macros compared to inline functions
92
+ //
93
+ #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
94
+ #define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
95
+ #define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
96
+ #define analogInPinToBit(P) (P)
97
+ #define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
98
+ #define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
99
+ #define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )
100
+
101
+ */
102
+
103
+
104
+ /* TODO
105
+
106
+ // USB
107
+ #include "USBAPI.h"
108
+ Keyboard
109
+ Mouse
110
+
111
+ */
112
+
113
+ // uint16_t makeWord(uint16_t w);
114
+ // uint16_t makeWord(byte h, byte l);
115
+ inline unsigned int makeWord(unsigned int w) { return w; }
116
+ inline unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; }
117
+
118
+ #define word(...) makeWord(__VA_ARGS__)
119
+
120
+ <<<<<<< Updated upstream
121
+
122
+ =======
123
+ unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
124
+ unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L);
125
+
126
+ // audio is taken care of in GODMODE
127
+
128
+
129
+ // BIG TODO ON THIS ONE
130
+ // $ find . | grep pins_
131
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/circuitplay32u4/pins_arduino.h
132
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/eightanaloginputs/pins_arduino.h
133
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/ethernet/pins_arduino.h
134
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/gemma/pins_arduino.h
135
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/leonardo/pins_arduino.h
136
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/mega/pins_arduino.h
137
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/micro/pins_arduino.h
138
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/robot_control/pins_arduino.h
139
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/robot_motor/pins_arduino.h
140
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/standard/pins_arduino.h
141
+ // ./arduino-1.8.5/hardware/arduino/avr/variants/yun/pins_arduino.h
142
+ // #include "pins_arduino.h"
143
+ >>>>>>> Stashed changes
@@ -154,7 +154,9 @@ class Test
154
154
  p->mReporter = reporter;
155
155
  TestData t1 = {p->name(), p->result()};
156
156
  if (reporter) reporter->onTestStart(t1);
157
+ if (TestSetup::sInstance) TestSetup::sInstance->run();
157
158
  p->test();
159
+ if (TestTeardown::sInstance) TestTeardown::sInstance->run();
158
160
  if (p->mResult == RESULT_PASS) ++results.passed;
159
161
  if (p->mResult == RESULT_FAIL) ++results.failed;
160
162
  if (p->mResult == RESULT_SKIP) ++results.skipped;
@@ -172,9 +174,7 @@ class Test
172
174
  static int run_and_report(int argc, char *argv[]) {
173
175
  // TODO: pick a reporter based on args
174
176
  ReporterTAP rep;
175
- if (TestSetup::sInstance) TestSetup::sInstance->run();
176
177
  Results results = run(&rep);
177
- if (TestTeardown::sInstance) TestTeardown::sInstance->run();
178
178
  return results.failed + results.skipped;
179
179
  }
180
180
 
@@ -1,3 +1,3 @@
1
1
  module ArduinoCI
2
- VERSION = "0.1.19".freeze
2
+ VERSION = "0.1.20".freeze
3
3
  end
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.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Katz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-30 00:00:00.000000000 Z
11
+ date: 2019-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: os
@@ -123,6 +123,7 @@ files:
123
123
  - README.md
124
124
  - cpp/arduino/Arduino.cpp
125
125
  - cpp/arduino/Arduino.h
126
+ - cpp/arduino/Arduino.h.orig
126
127
  - cpp/arduino/ArduinoDefines.h
127
128
  - cpp/arduino/AvrMath.h
128
129
  - cpp/arduino/Godmode.cpp