Merge pull request #20146 from asmorkalov:as/java_test_filter

pull/20207/head^2
Alexander Alekhin 4 years ago
commit 7d91dfe339
  1. 3
      modules/java/test/pure_test/build.xml
  2. 1
      modules/ts/misc/run.py
  3. 2
      modules/ts/misc/run_suite.py

@ -6,6 +6,7 @@
<property name="opencv.test.package" value="*"/>
<property name="opencv.test.class" value="*"/>
<property name="opencv.test.exclude" value=""/>
<path id="master-classpath">
<fileset dir="lib">
@ -53,7 +54,7 @@
<formatter type="xml"/>
<batchtest fork="yes" todir="${test.dir}">
<zipfileset src="build/jar/opencv-test.jar" includes="**/${opencv.test.package}/${opencv.test.class}.class" excludes="**/OpenCVTest*">
<zipfileset src="build/jar/opencv-test.jar" includes="**/${opencv.test.package}/${opencv.test.class}.class" excludes="**/OpenCVTest*, ${opencv.test.exclude}">
<exclude name="**/*$*.class"/>
</zipfileset>
</batchtest>

@ -51,6 +51,7 @@ if __name__ == "__main__":
parser.add_argument("--android_propagate_opencv_env", action="store_true", default=False, help="Android: propagate OPENCV* environment variables")
parser.add_argument("--serial", metavar="serial number", default="", help="Android: directs command to the USB device or emulator with the given serial number")
parser.add_argument("--package", metavar="package", default="", help="Java: run JUnit tests for specified module or Android package")
parser.add_argument("--java_test_exclude", metavar="java_test_exclude", default="", help="Java: Filter out specific JUnit tests")
parser.add_argument("--trace", action="store_true", default=False, help="Trace: enable OpenCV tracing")
parser.add_argument("--trace_dump", metavar="trace_dump", default=-1, help="Trace: dump highlight calls (specify max entries count, 0 - dump all)")

@ -115,6 +115,8 @@ class TestSuite(object):
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

Loading…
Cancel
Save