-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
48 lines (40 loc) · 1.41 KB
/
main.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
#include "tests/s21_tests.h"
int main(void) {
run_tests();
return 0;
}
void run_testcase(Suite *testcase) {
static int counter_testcase = 1;
if (counter_testcase > 1) putchar('\n');
printf("%s%d%s", "CURRENT TEST: ", counter_testcase, "\n");
counter_testcase++;
SRunner *sr = srunner_create(testcase);
srunner_set_fork_status(sr, CK_NOFORK);
srunner_run_all(sr, CK_NORMAL);
srunner_free(sr);
}
void run_tests(void) {
Suite *list_cases[] = {suite_from_int_to_decimal(),
suite_from_decimal_to_int(),
suite_from_decimal_to_float(),
suite_from_float_to_decimal(),
suite_is_greater(),
suite_is_greater_or_equal(),
suite_is_equal(),
suite_is_not_equal(),
suite_is_less(),
suite_is_less_or_equal(),
suite_negate(),
suite_truncate(),
suite_round(),
suite_floor(),
suite_add(),
suite_mul(),
suite_sub(),
suite_div(),
s21_NULL};
for (Suite **current_testcase = list_cases; *current_testcase != s21_NULL;
current_testcase++) {
run_testcase(*current_testcase);
}
}