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