This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ArduinoUnit.h> | |
// This is pretty advanced, you need to use template specialization to | |
// create mocks with no runtime overhead (other than space to represent | |
// the mocked environment, if you choose to use it (probably in a test). | |
struct RealImpl { | |
static void pMode(int pin, int mode) { pinMode(pin,mode); } | |
static void dWrite(int pin, bool value) { digitalWrite(pin,value); } | |
static int dRead(int pin) { return digitalRead(pin); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ArduinoUnit.h> | |
testing(first) { | |
if (micros() > 100) { // just to put off finishing the first test. | |
Serial.println("pass first test."); | |
pass(); | |
} | |
} | |
testing(second) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ArduinoUnit.h> | |
test(t01_first) { Serial.print("one"); pass(); } | |
test(t02_second) { Serial.print("two"); pass(); } | |
test(t03_third) { Serial.print("three"); pass(); } | |
void setup() | |
{ | |
Serial.begin(9600); | |
} |