diff --git a/modules/ts/misc/run.py b/modules/ts/misc/run.py index 6d4507cd9d..d6e61d327d 100755 --- a/modules/ts/misc/run.py +++ b/modules/ts/misc/run.py @@ -849,6 +849,8 @@ if __name__ == "__main__": test_args.extend(["--perf_min_samples=1"]) if not [a for a in test_args if a.startswith("--perf_force_samples=")] : test_args.extend(["--perf_force_samples=1"]) + if not [a for a in test_args if a.startswith("--perf_verify_sanity")] : + test_args.extend(["--perf_verify_sanity"]) logs = [] test_list = [] diff --git a/modules/ts/src/ts_perf.cpp b/modules/ts/src/ts_perf.cpp index 25e81858e7..f34bdef139 100644 --- a/modules/ts/src/ts_perf.cpp +++ b/modules/ts/src/ts_perf.cpp @@ -16,7 +16,8 @@ const std::string command_line_keys = "{ |perf_force_samples |100 |force set maximum number of samples for all tests}" "{ |perf_seed |809564 |seed for random numbers generator}" "{ |perf_threads |-1 |the number of worker threads, if parallel execution is enabled}" - "{ |perf_write_sanity |false |allow to create new records for sanity checks}" + "{ |perf_write_sanity |false |create new records for sanity checks}" + "{ |perf_verify_sanity |false |fail tests having no regression data for sanity checks}" #ifdef ANDROID "{ |perf_time_limit |6.0 |default time limit for a single test (in seconds)}" "{ |perf_affinity_mask |0 |set affinity mask for the main thread}" @@ -41,6 +42,7 @@ static uint64 param_seed; static double param_time_limit; static int param_threads; static bool param_write_sanity; +static bool param_verify_sanity; #ifdef HAVE_CUDA static bool param_run_cpu; static int param_cuda_device; @@ -599,6 +601,10 @@ Regression& Regression::operator() (const std::string& name, cv::InputArray arra write(array); write() << "}"; } + else if(param_verify_sanity) + { + ADD_FAILURE() << " No regression data for " << name << " argument"; + } } else { @@ -657,6 +663,7 @@ void TestBase::Init(int argc, const char* const argv[]) param_time_limit = std::max(0., args.get("perf_time_limit")); param_force_samples = args.get("perf_force_samples"); param_write_sanity = args.get("perf_write_sanity"); + param_verify_sanity = args.get("perf_verify_sanity"); param_threads = args.get("perf_threads"); #ifdef ANDROID param_affinity_mask = args.get("perf_affinity_mask");