2005-08-11 13:06:52 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int test_main();
|
|
|
|
|
|
|
|
bool tests_failure = false;
|
|
|
|
|
|
|
|
void report_failure(char const* err, char const* file, int line)
|
|
|
|
{
|
2008-03-21 06:54:01 +01:00
|
|
|
std::cerr << "\033[31m" << file << ":" << line << " \"" << err << "\"\033[0m\n";
|
2005-08-11 13:06:52 +02:00
|
|
|
tests_failure = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
test_main();
|
|
|
|
return tests_failure ? 1 : 0;
|
|
|
|
}
|
|
|
|
catch (std::exception const& e)
|
|
|
|
{
|
|
|
|
std::cerr << "Terminated with exception: \"" << e.what() << "\"\n";
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
catch (...)
|
|
|
|
{
|
|
|
|
std::cerr << "Terminated with unknown exception\n";
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|