mirror of
https://github.com/opencv/opencv.git
synced 2025-06-12 20:42:53 +08:00
ocl: skip unstable tests
during pre-commit testing
This commit is contained in:
parent
4781f0a337
commit
3a8a73ef6c
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
namespace cvtest {
|
namespace cvtest {
|
||||||
void checkIppStatus();
|
void checkIppStatus();
|
||||||
|
extern bool skipUnstableTests;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CV__TEST_INIT \
|
#define CV__TEST_INIT \
|
||||||
|
@ -92,6 +92,9 @@ if __name__ == "__main__":
|
|||||||
if not [a for a in test_args if a.startswith("--perf_verify_sanity")] :
|
if not [a for a in test_args if a.startswith("--perf_verify_sanity")] :
|
||||||
test_args.extend(["--perf_verify_sanity"])
|
test_args.extend(["--perf_verify_sanity"])
|
||||||
|
|
||||||
|
if bool(os.environ.get('BUILD_PRECOMMIT', None)):
|
||||||
|
test_args.extend(["--skip_unstable=1"])
|
||||||
|
|
||||||
ret = 0
|
ret = 0
|
||||||
logs = []
|
logs = []
|
||||||
for path in args.build_path:
|
for path in args.build_path:
|
||||||
|
@ -694,11 +694,14 @@ void checkIppStatus()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool skipUnstableTests = false;
|
||||||
|
|
||||||
void parseCustomOptions(int argc, char **argv)
|
void parseCustomOptions(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char * const command_line_keys =
|
const char * const command_line_keys =
|
||||||
"{ ipp test_ipp_check |false |check whether IPP works without failures }"
|
"{ ipp test_ipp_check |false |check whether IPP works without failures }"
|
||||||
"{ test_seed |809564 |seed for random numbers generator }"
|
"{ test_seed |809564 |seed for random numbers generator }"
|
||||||
|
"{ skip_unstable |false |skip unstable tests }"
|
||||||
"{ h help |false |print help info }";
|
"{ h help |false |print help info }";
|
||||||
|
|
||||||
cv::CommandLineParser parser(argc, argv, command_line_keys);
|
cv::CommandLineParser parser(argc, argv, command_line_keys);
|
||||||
@ -717,6 +720,8 @@ void parseCustomOptions(int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
param_seed = parser.get<unsigned int>("test_seed");
|
param_seed = parser.get<unsigned int>("test_seed");
|
||||||
|
|
||||||
|
skipUnstableTests = parser.get<bool>("skip_unstable");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -999,6 +999,7 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
|
|||||||
"{ perf_cuda_device |0 |run CUDA test suite onto specific CUDA capable device}"
|
"{ perf_cuda_device |0 |run CUDA test suite onto specific CUDA capable device}"
|
||||||
"{ perf_cuda_info_only |false |print an information about system and an available CUDA devices and then exit.}"
|
"{ perf_cuda_info_only |false |print an information about system and an available CUDA devices and then exit.}"
|
||||||
#endif
|
#endif
|
||||||
|
"{ skip_unstable |false |skip unstable tests }"
|
||||||
;
|
;
|
||||||
|
|
||||||
cv::CommandLineParser args(argc, argv, command_line_keys);
|
cv::CommandLineParser args(argc, argv, command_line_keys);
|
||||||
@ -1097,6 +1098,8 @@ void TestBase::Init(const std::vector<std::string> & availableImpls,
|
|||||||
exit(0);
|
exit(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
skipUnstableTests = args.get<bool>("skip_unstable");
|
||||||
|
|
||||||
if (available_impls.size() > 1)
|
if (available_impls.size() > 1)
|
||||||
printf("[----------]\n[ INFO ] \tImplementation variant: %s.\n[----------]\n", param_impl.c_str()), fflush(stdout);
|
printf("[----------]\n[ INFO ] \tImplementation variant: %s.\n[----------]\n", param_impl.c_str()), fflush(stdout);
|
||||||
|
|
||||||
|
@ -80,6 +80,15 @@ OCL_PERF_TEST_P(PyrLKOpticalFlowFixture, PyrLKOpticalFlow,
|
|||||||
const PyrLKOpticalFlowParams params = GetParam();
|
const PyrLKOpticalFlowParams params = GetParam();
|
||||||
const int pointsCount = get<0>(params);
|
const int pointsCount = get<0>(params);
|
||||||
|
|
||||||
|
// SKIP unstable tests
|
||||||
|
#ifdef __linux__
|
||||||
|
if (cvtest::skipUnstableTests && ocl::useOpenCL())
|
||||||
|
{
|
||||||
|
if (ocl::Device::getDefault().isIntel())
|
||||||
|
throw ::perf::TestBase::PerfSkipTestException();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
vector<Point2f> pts;
|
vector<Point2f> pts;
|
||||||
goodFeaturesToTrack(frame0, pts, pointsCount, 0.01, 0.0);
|
goodFeaturesToTrack(frame0, pts, pointsCount, 0.01, 0.0);
|
||||||
Mat ptsMat(1, static_cast<int>(pts.size()), CV_32FC2, (void *)&pts[0]);
|
Mat ptsMat(1, static_cast<int>(pts.size()), CV_32FC2, (void *)&pts[0]);
|
||||||
|
@ -87,6 +87,15 @@ OCL_TEST_P(PyrLKOpticalFlow, Mat)
|
|||||||
ASSERT_FALSE(frame1.empty());
|
ASSERT_FALSE(frame1.empty());
|
||||||
UMat umatFrame1; frame1.copyTo(umatFrame1);
|
UMat umatFrame1; frame1.copyTo(umatFrame1);
|
||||||
|
|
||||||
|
// SKIP unstable tests
|
||||||
|
#ifdef __linux__
|
||||||
|
if (cvtest::skipUnstableTests && ocl::useOpenCL())
|
||||||
|
{
|
||||||
|
if (ocl::Device::getDefault().isIntel())
|
||||||
|
throw cvtest::SkipTestException("Skip unstable test");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
std::vector<cv::Point2f> pts;
|
std::vector<cv::Point2f> pts;
|
||||||
cv::goodFeaturesToTrack(frame0, pts, npoints, 0.01, 0.0);
|
cv::goodFeaturesToTrack(frame0, pts, npoints, 0.01, 0.0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user