aboutsummaryrefslogtreecommitdiff
path: root/tests/test.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.h')
-rw-r--r--tests/test.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test.h b/tests/test.h
index 19868f8..05c35b9 100644
--- a/tests/test.h
+++ b/tests/test.h
@@ -3,12 +3,15 @@
#include <stdarg.h>
#include <string.h>
-#define assert(assertion, format, ...) _assert(assertion, __FILE__, __LINE__, format, ##__VA_ARGS__)
-#define TESTNAME(v) strcpy(current_test, v);
+#define START_TESTS int main() {
+#define END_TESTS }
+#define TEST(name) strcpy(current_test, #name);
+/* used to store the running test name */
char current_test[256] = {'\0'};
-void _assert(int assertion, const char filename[64], const int line, char *format, ...)
+#define assert(assertion, format, ...) _assert(assertion, __FILE__, __LINE__, format, ##__VA_ARGS__)
+static void _assert(int assertion, const char filename[64], const int line, char *format, ...)
{
if (assertion)
{