]> www.ginac.de Git - ginac.git/blob - check/times.cpp
* Headers only include <iosfwd> from now on, since that contains all the
[ginac.git] / check / times.cpp
1 /** @file times.cpp
2  *
3  *  Main program that calls the individual timings. */
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 "times.h"
25
26 int main()
27 {
28         unsigned result = 0;
29         
30 #define TIME(which) \
31 try { \
32         result += time_ ## which (); \
33 } catch (const exception &e) { \
34         cout << "Error: caught exception " << e.what() << endl; \
35         ++result; \
36 }
37
38         TIME(dennyfliegner)
39         TIME(gammaseries)
40         TIME(vandermonde)
41         TIME(toeplitz)
42         TIME(lw_A)
43         TIME(lw_B)
44         TIME(lw_C)
45         TIME(lw_D)
46         TIME(lw_E)
47         TIME(lw_F)
48         TIME(lw_G)
49         TIME(lw_H)
50         TIME(lw_IJKL)
51         TIME(lw_M1)
52         TIME(lw_M2)
53         TIME(lw_N)
54         TIME(lw_O)
55         TIME(lw_P)
56         TIME(lw_Pprime)
57         TIME(lw_Q)
58         TIME(lw_Qprime)
59         TIME(antipode)
60         
61         if (result) {
62                 cout << "Error: something went wrong. ";
63                 if (result == 1) {
64                         cout << "(one failure)" << endl;
65                 } else {
66                         cout << "(" << result << " individual failures)" << endl;
67                 }
68                 cout << "please check times.out against times.ref for more details."
69                      << endl << "happy debugging!" << endl;
70         }
71         
72         return result;
73 }