Last active
April 7, 2016 17:22
-
-
Save wmacevoy/36bd8fa7660a20e1adc225c0e8bf12e9 to your computer and use it in GitHub Desktop.
Ordering tests
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) { | |
if (checkTestDone(first)) { | |
Serial.println("running second test."); | |
assertEqual(2+2,4); | |
// if an assert fails, it won't get to pass() | |
pass(); | |
} | |
} | |
testing(third) { | |
if (checkTestDone(second)) { | |
Serial.println("on to the third!"); | |
assertEqual(!true,false); | |
pass(); | |
} | |
} | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
Test::run(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment