diff options
author | Moritz Pflanzer <moritz.pflanzer@arm.com> | 2017-07-18 12:20:45 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:16:42 +0100 |
commit | e1103a80ca1abd7aeda615d0addfa6f6abae664d (patch) | |
tree | 273005a74e6e19865298a499defbd8eca8f5a3ea /framework/Framework.cpp | |
parent | 15d5ac8dd039132926ac8012559ca5e3a405f858 (diff) | |
download | ComputeLibrary-e1103a80ca1abd7aeda615d0addfa6f6abae664d.tar.gz |
COMPMID-415: Fix failed expectations
Change-Id: I53dfdb6fcfa6318b8ca43b373941aa8233c8e6d1
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80898
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
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); |