mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Final test report now includes the test failure message
This commit is contained in:
parent
cfef764ab9
commit
6d16ffaddf
|
@ -20,7 +20,7 @@
|
||||||
catch (...) \
|
catch (...) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
throw xlnt::exception("test failed -> " XLNT_STRINGIFY(expression)); \
|
throw xlnt::exception("assert failed -> " XLNT_STRINGIFY(expression)); \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
#define xlnt_assert_throws_nothing(expression) \
|
#define xlnt_assert_throws_nothing(expression) \
|
||||||
|
@ -34,7 +34,7 @@
|
||||||
catch (...) \
|
catch (...) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
throw xlnt::exception("test failed -> " XLNT_STRINGIFY(expression)); \
|
throw xlnt::exception("assert throws nothing failed -> " XLNT_STRINGIFY(expression)); \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
#define xlnt_assert_throws(expression, exception_type) \
|
#define xlnt_assert_throws(expression, exception_type) \
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
catch (...) \
|
catch (...) \
|
||||||
{ \
|
{ \
|
||||||
} \
|
} \
|
||||||
throw xlnt::exception("test failed -> " XLNT_STRINGIFY(expression)); \
|
throw xlnt::exception("assert throws failed -> " XLNT_STRINGIFY(expression)); \
|
||||||
} while (false)
|
} while (false)
|
||||||
|
|
||||||
#define xlnt_assert_equals(left, right) xlnt_assert(left == right)
|
#define xlnt_assert_equals(left, right) xlnt_assert(left == right)
|
||||||
|
|
|
@ -41,16 +41,15 @@ public:
|
||||||
}
|
}
|
||||||
catch (std::exception &ex)
|
catch (std::exception &ex)
|
||||||
{
|
{
|
||||||
|
std::string fail_msg = test.second + " failed with:\n" + std::string(ex.what());
|
||||||
std::cout << "*\n"
|
std::cout << "*\n"
|
||||||
<< test.second << " failed with:\n"
|
<< fail_msg << '\n';
|
||||||
<< ex.what() << '\n';
|
|
||||||
status.tests_failed++;
|
status.tests_failed++;
|
||||||
status.failures.push_back(test.second);
|
status.failures.push_back(fail_msg);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
std::cout << "*\n"
|
std::cout << "*\n" << test.second << " failed\n";
|
||||||
<< test.second << " failed" << '\n';
|
|
||||||
status.tests_failed++;
|
status.tests_failed++;
|
||||||
status.failures.push_back(test.second);
|
status.failures.push_back(test.second);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,11 +63,11 @@ void run_tests()
|
||||||
|
|
||||||
void print_summary()
|
void print_summary()
|
||||||
{
|
{
|
||||||
std::cout << std::endl;
|
std::cout << "\n\n";
|
||||||
|
|
||||||
for (auto failure : overall_status.failures)
|
for (auto failure : overall_status.failures)
|
||||||
{
|
{
|
||||||
std::cout << failure << " failed" << std::endl;
|
std::cout << failure << "\n\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user