diff options
Diffstat (limited to 'framework/Framework.cpp')
-rw-r--r-- | framework/Framework.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/framework/Framework.cpp b/framework/Framework.cpp index c25b3e5d4c..1f09550830 100644 --- a/framework/Framework.cpp +++ b/framework/Framework.cpp @@ -147,6 +147,11 @@ void Framework::log_test_end(const std::string &test_name) void Framework::log_failed_expectation(const std::string &msg) { std::cerr << "ERROR: " << msg << "\n"; + + if(_current_test_result != nullptr) + { + _current_test_result->status = TestResult::Status::FAILED; + } } int Framework::num_iterations() const @@ -201,7 +206,9 @@ void Framework::run_test(TestCaseFactory &test_factory) log_test_start(test_case_name); Profiler profiler = get_profiler(); - TestResult result; + TestResult result(TestResult::Status::SUCCESS); + + _current_test_result = &result; try { @@ -219,8 +226,6 @@ void Framework::run_test(TestCaseFactory &test_factory) } test_case->do_teardown(); - - result.status = TestResult::Status::SUCCESS; } catch(const TestError &error) { @@ -265,6 +270,7 @@ void Framework::run_test(TestCaseFactory &test_factory) catch(...) { std::cerr << "FATAL ERROR: Received unhandled exception during fixture creation\n"; + result.status = TestResult::Status::CRASHED; if(_throw_errors) { @@ -272,6 +278,8 @@ void Framework::run_test(TestCaseFactory &test_factory) } } + _current_test_result = nullptr; + result.measurements = profiler.measurements(); set_test_result(test_case_name, result); |