diff --git a/tests/helpers/assertions.hpp b/tests/helpers/assertions.hpp index 18bcaa03..27b72040 100644 --- a/tests/helpers/assertions.hpp +++ b/tests/helpers/assertions.hpp @@ -20,7 +20,7 @@ catch (...) \ { \ } \ - throw xlnt::exception("test failed -> " XLNT_STRINGIFY(expression)); \ + throw xlnt::exception("assert failed -> " XLNT_STRINGIFY(expression)); \ } while (false) #define xlnt_assert_throws_nothing(expression) \ @@ -34,7 +34,7 @@ catch (...) \ { \ } \ - throw xlnt::exception("test failed -> " XLNT_STRINGIFY(expression)); \ + throw xlnt::exception("assert throws nothing failed -> " XLNT_STRINGIFY(expression)); \ } while (false) #define xlnt_assert_throws(expression, exception_type) \ @@ -51,7 +51,7 @@ catch (...) \ { \ } \ - throw xlnt::exception("test failed -> " XLNT_STRINGIFY(expression)); \ + throw xlnt::exception("assert throws failed -> " XLNT_STRINGIFY(expression)); \ } while (false) #define xlnt_assert_equals(left, right) xlnt_assert(left == right) diff --git a/tests/helpers/test_suite.hpp b/tests/helpers/test_suite.hpp index 6083b052..02460d96 100644 --- a/tests/helpers/test_suite.hpp +++ b/tests/helpers/test_suite.hpp @@ -41,16 +41,15 @@ public: } catch (std::exception &ex) { + std::string fail_msg = test.second + " failed with:\n" + std::string(ex.what()); std::cout << "*\n" - << test.second << " failed with:\n" - << ex.what() << '\n'; + << fail_msg << '\n'; status.tests_failed++; - status.failures.push_back(test.second); + status.failures.push_back(fail_msg); } catch (...) { - std::cout << "*\n" - << test.second << " failed" << '\n'; + std::cout << "*\n" << test.second << " failed\n"; status.tests_failed++; status.failures.push_back(test.second); } diff --git a/tests/runner.cpp b/tests/runner.cpp index 5ecd2697..08a589f2 100644 --- a/tests/runner.cpp +++ b/tests/runner.cpp @@ -63,11 +63,11 @@ void run_tests() void print_summary() { - std::cout << std::endl; + std::cout << "\n\n"; for (auto failure : overall_status.failures) { - std::cout << failure << " failed" << std::endl; + std::cout << failure << "\n\n"; } }