blob: d375953e74c396a212acbac4be3fabb7a7520044 [file] [log] [blame]
Tamas Kenez971eec62017-05-24 11:08:40 +02001#!/bin/bash
2#
3# Copyright (c) 2017, the R8 project authors. Please see the AUTHORS file
4# for details. All rights reserved. Use of this source code is governed by a
5# BSD-style license that can be found in the LICENSE file.
6
7# Helper script for tools/test_android_cts.py
8
9readonly AOSP_PRESET="$1"
10shift
11readonly TASK="$1"
12shift
13
14. build/envsetup.sh
15lunch "$AOSP_PRESET"
16
17if [[ "$TASK" == "make" ]]; then
18 make "$@"
19elif [[ "$TASK" == "emulator" ]]; then
20 emulator "$@"
21elif [[ "$TASK" == "run-cts" ]]; then
22 adb wait-for-device
23 adb shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'
24
25 echo "exit" | \
26 ANDROID_BUILD_TOP= \
27 "$@"
28else
29 echo "Invalid task: '$TASK'" >&2
30 exit 1
31fi