Initial commit.
[apps/agl-service-can-low-level.git] / tests / tests.c
1 #include <check.h>
2 #include <stdint.h>
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <stdarg.h>
6
7 void setup() {
8
9 }
10
11 START_TEST (test_fail)
12 {
13     fail_unless(false);
14 }
15 END_TEST
16
17 Suite* testSuite(void) {
18     Suite* s = suite_create("obd2");
19     TCase *tc_core = tcase_create("core");
20     tcase_add_checked_fixture(tc_core, setup, NULL);
21     tcase_add_test(tc_core, test_fail);
22     suite_add_tcase(s, tc_core);
23
24     return s;
25 }
26
27 int main(void) {
28     int numberFailed;
29     Suite* s = testSuite();
30     SRunner *sr = srunner_create(s);
31     // Don't fork so we can actually use gdb
32     srunner_set_fork_status(sr, CK_NOFORK);
33     srunner_run_all(sr, CK_NORMAL);
34     numberFailed = srunner_ntests_failed(sr);
35     srunner_free(sr);
36     return (numberFailed == 0) ? 0 : 1;
37 }