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