Skip to content

Commit 8577f71

Browse files
committed
ts: 2.4 changes
1 parent 6f00e53 commit 8577f71

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

modules/ts/misc/run_suite.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def getTestList(self, white, black):
8585
return set(res)
8686

8787
def isTest(self, fullpath):
88-
if fullpath in ['java', 'python2', 'python3']:
88+
if fullpath in ['java', 'python', 'python2', 'python3']:
8989
return self.options.mode == 'test'
9090
if not os.path.isfile(fullpath):
9191
return False
@@ -117,7 +117,7 @@ def runTest(self, path, logfile, workingDir, args = []):
117117
cmd = [self.cache.ant_executable, "-Dopencv.build.type=%s" % self.cache.build_type, "buildAndTest"]
118118
ret = execute(cmd, cwd = self.cache.java_test_binary_dir + "/.build")
119119
return None, ret
120-
elif path in ['python2', 'python3']:
120+
elif path in ['python', 'python2', 'python3']:
121121
executable = os.getenv('OPENCV_PYTHON_BINARY', None)
122122
if executable is None:
123123
executable = path
@@ -164,7 +164,7 @@ def runTests(self, tests, black, workingDir, args = []):
164164
more_args = []
165165
exe = self.getTest(test)
166166

167-
if exe in ["java", "python2", "python3"]:
167+
if exe in ["java", "python", "python2", "python3"]:
168168
logname = None
169169
else:
170170
userlog = [a for a in args if a.startswith("--gtest_output=")]

modules/ts/misc/run_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ def testSIMD(compiler, cxx_flags, compiler_arg = None):
175175
{'name': "cuda_library", 'default': None, 'pattern': re.compile(r"^CUDA_CUDA_LIBRARY:FILEPATH=(.+)$")},
176176
{'name': "cuda_version", 'default': None, 'pattern': re.compile(r"^CUDA_VERSION:STRING=(.+)$")},
177177
{'name': "core_dependencies", 'default': None, 'pattern': re.compile(r"^opencv_core_LIB_DEPENDS:STATIC=(.+)$")},
178+
{'name': "python", 'default': None, 'pattern': re.compile(r"^BUILD_opencv_python:BOOL=(.*)$")},
178179
{'name': "python2", 'default': None, 'pattern': re.compile(r"^BUILD_opencv_python2:BOOL=(.*)$")},
179180
{'name': "python3", 'default': None, 'pattern': re.compile(r"^BUILD_opencv_python3:BOOL=(.*)$")},
180181
)
@@ -253,6 +254,8 @@ def gatherTests(self, mask, isGood = None):
253254
files = glob.glob(os.path.join(d, mask))
254255
if not self.getOS() == "android" and self.withJava():
255256
files.append("java")
257+
if self.withPython():
258+
files.append("python")
256259
if self.withPython2():
257260
files.append("python2")
258261
if self.withPython3():
@@ -261,14 +264,17 @@ def gatherTests(self, mask, isGood = None):
261264
return []
262265

263266
def isMainModule(self, name):
264-
return name in self.main_modules + ['python2', 'python3']
267+
return name in self.main_modules + ['python', 'python2', 'python3']
265268

266269
def withCuda(self):
267270
return self.cuda_version and self.with_cuda == "ON" and self.cuda_library and not self.cuda_library.endswith("-NOTFOUND")
268271

269272
def withJava(self):
270273
return self.ant_executable and self.java_test_binary_dir
271274

275+
def withPython(self):
276+
return self.python == 'ON'
277+
272278
def withPython2(self):
273279
return self.python2 == 'ON'
274280

0 commit comments

Comments
 (0)