]> www.ginac.de Git - cln.git/blob - tests/tests.cc
* Fix typo.
[cln.git] / tests / tests.cc
1 #include <cstdlib>
2 #include <cstring>
3 #include <cln/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 using namespace std;
10 using namespace cln;
11
12 int test_all (int iterations)
13 {
14         int error = 0;
15         error |= test_I(iterations);
16         error |= test_MI(iterations);
17         error |= test_nt(iterations);
18         return error;
19 }
20
21 int main (int argc, char* argv[])
22 {
23         int iterations = 10000;
24         if ((argc >= 3) && !::strcmp(argv[1],"-i")) {
25                 iterations = atoi(argv[2]);
26                 argc -= 2; argv += 2;
27         }
28         if (argc < 1)
29                 exit(1);
30
31         if (!test_all(iterations)) {
32                 cout << "Tests passed." << endl;
33                 exit(0);
34         } else {
35                 cout << "Tests failed." << endl;
36                 exit(1);
37         }
38 }