]> www.ginac.de Git - ginac.git/blob - check/exams.cpp
location of C++ FAQ Lite has changed
[ginac.git] / check / exams.cpp
1 /** @file exams.cpp
2  *
3  *  Main program that calls all individual exams. */
4
5 /*
6  *  GiNaC Copyright (C) 1999-2003 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
25 #include "exams.h"
26
27 int main()
28 {
29         unsigned result = 0;
30
31 #define EXAM(which) \
32 try { \
33         result += exam_ ## which (); \
34 } catch (const exception &e) { \
35         cout << "Error: caught exception " << e.what() << endl; \
36         ++result; \
37 }
38         
39         EXAM(paranoia)
40         EXAM(numeric)
41         EXAM(powerlaws)
42         EXAM(inifcns)
43         EXAM(inifcns_nstdsums)
44         EXAM(differentiation)
45         EXAM(polygcd)
46         EXAM(normalization)
47         EXAM(pseries)
48         EXAM(matrices)
49         EXAM(lsolve)
50         EXAM(indexed)
51         EXAM(color)
52         EXAM(clifford)
53         EXAM(archive)
54         EXAM(structure)
55         EXAM(hashmap)
56         EXAM(misc)
57         
58         if (result) {
59                 cout << "Error: something went wrong. ";
60                 if (result == 1) {
61                         cout << "(one failure)" << endl;
62                 } else {
63                         cout << "(" << result << " individual failures)" << endl;
64                 }
65                 cout << "please check exams.out against exams.ref for more details."
66                      << endl << "happy debugging!" << endl;
67         }
68         
69         return result;
70 }