Skip to content

Commit 3a8a73e

Browse files
committed
ocl: skip unstable tests
during pre-commit testing
1 parent 4781f0a commit 3a8a73e

File tree

6 files changed

+30
-0
lines changed

6 files changed

+30
-0
lines changed

modules/ts/include/opencv2/ts/ts_ext.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace cvtest {
1212
void checkIppStatus();
13+
extern bool skipUnstableTests;
1314
}
1415

1516
#define CV__TEST_INIT \

modules/ts/misc/run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
if not [a for a in test_args if a.startswith("--perf_verify_sanity")] :
9393
test_args.extend(["--perf_verify_sanity"])
9494

95+
if bool(os.environ.get('BUILD_PRECOMMIT', None)):
96+
test_args.extend(["--skip_unstable=1"])
97+
9598
ret = 0
9699
logs = []
97100
for path in args.build_path:

modules/ts/src/ts.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,11 +694,14 @@ void checkIppStatus()
694694
}
695695
}
696696

697+
bool skipUnstableTests = false;
698+
697699
void parseCustomOptions(int argc, char **argv)
698700
{
699701
const char * const command_line_keys =
700702
"{ ipp test_ipp_check |false |check whether IPP works without failures }"
701703
"{ test_seed |809564 |seed for random numbers generator }"
704+
"{ skip_unstable |false |skip unstable tests }"
702705
"{ h help |false |print help info }";
703706

704707
cv::CommandLineParser parser(argc, argv, command_line_keys);
@@ -717,6 +720,8 @@ void parseCustomOptions(int argc, char **argv)
717720
#endif
718721

719722
param_seed = parser.get<unsigned int>("test_seed");
723+
724+
skipUnstableTests = parser.get<bool>("skip_unstable");
720725
}
721726

722727

modules/ts/src/ts_perf.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,7 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
999999
"{ perf_cuda_device |0 |run CUDA test suite onto specific CUDA capable device}"
10001000
"{ perf_cuda_info_only |false |print an information about system and an available CUDA devices and then exit.}"
10011001
#endif
1002+
"{ skip_unstable |false |skip unstable tests }"
10021003
;
10031004

10041005
cv::CommandLineParser args(argc, argv, command_line_keys);
@@ -1097,6 +1098,8 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
10971098
exit(0);
10981099
#endif
10991100

1101+
skipUnstableTests = args.get<bool>("skip_unstable");
1102+
11001103
if (available_impls.size() > 1)
11011104
printf("[----------]\n[ INFO ] \tImplementation variant: %s.\n[----------]\n", param_impl.c_str()), fflush(stdout);
11021105

modules/video/perf/opencl/perf_optflow_pyrlk.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,15 @@ OCL_PERF_TEST_P(PyrLKOpticalFlowFixture, PyrLKOpticalFlow,
8080
const PyrLKOpticalFlowParams params = GetParam();
8181
const int pointsCount = get<0>(params);
8282

83+
// SKIP unstable tests
84+
#ifdef __linux__
85+
if (cvtest::skipUnstableTests && ocl::useOpenCL())
86+
{
87+
if (ocl::Device::getDefault().isIntel())
88+
throw ::perf::TestBase::PerfSkipTestException();
89+
}
90+
#endif
91+
8392
vector<Point2f> pts;
8493
goodFeaturesToTrack(frame0, pts, pointsCount, 0.01, 0.0);
8594
Mat ptsMat(1, static_cast<int>(pts.size()), CV_32FC2, (void *)&pts[0]);

modules/video/test/ocl/test_optflowpyrlk.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ OCL_TEST_P(PyrLKOpticalFlow, Mat)
8787
ASSERT_FALSE(frame1.empty());
8888
UMat umatFrame1; frame1.copyTo(umatFrame1);
8989

90+
// SKIP unstable tests
91+
#ifdef __linux__
92+
if (cvtest::skipUnstableTests && ocl::useOpenCL())
93+
{
94+
if (ocl::Device::getDefault().isIntel())
95+
throw cvtest::SkipTestException("Skip unstable test");
96+
}
97+
#endif
98+
9099
std::vector<cv::Point2f> pts;
91100
cv::goodFeaturesToTrack(frame0, pts, npoints, 0.01, 0.0);
92101

0 commit comments

Comments
 (0)