mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -40,6 +40,9 @@ if __name__ == "__main__":
|
||||
parser.add_argument("--valgrind_supp", metavar="FILE", action='append', help="Path to valgrind suppression file (example: --valgrind_supp opencv/platforms/scripts/valgrind.supp)")
|
||||
parser.add_argument("--valgrind_opt", metavar="OPT", action="append", default=[], help="Add command line option to valgrind (example: --valgrind_opt=--leak-check=full)")
|
||||
|
||||
# QEMU
|
||||
parser.add_argument("--qemu", default="", help="Specify qemu binary and base parameters")
|
||||
|
||||
# Android
|
||||
parser.add_argument("--android", action="store_true", default=False, help="Android: force all tests to run on device")
|
||||
parser.add_argument("--android_sdk", metavar="PATH", help="Android: path to SDK to use adb and aapt tools")
|
||||
|
||||
@@ -77,7 +77,7 @@ class TestSuite(object):
|
||||
return False
|
||||
return os.access(fullpath, os.X_OK)
|
||||
|
||||
def wrapInValgrind(self, cmd=[]):
|
||||
def wrapCommand(self, cmd, env):
|
||||
if self.options.valgrind:
|
||||
res = ['valgrind']
|
||||
supp = self.options.valgrind_supp or []
|
||||
@@ -89,6 +89,14 @@ class TestSuite(object):
|
||||
res.extend(self.options.valgrind_opt)
|
||||
has_gtest_filter = next((True for x in cmd if x.startswith('--gtest_filter=')), False)
|
||||
return res + cmd + ([longTestFilter(LONG_TESTS_DEBUG_VALGRIND)] if not has_gtest_filter else [])
|
||||
elif self.options.qemu:
|
||||
import shlex
|
||||
res = shlex.split(self.options.qemu)
|
||||
for (name, value) in [entry for entry in os.environ.items() if entry[0].startswith('OPENCV') and not entry[0] in env]:
|
||||
res += ['-E', '"{}={}"'.format(name, value)]
|
||||
for (name, value) in env.items():
|
||||
res += ['-E', '"{}={}"'.format(name, value)]
|
||||
return res + ['--'] + cmd
|
||||
return cmd
|
||||
|
||||
def tryCommand(self, cmd, workingDir):
|
||||
@@ -125,7 +133,6 @@ class TestSuite(object):
|
||||
else:
|
||||
if isColorEnabled(args):
|
||||
args.append("--gtest_color=yes")
|
||||
cmd = self.wrapInValgrind([exe] + args)
|
||||
env = {}
|
||||
if not self.options.valgrind and self.options.trace:
|
||||
env['OPENCV_TRACE'] = '1'
|
||||
@@ -133,6 +140,7 @@ class TestSuite(object):
|
||||
env['OPENCV_TRACE_SYNC_OPENCL'] = '1'
|
||||
tempDir = TempEnvDir('OPENCV_TEMP_PATH', "__opencv_temp.")
|
||||
tempDir.init()
|
||||
cmd = self.wrapCommand([exe] + args, env)
|
||||
log.warning("Run: %s" % " ".join(cmd))
|
||||
ret = execute(cmd, cwd=workingDir, env=env)
|
||||
try:
|
||||
|
||||
@@ -721,6 +721,7 @@ void checkIppStatus()
|
||||
}
|
||||
}
|
||||
|
||||
static bool checkTestData = false;
|
||||
bool skipUnstableTests = false;
|
||||
bool runBigDataTests = false;
|
||||
int testThreads = 0;
|
||||
@@ -733,6 +734,7 @@ void parseCustomOptions(int argc, char **argv)
|
||||
"{ test_threads |-1 |the number of worker threads, if parallel execution is enabled}"
|
||||
"{ skip_unstable |false |skip unstable tests }"
|
||||
"{ test_bigdata |false |run BigData tests (>=2Gb) }"
|
||||
"{ test_require_data |false |fail on missing non-required test data instead of skip}"
|
||||
"{ h help |false |print help info }";
|
||||
|
||||
cv::CommandLineParser parser(argc, argv, command_line_keys);
|
||||
@@ -756,6 +758,7 @@ void parseCustomOptions(int argc, char **argv)
|
||||
|
||||
skipUnstableTests = parser.get<bool>("skip_unstable");
|
||||
runBigDataTests = parser.get<bool>("test_bigdata");
|
||||
checkTestData = parser.get<bool>("test_require_data");
|
||||
}
|
||||
|
||||
|
||||
@@ -870,7 +873,7 @@ static std::string findData(const std::string& relative_path, bool required, boo
|
||||
#endif
|
||||
#endif
|
||||
const char* type = findDirectory ? "directory" : "data file";
|
||||
if (required)
|
||||
if (required || checkTestData)
|
||||
CV_Error(cv::Error::StsError, cv::format("OpenCV tests: Can't find required %s: %s", type, relative_path.c_str()));
|
||||
throw SkipTestException(cv::format("OpenCV tests: Can't find %s: %s", type, relative_path.c_str()));
|
||||
}
|
||||
|
||||
+1426
-435
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user