summaryrefslogtreecommitdiff
path: root/experiments/prepare_bazel_test_env/data/static/build/bazel/rules/cc_tf_test_launcher.sh
blob: 99b4ab5f1341311870ac438cf5c524cc79555c90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
#
# Launches a native CC 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[@]}" \
    "$@"