Commit 6151a6ea authored by Andrey Kamaev's avatar Andrey Kamaev

Make SANITY_CHECK required for all performance tests

parent 94b97b7a
This diff is collapsed.
...@@ -97,8 +97,9 @@ Regression& Regression::instance() ...@@ -97,8 +97,9 @@ Regression& Regression::instance()
return single; return single;
} }
Regression& Regression::add(const std::string& name, cv::InputArray array, double eps, ERROR_TYPE err) Regression& Regression::add(TestBase* test, const std::string& name, cv::InputArray array, double eps, ERROR_TYPE err)
{ {
if(test) test->verified = true;
return instance()(name, array, eps, err); return instance()(name, array, eps, err);
} }
...@@ -493,6 +494,7 @@ Regression& Regression::operator() (const std::string& name, cv::InputArray arra ...@@ -493,6 +494,7 @@ Regression& Regression::operator() (const std::string& name, cv::InputArray arra
else else
verify(this_arg, array, eps, err); verify(this_arg, array, eps, err);
} }
return *this; return *this;
} }
...@@ -914,6 +916,7 @@ void TestBase::SetUp() ...@@ -914,6 +916,7 @@ void TestBase::SetUp()
if (param_affinity_mask) if (param_affinity_mask)
setCurrentThreadAffinityMask(param_affinity_mask); setCurrentThreadAffinityMask(param_affinity_mask);
#endif #endif
verified = false;
lastTime = 0; lastTime = 0;
totalTime = 0; totalTime = 0;
runsPerIteration = 1; runsPerIteration = 1;
...@@ -926,6 +929,9 @@ void TestBase::SetUp() ...@@ -926,6 +929,9 @@ void TestBase::SetUp()
void TestBase::TearDown() void TestBase::TearDown()
{ {
if (!HasFailure() && !verified)
ADD_FAILURE() << "The test has no sanity checks. There should be at least one check at the end of performance test.";
validateMetrics(); validateMetrics();
if (HasFailure()) if (HasFailure())
reportMetrics(false); reportMetrics(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment