forked from Telodendria/Telodendria
Add extremely basic unit test framework.
This commit is contained in:
parent
59ac624d00
commit
2e5d21d309
1 changed files with 14 additions and 0 deletions
14
tests/UnitTest.h
Normal file
14
tests/UnitTest.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
#ifndef TELODENDRIA_UNITTEST_H
|
||||
#define TELODENDRIA_UNITTEST_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define TEST(body) int main(void) { body; return 0; }
|
||||
|
||||
#define ASSERT(condition) if (!(condition)) { \
|
||||
printf("%s:%d: Assertion failed: %s\n", __FILE__, __LINE__, #condition); \
|
||||
exit(1); \
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue