-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_lab.c
83 lines (63 loc) · 1.8 KB
/
test_lab.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#define _REENTRANT
#include <stdio.h>
#include <stdlib.h>
#include <CUnit/CUnit.h>
#include <CUnit/Automated.h>
#include <CUnit/Basic.h>
#include <CUnit/Console.h>
#include <CUnit/CUCurses.h>
#include "suite_test_lab.h"
int main(int argc, char** argv) {
CU_pSuite suite_test_lab = NULL;
argc = 0;
argv = NULL;
/* initialize the CUnit test registry */
if (CUE_SUCCESS != CU_initialize_registry())
return CU_get_error();
if (NULL == (suite_test_lab = CU_add_suite("lab", initTestLab, cleanTestLab))) {
CU_cleanup_registry();
return CU_get_error();
}
if (
(NULL == CU_add_test(suite_test_lab, "test1 ", test_lab))
) {
CU_cleanup_registry();
return CU_get_error();
}
/*
* Run all tests using the basic interface
*
* CU_basic_run_tests(); -> Runs all tests in all registered suites
* CU_basic_run_suite(CU_pSuite pSuite); -> Runs all tests in single specified suite
* CU_basic_run_test(CU_pSuite pSuite, CU_pTest pTest); -> Runs a single test in a specified suite
*/
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
printf("\n");
CU_basic_show_failures(CU_get_failure_list());
printf("\n\n");
/*
* Run all tests using the automated interface
*/
/*
CU_automated_run_tests();
CU_list_tests_to_file();
*/
/*
* Run all tests using the console interface
*/
/*
CU_console_run_tests();
*/
/*
* Run all tests using the curses interface
* (only on systems having curses)
*/
/*
CU_curses_run_tests();
*/
/* Clean up registry and return */
CU_cleanup_registry();
return CU_get_error();
return (EXIT_SUCCESS);
}