1 #!/usr/bin/env bash 2 3 if [[ "$1" == "--help" ]]; then 4 cat <<END 5 Usage 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 11 Example: 12 $ $0 -r -e class com.android.cuttlefish.wifi.WifiE2eTests#testWifiConnects 13 Run just the specified test, and show the raw output. 14 END 15 exit 0 16 fi 17 18 if [ -z $ANDROID_BUILD_TOP ]; then 19 echo "You need to source and lunch before you can use this script" 20 exit 1 21 fi 22 23 set -e # fail early 24 make -j32 -C $ANDROID_BUILD_TOP -f build/core/main.mk MODULES-IN-device-google-cuttlefish-tests-wifi 25 adb wait-for-device 26 # Same as 'package' in manifest file 27 adb uninstall com.android.cuttlefish.wifi.tests || true 28 adb install -r -g "$OUT/data/app/CuttlefishWifiTests/CuttlefishWifiTests.apk" 29 # optionally: -e class com.android.cuttlefish.wifi.WifiE2eTests#testName 30 adb shell am instrument -w "$@" 'com.android.cuttlefish.wifi.tests/android.support.test.runner.AndroidJUnitRunner' 31