mmurdoch/arduinounit

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

gtame opened this issue · 2 comments

gtame commented

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

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

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