blob: eb6cf53d2d28d55066832020b64d440a4dfd60c8 [file] [log] [blame]
Jim Tangbc369302019-10-23 12:46:53 +08001#!/usr/bin/env bash
Simran Basif4bdb122017-08-23 13:13:53 -07002
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
Jim Tangbc369302019-10-23 12:46:53 +080018source "$(dirname $0)/script_help.sh"
Simran Basif4bdb122017-08-23 13:13:53 -070019
20# TODO b/63295046 (sbasi) - Remove this when LOCAL_JAVA_LIBRARIES includes
21# installation.
22# Include any host-side dependency jars.
Jim Tangbc369302019-10-23 12:46:53 +080023if [[ ! -z "$ANDROID_HOST_OUT" ]]; then
yangbill3eaf2842019-01-02 12:05:45 +080024 # 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.
Jim Tangbc369302019-10-23 12:46:53 +080032 deps="atest-tradefed.jar
33 compatibility-host-util.jar
34 hosttestlib.jar
35 cts-tradefed.jar
Julien Desprez1be7b402019-11-14 09:21:12 -080036 sts-tradefed.jar
Dan Shic29a94a2020-04-01 13:00:52 -070037 vts-tradefed.jar
Dan Shi1f9290e2020-03-24 22:16:09 -070038 vts10-tradefed.jar
karenluoc7caa5c2019-10-31 13:41:23 -040039 csuite-harness.jar
Joseph Murphyb927bf62019-09-30 19:17:00 -070040 tradefed-isolation.jar
Jim Tangbc369302019-10-23 12:46:53 +080041 host-libprotobuf-java-full.jar
42 cts-dalvik-host-test-runner.jar"
Simran Basif4bdb122017-08-23 13:13:53 -070043 for dep in $deps; do
Jim Tangbc369302019-10-23 12:46:53 +080044 if [ -f "$ANDROID_HOST_OUT/framework/$dep" ]; then
45 TF_PATH+=":$ANDROID_HOST_OUT/framework/$dep"
Simran Basif4bdb122017-08-23 13:13:53 -070046 fi
47 done
48fi
49
Simran Basi5b58a892017-11-15 14:35:50 -080050if [ "$(uname)" == "Darwin" ]; then
Jim Tangbc369302019-10-23 12:46:53 +080051 local_tmp_dir="$ANDROID_HOST_OUT/tmp"
52 [[ -f "$local_tmp_dir" ]] || mkdir -p "$local_tmp_dir"
53 java_tmp_dir_opt="-Djava.io.tmpdir=$local_tmp_dir"
Simran Basi5b58a892017-11-15 14:35:50 -080054fi
55
Simran Basif4bdb122017-08-23 13:13:53 -070056# Note: must leave $RDBG_FLAG and $TRADEFED_OPTS unquoted so that they go away when unset
Jim Tangbc369302019-10-23 12:46:53 +080057java $RDBG_FLAG \
58 -XX:+HeapDumpOnOutOfMemoryError \
59 -XX:-OmitStackTraceInFastThrow \
60 $TRADEFED_OPTS \
61 -cp ${TF_PATH} \
62 -DTF_JAR_DIR=${TF_JAR_DIR} ${java_tmp_dir_opt} \
63 com.android.tradefed.command.CommandRunner "$@"