#!/usr/bin/env python
import os
import re
+import sys
from run_utils import Err, log, execute, getPlatformVersion, isColorEnabled, TempEnvDir
from run_long import LONG_TESTS_DEBUG_VALGRIND, longTestFilter
args = args[:]
exe = os.path.abspath(path)
if module == "java":
- cmd = [self.cache.ant_executable, "-Dopencv.build.type=%s" % self.cache.build_type, "buildAndTest"]
+ cmd = [self.cache.ant_executable, "-Dopencv.build.type=%s" % self.cache.build_type]
+ if self.options.package:
+ cmd += ["-Dopencv.test.package=%s" % self.options.package]
+ if self.options.java_test_exclude:
+ cmd += ["-Dopencv.test.exclude=%s" % self.options.java_test_exclude]
+ cmd += ["buildAndTest"]
ret = execute(cmd, cwd=self.cache.java_test_dir)
return None, ret
elif module in ['python2', 'python3']:
executable = os.getenv('OPENCV_PYTHON_BINARY', None)
+ if executable is None or module == 'python{}'.format(sys.version_info[0]):
+ executable = sys.executable
if executable is None:
executable = path
if not self.tryCommand([executable, '--version'], workingDir):