diff options
author | Moritz Pflanzer <moritz.pflanzer@arm.com> | 2017-07-31 14:48:45 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-09-17 14:16:42 +0100 |
commit | e33eb645664e3525086a01b27674febc99ecf5c3 (patch) | |
tree | 686288bfa8709efc16858c58b369a247e79a1925 /framework | |
parent | b3d2579b567eabd98fdb4861bf1380fefa18c9aa (diff) | |
download | ComputeLibrary-e33eb645664e3525086a01b27674febc99ecf5c3.tar.gz |
COMPMID-415: Fix new validation
Change-Id: I013d8665afc4e5674b1ff229c44669abd714f690
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/82228
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/Framework.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/framework/Framework.cpp b/framework/Framework.cpp index 008c4c00eb..5a2b02fb21 100644 --- a/framework/Framework.cpp +++ b/framework/Framework.cpp @@ -221,7 +221,7 @@ void Framework::run_test(const TestInfo &info, TestCaseFactory &test_factory) log_test_start(info); Profiler profiler = get_profiler(); - TestResult result(TestResult::Status::SUCCESS); + TestResult result(TestResult::Status::NOT_RUN); _current_test_result = &result; @@ -247,6 +247,12 @@ void Framework::run_test(const TestInfo &info, TestCaseFactory &test_factory) } test_case->do_teardown(); + + // Change status to success if no error has happend + if(result.status == TestResult::Status::NOT_RUN) + { + result.status = TestResult::Status::SUCCESS; + } } catch(const TestError &error) { @@ -314,6 +320,8 @@ void Framework::run_test(const TestInfo &info, TestCaseFactory &test_factory) std::cerr << "FATAL ERROR: Received unhandled error during fixture creation: '" << error.what() << "'\n"; } + result.status = TestResult::Status::CRASHED; + if(_throw_errors) { throw; @@ -342,7 +350,11 @@ void Framework::run_test(const TestInfo &info, TestCaseFactory &test_factory) { result.status = TestResult::Status::EXPECTED_FAILURE; } - else if(_stop_on_error) + } + + if(result.status == TestResult::Status::FAILED || result.status == TestResult::Status::CRASHED) + { + if(_stop_on_error) { throw std::runtime_error("Abort on first error."); } |