]> www.ginac.de Git - ginac.git/blob - check/exams.cpp
* Example: Don't confuse users with _ex0().
[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-2001 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 "exams.h"
27
28 int main()
29 {
30         unsigned result = 0;
31
32 #define EXAM(which) \
33 try { \
34         result += exam_ ## which (); \
35 } catch (const exception &e) { \
36         cout << "Error: caught exception " << e.what() << endl; \
37         ++result; \
38 }
39         
40         EXAM(paranoia)
41         EXAM(numeric)
42         EXAM(powerlaws)
43         EXAM(inifcns)
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(misc)
55         
56         if (result) {
57                 cout << "Error: something went wrong. ";
58                 if (result == 1) {
59                         cout << "(one failure)" << endl;
60                 } else {
61                         cout << "(" << result << " individual failures)" << endl;
62                 }
63                 cout << "please check exams.out against exams.ref for more details."
64                      << endl << "happy debugging!" << endl;
65         }
66         
67         return result;
68 }