• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2
3# Copyright (C) 2015 The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9#      http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17# A helper script that launches Trade Federation for atest
18source "$(dirname $0)/atest_script_help.sh"
19
20# TODO b/63295046 (sbasi) - Remove this when LOCAL_JAVA_LIBRARIES includes
21# installation.
22# Include any host-side dependency jars.
23if [[ ! -z "$ANDROID_HOST_OUT" ]]; then
24    # TF will load the first test-suite-info.properties in those jar files it loaded.
25    # In current cases that only those *ts suite jars have built in that file.
26    # If user tested testcases which using those jar files with suite-info properties
27    # but change the lunch target to different arch and continue testing other tests without the
28    # need of those *ts jars then TF will not testing with below error message:
29    # "None of the abi supported by this tests suite build".
30    # Create atest-tradefed.jar with test-suite-info.properties and make sure it's priroty is higher
31    # then other *ts-tradefed.jar.
32    deps="atest-tradefed.jar
33          compatibility-host-util.jar
34          hosttestlib.jar
35          cts-tradefed.jar
36          sts-tradefed.jar
37          vts-tradefed.jar
38          csuite-harness.jar
39          tradefed-isolation.jar
40          host-libprotobuf-java-full.jar
41          cts-dalvik-host-test-runner.jar"
42    for dep in $deps; do
43        if [ -f "$ANDROID_HOST_OUT/framework/$dep" ]; then
44          TF_PATH+=":$ANDROID_HOST_OUT/framework/$dep"
45        fi
46    done
47fi
48
49if [ "$(uname)" == "Darwin" ]; then
50    local_tmp_dir="$ANDROID_HOST_OUT/tmp"
51    [[ -f "$local_tmp_dir" ]] || mkdir -p "$local_tmp_dir"
52    java_tmp_dir_opt="-Djava.io.tmpdir=$local_tmp_dir"
53fi
54
55# Note: must leave $RDBG_FLAG and $TRADEFED_OPTS unquoted so that they go away when unset
56java $RDBG_FLAG \
57    -XX:+HeapDumpOnOutOfMemoryError \
58    -XX:-OmitStackTraceInFastThrow \
59    $TRADEFED_OPTS \
60    -cp "${TF_PATH}" \
61    -DTF_JAR_DIR=${TF_JAR_DIR} ${java_tmp_dir_opt} \
62    com.android.tradefed.command.CommandRunner "$@"
63