aboutsummaryrefslogtreecommitdiff
path: root/tests/main.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2021-06-01 23:49:13 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2021-06-01 23:49:13 +0200
commit1418d5cc62f2f888aed5c033fa3fd9f50eb67235 (patch)
treea6300c63f2361b01c259fb104b33007b24473488 /tests/main.c
parent7941b3f57d39db8eef93bd75bc62d49da33824fb (diff)
downloaddns-1418d5cc62f2f888aed5c033fa3fd9f50eb67235.tar.gz
Add Check framework for unit tests
Diffstat (limited to 'tests/main.c')
-rw-r--r--tests/main.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/main.c b/tests/main.c
new file mode 100644
index 0000000..65d527f
--- /dev/null
+++ b/tests/main.c
@@ -0,0 +1,33 @@
+#include <check.h>
+
+START_TEST (test_example) {
+ ck_abort();
+} END_TEST
+
+Suite* tests(void) {
+ Suite *s;
+ TCase *tc_core;
+
+ s = suite_create("DNS Tests");
+
+ tc_core = tcase_create("Core");
+
+ tcase_add_test(tc_core, test_example);
+ suite_add_tcase(s, tc_core);
+
+ return s;
+}
+
+int main() {
+ Suite *s;
+ SRunner *sr;
+
+ s = tests();
+ sr = srunner_create(s);
+
+ srunner_run_all(sr,CK_NORMAL);
+
+ srunner_free(sr);
+
+ return srunner_ntests_failed(sr);
+}