tests/test_list.c: test_list_append
[vlock.git] / tests / vlock-test.c
blob99e900ddbc4509fbe1e969e2cb4cc965d4f0000c
1 #include <stdlib.h>
2 #include <stdio.h>
4 #include <CUnit/CUnit.h>
5 #include <CUnit/Basic.h>
7 #include "test_list.h"
9 CU_SuiteInfo vlock_test_suites[] = {
10 { "test_list" , NULL, NULL, list_tests },
11 CU_SUITE_INFO_NULL,
14 int main(int __attribute__((unused)) argc, const char *argv[])
16 if (CU_initialize_registry() != CUE_SUCCESS) {
17 fprintf(stderr, "%s: CUnit initialization failed\n", argv[0]);
18 exit(EXIT_FAILURE);
21 if (CU_register_suites(vlock_test_suites) != CUE_SUCCESS) {
22 fprintf(stderr, "%s: registering test suites failed: %s\n", argv[0], CU_get_error_msg());
25 if (CU_basic_run_tests() != CUE_SUCCESS) {
26 fprintf(stderr, "%s: running tests failed\n", argv[0]);
27 goto error;
30 if (CU_get_number_of_tests_failed() > 0)
31 goto error;
33 CU_cleanup_registry();
34 exit(EXIT_SUCCESS);
36 error:
37 CU_cleanup_registry();
38 exit(EXIT_FAILURE);