Allow to run test with a custom java
Change-Id: Ia38fc31a9f17d8b8f50e54976ecc2befc7671474
diff --git a/tools/test.py b/tools/test.py
index 0440f57c..8c47219 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -76,6 +76,8 @@
help='Use a custom directory for the test artifacts instead of a'
' temporary (which is automatically removed after the test).'
' Note that the directory will not be cleared before the test.')
+ result.add_option('--java_home',
+ help='Use a custom java version to run tests.')
return result.parse_args()
@@ -130,6 +132,8 @@
gradle_args.append('-Ptest_dir=' + options.test_dir)
if not os.path.exists(options.test_dir):
os.makedirs(options.test_dir)
+ if options.java_home:
+ gradle_args.append('-Dorg.gradle.java.home=' + options.java_home)
# Add Gradle tasks
gradle_args.append('cleanTest')