aboutsummaryrefslogtreecommitdiff
path: root/test_runner.c
diff options
context:
space:
mode:
Diffstat (limited to 'test_runner.c')
-rw-r--r--test_runner.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test_runner.c b/test_runner.c
new file mode 100644
index 0000000..9d3ad65
--- /dev/null
+++ b/test_runner.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+#include "test_runner.h"
+#include "unity.h"
+
+/* unity requires these, even if empty */
+void setUp(){};
+void tearDown(){};
+
+int main(void)
+{
+ struct test_fn *tests = list_head(struct test_fn, test_list);
+ size_t count = list_entry_count(struct test_fn, test_list);
+ printf("Suite has %zd tests\n", count);
+ UNITY_BEGIN();
+ for (size_t i = 0; i < count; i++) {
+ UnitySetTestFile(tests[i].file);
+ UnityDefaultTestRun(tests[i].fn, tests[i].name, tests[i].line);
+ }
+ UNITY_END();
+}