]> www.ginac.de Git - cln.git/blob - tests/tests.cc
- Added lots of @cindex to produce an index.
[cln.git] / tests / tests.cc
1 #include <stdlib.h>
2 #include <string.h>
3 #include <cl_io.h>
4
5 extern int test_I (int iterations);
6 extern int test_MI (int iterations);
7 extern int test_nt (int iterations);
8
9 int test_all (int iterations)
10 {
11         int error = 0;
12         error |= test_I(iterations);
13         error |= test_MI(iterations);
14         error |= test_nt(iterations);
15         return error;
16 }
17
18 int main (int argc, char* argv[])
19 {
20         int iterations = 10000;
21         if ((argc >= 3) && !strcmp(argv[1],"-i")) {
22                 iterations = atoi(argv[2]);
23                 argc -= 2; argv += 2;
24         }
25         if (argc < 1)
26                 exit(1);
27
28         if (!test_all(iterations)) {
29                 fprint (cl_stdout, "Tests passed.\n");
30                 exit(0);
31         } else {
32                 fprint (cl_stdout, "Tests failed.\n");
33                 exit(1);
34         }
35 }