* Main program that calls the individual tests. */
/*
- * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
unsigned result = 0;
srand((unsigned)time(NULL));
+
+#define CHECK(which) \
+try { \
+ for (int i=0; i<1; ++i) \
+ result += check_ ## which (); \
+} catch (const exception &e) { \
+ cout << "Error: caught exception " << e.what() << endl; \
+ ++result; \
+}
- try {
- for (int i=0; i<1; ++i)
- result += check_numeric();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- for (int i=0; i<1; ++i)
- result += check_inifcns();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- for (int i=0; i<1; ++i)
- result += check_matrices();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- for (int i=0; i<1; ++i)
- result += check_lsolve();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
+ CHECK(numeric)
+ CHECK(inifcns)
+ CHECK(matrices)
+ CHECK(lsolve)
if (result) {
cout << "Error: something went wrong. ";
cout << "(" << result << " individual failures)" << endl;
}
cout << "please check checks.out against check.ref for more details."
- << endl << "happy debugging!" << endl;
+ << endl << "happy debugging!" << endl;
}
return result;