]> www.ginac.de Git - ginac.git/blob - check/main.cpp
ef74535d9ef63437dc4aaf62f3f93c5f602598e8
[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 <ginac/ginac.h>
24 #include "check.h"
25
26 int main()
27 {
28     unsigned result = 0;
29     
30     try {
31         for (int i=0; i<1; ++i) {
32             result += fcntimer(paranoia_check);
33             result += fcntimer(numeric_output);
34             result += fcntimer(numeric_consist);
35             result += fcntimer(powerlaws);
36             result += fcntimer(expand_subs);
37             result += fcntimer(inifcns_consist);
38             result += fcntimer(differentiation);
39             result += fcntimer(poly_gcd);
40             result += fcntimer(normalization);
41             result += fcntimer(matrix_checks);
42             result += fcntimer(lsolve_onedim);
43             result += fcntimer(series_expansion);
44         }
45     } catch (exception const & e) {
46         cout << "error: caught an exception: " << e.what() << endl;
47                 result++;
48     }
49     
50     if (result) {
51         cout << "error: something went wrong. ";
52         if (result == 1) {
53             cout << "(one failure)" << endl;
54         } else {
55             cout << "(" << result << " individual failures)" << endl;
56         }
57         cout << "please check result.out against result.ref for more details."
58              << endl << "happy debugging!" << endl;
59     }
60
61     return result;
62 }