1#!/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-name> run all the tests in <class-name> 10 -e class <class-name>#<method> run just the specified <method> 11 12Example: 13$ $0 -r -e class \\ 14 com.android.server.wifi.WifiDiagnosticsTest#startLoggingRegistersLogEventHandler 15Run just the specified test, and show the raw output. 16 17For more options, see https://goo.gl/JxYjIw 18END 19 exit 0 20fi 21 22if [ -z $ANDROID_BUILD_TOP ]; then 23 echo "You need to source and lunch before you can use this script" 24 exit 1 25fi 26 27echo "Running tests" 28 29set -e # fail early 30 31echo "+ mmma -j32 $ANDROID_BUILD_TOP/frameworks/opt/net/wifi/tests" 32# NOTE Don't actually run the command above since this shell doesn't inherit functions from the 33# caller. 34make -j32 -C $ANDROID_BUILD_TOP -f build/core/main.mk MODULES-IN-frameworks-opt-net-wifi-tests 35 36set -x # print commands 37 38adb root 39adb wait-for-device 40 41adb install -r -g "$OUT/data/app/FrameworksWifiTests/FrameworksWifiTests.apk" 42 43adb shell am instrument -w "$@" \ 44 -e notAnnotation com.android.server.wifi.DisabledForUpdateToAnyMatcher \ 45 'com.android.server.wifi.test/android.support.test.runner.AndroidJUnitRunner' 46