Support multiple test filters in test.py script
Gradle supports multiple "--tests <test>" filters. This CL allows to
give multiple test filters to the tools/test.py script in order to
run tests in different packages at the same time.
Change-Id: I6cd6b5064e73fa335033bfef35ad42f67b4d30f6
diff --git a/tools/test.py b/tools/test.py
index 9774207..7818915 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -84,9 +84,6 @@
def Main():
(options, args) = ParseOptions()
- if len(args) > 1:
- print("test.py takes at most one argument, the pattern for tests to run")
- return -1
gradle_args = []
# Set all necessary Gradle properties and options first.
@@ -131,10 +128,10 @@
# Add Gradle tasks
gradle_args.append('cleanTest')
gradle_args.append('test')
- if len(args) > 0:
- # Test filtering. Must always follow the 'test' task.
+ # Test filtering. Must always follow the 'test' task.
+ for testFilter in args:
gradle_args.append('--tests')
- gradle_args.append(args[0])
+ gradle_args.append(testFilter)
if options.with_code_coverage:
# Create Jacoco report after tests.
gradle_args.append('jacocoTestReport')