From 1212aef03b07ff6f946a264a7d54c56f2483abad Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 24 May 2021 15:10:38 +0300 Subject: [PATCH] Analog of gtest_filter for java tests. --- modules/java/test/pure_test/build.xml | 3 ++- modules/ts/misc/run.py | 1 + modules/ts/misc/run_suite.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/java/test/pure_test/build.xml b/modules/java/test/pure_test/build.xml index 15419f5..e596c82 100644 --- a/modules/java/test/pure_test/build.xml +++ b/modules/java/test/pure_test/build.xml @@ -6,6 +6,7 @@ + @@ -53,7 +54,7 @@ - + diff --git a/modules/ts/misc/run.py b/modules/ts/misc/run.py index 2d5de07..c2e4d65 100755 --- a/modules/ts/misc/run.py +++ b/modules/ts/misc/run.py @@ -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)") diff --git a/modules/ts/misc/run_suite.py b/modules/ts/misc/run_suite.py index 0420d9a..2f38223 100644 --- a/modules/ts/misc/run_suite.py +++ b/modules/ts/misc/run_suite.py @@ -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 -- 2.7.4