mmurdoch / arduinounit

ArduinoUnit is a unit testing framework for Arduino libraries
MIT License
394 stars 51 forks source link

Test::exclude isn't working properly. Test::exclude("*"); #72

Closed gtame closed 6 years ago

gtame commented 6 years ago

Hi , if the first exclude sentence is Test::exclude("*"). The sentence doesn't work.

error

`

include "main.h"

test(correct) { int x=1; assertEqual(x,1); }

test(incorrect) { int x=1; assertNotEqual(x,1); }

test(otro) { int x=1; assertNotEqual(x,1); }

extern "C" void __cxa_pure_virtual() {}

int main() {

init();
setup();
     while (true)
loop();

}

void setup() { Serial.begin(9600); while(!Serial)

Test::exclude("*");
Test::include("incorrect");

}

void loop() { Test::run(); } ` However if I added before another exclude sentence works. Ej, Test::exclude("*e")

`void setup() { Serial.begin(9600); while(!Serial)

Test::exclude("*e");
Test::exclude("*");
Test::include("incorrect");

}`

ok

wmacevoy commented 6 years ago

There needs to be a ';' after the while (!Serial), perhaps preferably while (!Serial) { /* busy */ } -- the line after the while (exclude) was never executed. Pretty subtle; sorry C syntax got you there...

gtame commented 6 years ago

Hi, it's clear. A tree didn't let me to see the forest😀