1 | #include <stdio.h> |
---|
2 | #include <CUnit/CUnit.h> |
---|
3 | #include <CUnit/Basic.h> |
---|
4 | |
---|
5 | void demoTest(); |
---|
6 | |
---|
7 | int main (int argc, const char * argv[]) { |
---|
8 | |
---|
9 | if (CU_initialize_registry() != CUE_SUCCESS) { |
---|
10 | fprintf(stderr, "failed to initialize CUnit registry\n"); |
---|
11 | return 1; |
---|
12 | } |
---|
13 | |
---|
14 | CU_pSuite suite = CU_add_suite("DemoSuite", NULL, NULL); |
---|
15 | if (suite == NULL) { |
---|
16 | fprintf(stderr, "failed to add test suite\n"); |
---|
17 | return 1; |
---|
18 | } |
---|
19 | |
---|
20 | CU_ADD_TEST(suite, demoTest); |
---|
21 | |
---|
22 | if (CU_basic_run_tests() != CUE_SUCCESS) { |
---|
23 | fprintf(stderr, "tests failed\n"); |
---|
24 | return 1; |
---|
25 | } |
---|
26 | |
---|
27 | return 0; |
---|
28 | } |
---|
29 | |
---|
30 | |
---|
31 | void demoTest() |
---|
32 | { |
---|
33 | CU_PASS("always passes"); |
---|
34 | } |
---|