Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Simran Basi | f4bdb12 | 2017-08-23 13:13:53 -0700 | [diff] [blame] | 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 |
Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 18 | source "$(dirname $0)/script_help.sh" |
Simran Basi | f4bdb12 | 2017-08-23 13:13:53 -0700 | [diff] [blame] | 19 | |
| 20 | # TODO b/63295046 (sbasi) - Remove this when LOCAL_JAVA_LIBRARIES includes |
| 21 | # installation. |
| 22 | # Include any host-side dependency jars. |
Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 23 | if [[ ! -z "$ANDROID_HOST_OUT" ]]; then |
yangbill | 3eaf284 | 2019-01-02 12:05:45 +0800 | [diff] [blame] | 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. |
Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 32 | deps="atest-tradefed.jar |
| 33 | compatibility-host-util.jar |
| 34 | hosttestlib.jar |
| 35 | cts-tradefed.jar |
Julien Desprez | 1be7b40 | 2019-11-14 09:21:12 -0800 | [diff] [blame] | 36 | sts-tradefed.jar |
Dan Shi | c29a94a | 2020-04-01 13:00:52 -0700 | [diff] [blame] | 37 | vts-tradefed.jar |
Dan Shi | 1f9290e | 2020-03-24 22:16:09 -0700 | [diff] [blame] | 38 | vts10-tradefed.jar |
karenluo | c7caa5c | 2019-10-31 13:41:23 -0400 | [diff] [blame] | 39 | csuite-harness.jar |
Joseph Murphy | b927bf6 | 2019-09-30 19:17:00 -0700 | [diff] [blame] | 40 | tradefed-isolation.jar |
Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 41 | host-libprotobuf-java-full.jar |
| 42 | cts-dalvik-host-test-runner.jar" |
Simran Basi | f4bdb12 | 2017-08-23 13:13:53 -0700 | [diff] [blame] | 43 | for dep in $deps; do |
Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 44 | if [ -f "$ANDROID_HOST_OUT/framework/$dep" ]; then |
| 45 | TF_PATH+=":$ANDROID_HOST_OUT/framework/$dep" |
Simran Basi | f4bdb12 | 2017-08-23 13:13:53 -0700 | [diff] [blame] | 46 | fi |
| 47 | done |
| 48 | fi |
| 49 | |
Simran Basi | 5b58a89 | 2017-11-15 14:35:50 -0800 | [diff] [blame] | 50 | if [ "$(uname)" == "Darwin" ]; then |
Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 51 | 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 Basi | 5b58a89 | 2017-11-15 14:35:50 -0800 | [diff] [blame] | 54 | fi |
| 55 | |
Simran Basi | f4bdb12 | 2017-08-23 13:13:53 -0700 | [diff] [blame] | 56 | # Note: must leave $RDBG_FLAG and $TRADEFED_OPTS unquoted so that they go away when unset |
Jim Tang | bc36930 | 2019-10-23 12:46:53 +0800 | [diff] [blame] | 57 | java $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 "$@" |