Add extremely basic unit test framework.

This commit is contained in:
Jordan Bancino 2022-08-05 22:19:59 -04:00
parent 59ac624d00
commit 2e5d21d309

14
tests/UnitTest.h Normal file
View 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