blob: c8679014534cd9f700a250e3234d4901be5a3a66 [file] [log] [blame]
Greg Hartman77c6a792018-04-11 15:19:39 -07001#!/usr/bin/env bash
2
3if [[ "$1" == "--help" ]]; then
4 cat <<END
5Usage for $0
6
7 <no-args> run all tests
8 -r print raw results
9 -e class <class>[#<test>] run test/s specified by class
10
11Example:
12$ $0 -r -e class com.android.cuttlefish.wifi.WifiE2eTests#testWifiConnects
13Run just the specified test, and show the raw output.
14END
15 exit 0
16fi
17
18if [ -z $ANDROID_BUILD_TOP ]; then
19 echo "You need to source and lunch before you can use this script"
20 exit 1
21fi
22
23set -e # fail early
Cody Schuffelen3576b1f2018-07-20 17:25:19 -070024make -j32 -C $ANDROID_BUILD_TOP -f build/core/main.mk CuttlefishWifiTests
Greg Hartman77c6a792018-04-11 15:19:39 -070025adb wait-for-device
26# Same as 'package' in manifest file
27adb uninstall com.android.cuttlefish.wifi.tests || true
28adb install -r -g "$OUT/data/app/CuttlefishWifiTests/CuttlefishWifiTests.apk"
29# optionally: -e class com.android.cuttlefish.wifi.WifiE2eTests#testName
30adb shell am instrument -w "$@" 'com.android.cuttlefish.wifi.tests/android.support.test.runner.AndroidJUnitRunner'