summaryrefslogtreecommitdiff
path: root/experiments/prepare_bazel_test_env/data/static/build/bazel/rules/java_tf_test_launcher.sh
diff options
context:
space:
mode:
Diffstat (limited to 'experiments/prepare_bazel_test_env/data/static/build/bazel/rules/java_tf_test_launcher.sh')
-rw-r--r--experiments/prepare_bazel_test_env/data/static/build/bazel/rules/java_tf_test_launcher.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/experiments/prepare_bazel_test_env/data/static/build/bazel/rules/java_tf_test_launcher.sh b/experiments/prepare_bazel_test_env/data/static/build/bazel/rules/java_tf_test_launcher.sh
new file mode 100644
index 0000000..be6f076
--- /dev/null
+++ b/experiments/prepare_bazel_test_env/data/static/build/bazel/rules/java_tf_test_launcher.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+# Launches a Java test with Tradefed. The script expects the following:
+# 1. adb is present on the path.
+# 2. LD_LIBRARY_PATH is set for any libraries that need to be referenced.
+# 3. script_help.sh is included in the runfiles.
+# 4. TF_JAR_DIR and TF_PATH are set corresponding to the location of the
+# Tradefed JARs and any associated libraries.
+# 5. The Tradefed launch script, test_module (i.e. hello_world_tests),
+# and test_path (i.e. platform_testing/tests/example/native) are provided
+# as the first and second positional arguments respectively.
+
+TRADEFED_LAUNCHER=$1
+shift
+TEST_MODULE=$1
+shift
+TEST_PATH=$1
+shift
+
+if [ "$1" == "--host" ]; then
+ HOST_ARGS=(-n --prioritize-host-config --skip-host-arch-check)
+ shift
+fi
+
+exec $TRADEFED_LAUNCHER template/atest_local_min \
+ --template:map test=atest \
+ --tests-dir "$TEST_PATH" \
+ --logcat-on-failure \
+ --no-enable-granular-attempts \
+ --no-early-device-release \
+ --include-filter "$TEST_MODULE" \
+ --skip-loading-config-jar \
+ --log-level-display VERBOSE \
+ --log-level VERBOSE \
+ "${HOST_ARGS[@]}" \
+ "$@" \ No newline at end of file