Skip to content

Instantly share code, notes, and snippets.

@wmacevoy
Last active April 7, 2016 17:22
Show Gist options
  • Save wmacevoy/36bd8fa7660a20e1adc225c0e8bf12e9 to your computer and use it in GitHub Desktop.
Save wmacevoy/36bd8fa7660a20e1adc225c0e8bf12e9 to your computer and use it in GitHub Desktop.
Ordering tests
#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