-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtests.c
45 lines (38 loc) · 855 Bytes
/
tests.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
#include <stdio.h>
#include <video/hercules.h>
#include <cmdline.h>
#include "tests/tests.h"
static const TestCase separator = {
{ NULL, NULL }, NULL
};
static const TestCase *test_cases[] = {
&test_cardinfo,
&separator,
&test_alines,
&test_hlines,
&test_vlines,
&separator,
&test_resolution,
&separator,
&test_cube,
&separator,
&test_sqrt_libxt,
&test_sqrt_turkowski,
&test_sqrt_arm,
&test_sqrt_lut,
&test_sqrt_float,
NULL
};
int main(int argc, char **argv) {
if (argc == 2) {
const TestCase *test = XT_CMDLINE_PARSE(TestCase, test_cases, argv[1]);
if (test) {
test->test();
return 0;
}
}
printf("usage: %s <command>\n\n", argv[0]);
printf("Available commands:\n");
XT_CMDLINE_LIST(test_cases);
return 0;
}