summaryrefslogtreecommitdiffstats
path: root/tests/test_core.c
diff options
context:
space:
mode:
authorChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-30 18:30:37 -0500
committerChristopher Peplin <chris.peplin@rhubarbtech.com>2013-12-30 18:30:37 -0500
commit32f4cbab6bd5769a4b16a584e1880b1deabbd2da (patch)
tree1fe34a60fc8dae5abb7cce1571aab002f94469d0 /tests/test_core.c
parent06f31c13df6aaf92124f10b8cb5eee96b75c4f73 (diff)
Add skeleton of the API and data structures.
Diffstat (limited to 'tests/test_core.c')
-rw-r--r--tests/test_core.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/test_core.c b/tests/test_core.c
new file mode 100644
index 00000000..65af8580
--- /dev/null
+++ b/tests/test_core.c
@@ -0,0 +1,36 @@
+#include <check.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdbool.h>
+
+void setup() {
+
+}
+
+START_TEST (test_fail)
+{
+ fail_unless(false);
+}
+END_TEST
+
+Suite* testSuite(void) {
+ Suite* s = suite_create("obd2");
+ TCase *tc_core = tcase_create("core");
+ tcase_add_checked_fixture(tc_core, setup, NULL);
+ tcase_add_test(tc_core, test_fail);
+ suite_add_tcase(s, tc_core);
+
+ return s;
+}
+
+int main(void) {
+ int numberFailed;
+ Suite* s = testSuite();
+ SRunner *sr = srunner_create(s);
+ // Don't fork so we can actually use gdb
+ srunner_set_fork_status(sr, CK_NOFORK);
+ srunner_run_all(sr, CK_NORMAL);
+ numberFailed = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return (numberFailed == 0) ? 0 : 1;
+}