33#include < print>
44#include < chrono>
55
6+ #include < rsl/source_location>
67#include < rsl/testing/assert.hpp>
78#include < rsl/testing/test.hpp>
89#include < rsl/testing/output.hpp>
@@ -43,7 +44,7 @@ void failure_handler(libassert::assertion_info const& info) {
4344 auto trace = info.get_stacktrace ();
4445 cleanup_frames (trace, rsl::testing::_testing_impl::assertion_counter ().test_name );
4546 message += trace.to_string (Colorize);
46- throw rsl::testing::assertion_failure (message);
47+ throw rsl::testing::assertion_failure (message, rsl::source_location (info. file_name , info. function , info. line ) );
4748}
4849
4950namespace rsl ::testing {
@@ -101,7 +102,7 @@ bool TestNamespace::run(Reporter* reporter) {
101102 reporter->before_test (TestCase{&test, +[]{}, std::string (test.name )});
102103
103104 // TODO stringify skipped tests properly
104- auto result = TestResult{&test, std::string (test.name ) + " (...)" , TestOutcome::PASS };
105+ auto result = TestResult{&test, std::string (test.name ) + " (...)" , TestOutcome::SKIP };
105106 reporter->after_test (result);
106107 results.push_back (result);
107108 }
@@ -128,15 +129,15 @@ TestResult TestCase::run() const {
128129 ret.duration_ms = std::chrono::duration<double , std::milli>(t1 - t0).count ();
129130 return ret;
130131 } catch (assertion_failure const & failure) {
131- ret.failure + = failure. what () ;
132+ ret.failure = failure;
132133 } catch (std::exception const & exc) { //
133134 ret.exception += exc.what ();
134135 } catch (std::string const & msg) { //
135- ret.failure += msg;
136+ ret.exception += msg;
136137 } catch (std::string_view msg) { //
137- ret.failure += msg;
138+ ret.exception += msg;
138139 } catch (char const * msg) { //
139- ret.failure += msg;
140+ ret.exception += msg;
140141 } catch (...) { ret.exception += " unknown exception thrown" ; }
141142
142143 ret.outcome = TestOutcome (test->expect_failure );
0 commit comments