]> www.ginac.de Git - ginac.git/blob - check/main.cpp
- tutorial now built with texinfo
[ginac.git] / check / main.cpp
1 /** @file main.cpp
2  *
3  *  Main program that calls all individual tests. */
4
5 /*
6  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #include <stdexcept>
24 #include <iostream>
25
26 #include "check.h"
27
28 int main()
29 {
30     unsigned result = 0;
31     
32     try {
33         for (int i=0; i<1; ++i) {
34             result += fcntimer(paranoia_check);
35             result += fcntimer(numeric_output);
36             result += fcntimer(numeric_consist);
37             result += fcntimer(powerlaws);
38             result += fcntimer(expand_subs);
39             result += fcntimer(inifcns_consist);
40             result += fcntimer(differentiation);
41             result += fcntimer(poly_gcd);
42             result += fcntimer(normalization);
43             result += fcntimer(matrix_checks);
44             result += fcntimer(lsolve_onedim);
45             result += fcntimer(series_expansion);
46         }
47     } catch (exception const & e) {
48         cout << "error: caught an exception: " << e.what() << endl;
49                 result++;
50     }
51     
52     if (result) {
53         cout << "error: something went wrong. ";
54         if (result == 1) {
55             cout << "(one failure)" << endl;
56         } else {
57             cout << "(" << result << " individual failures)" << endl;
58         }
59         cout << "please check result.out against result.ref for more details."
60              << endl << "happy debugging!" << endl;
61     }
62
63     return result;
64 }