]> www.ginac.de Git - ginac.git/blob - check/exams.cpp
- Bernard Parisse's patch for Order_eval().
[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-2000 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     try {
33         result += exam_paranoia();
34     } catch (const exception &e) {
35         cout << "Error: caught exception " << e.what() << endl;
36         ++result;
37     }
38     
39     try {
40         result += exam_numeric();
41     } catch (const exception &e) {
42         cout << "Error: caught exception " << e.what() << endl;
43         ++result;
44     }
45     
46     try {
47         result += exam_powerlaws();
48     } catch (const exception &e) {
49         cout << "Error: caught exception " << e.what() << endl;
50         ++result;
51     }
52     
53     try {
54         result += exam_inifcns();
55     } catch (const exception &e) {
56         cout << "Error: caught exception " << e.what() << endl;
57         ++result;
58     }
59     
60     try {
61         result += exam_differentiation();
62     } catch (const exception &e) {
63         cout << "Error: caught exception " << e.what() << endl;
64         ++result;
65     }
66     
67     try {
68         result += exam_polygcd();
69     } catch (const exception &e) {
70         cout << "Error: caught exception " << e.what() << endl;
71         ++result;
72     }
73     
74     try {
75         result += exam_normalization();
76     } catch (const exception &e) {
77         cout << "Error: caught exception " << e.what() << endl;
78         ++result;
79     }
80     
81     try {
82         result += exam_pseries();
83     } catch (const exception &e) {
84         cout << "Error: caught exception " << e.what() << endl;
85         ++result;
86     }
87     
88     try {
89         result += exam_matrices();
90     } catch (const exception &e) {
91         cout << "Error: caught exception " << e.what() << endl;
92         ++result;
93     }
94     
95     try {
96         result += exam_lsolve();
97     } catch (const exception &e) {
98         cout << "Error: caught exception " << e.what() << endl;
99         ++result;
100     }
101     
102     try {
103         result += exam_noncommut();
104     } catch (const exception &e) {
105         cout << "Error: caught exception " << e.what() << endl;
106         ++result;
107     }
108     
109     try {
110         result += exam_misc();
111     } catch (const exception &e) {
112         cout << "Error: caught exception " << e.what() << endl;
113         ++result;
114     }
115     
116     if (result) {
117         cout << "Error: something went wrong. ";
118         if (result == 1) {
119             cout << "(one failure)" << endl;
120         } else {
121             cout << "(" << result << " individual failures)" << endl;
122         }
123         cout << "please check exams.out against exams.ref for more details."
124              << endl << "happy debugging!" << endl;
125     }
126     
127     return result;
128 }