put each test in separate scope to avoid redefinition
This commit is contained in:
parent
5443eeb7b9
commit
39e3b16568
1 changed files with 15 additions and 13 deletions
|
@ -32,17 +32,19 @@
|
|||
}
|
||||
|
||||
#define TEST(name, ...) \
|
||||
uint asserts_failed = 0;\
|
||||
uint asserts_total = 0;\
|
||||
tests_total += 1;\
|
||||
std::cout << " RUNNING TEST `" << name << "`\n";\
|
||||
__VA_ARGS__\
|
||||
std::cout << " PASSED ASSERTS: "\
|
||||
<< (asserts_failed != 0 ? BG(255, 0, 0) : BG(0, 255, 0))\
|
||||
<< FG(0, 0, 0)\
|
||||
<< (asserts_total - asserts_failed) << "/" << asserts_total\
|
||||
<< RESET\
|
||||
<< "\n";\
|
||||
if (asserts_failed > 0) {\
|
||||
tests_failed += 1;\
|
||||
{\
|
||||
uint asserts_failed = 0;\
|
||||
uint asserts_total = 0;\
|
||||
tests_total += 1;\
|
||||
std::cout << " RUNNING TEST `" << name << "`\n";\
|
||||
__VA_ARGS__\
|
||||
std::cout << " PASSED ASSERTS: "\
|
||||
<< (asserts_failed != 0 ? BG(255, 0, 0) : BG(0, 255, 0))\
|
||||
<< FG(0, 0, 0)\
|
||||
<< (asserts_total - asserts_failed) << "/" << asserts_total\
|
||||
<< RESET\
|
||||
<< "\n";\
|
||||
if (asserts_failed > 0) {\
|
||||
tests_failed += 1;\
|
||||
}\
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue