summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Etan Cohen <etancohen@google.com> 2020-01-27 19:26:49 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-01-27 19:26:49 +0000
commitd7f827dfafef30e11c7d178e589c4d4a2c5da207 (patch)
treeb09d5960f65c7a13066b71e0e302d0715e702164
parentbe1fbb4eda3e175a693ef7dbb16e570e4e27d323 (diff)
parent840a678b49939fbae625a2351a448b4185091334 (diff)
Merge "[WIFI] Update instructions for running tests"
-rw-r--r--service/tests/wifitests/README.md21
-rwxr-xr-xservice/tests/wifitests/runtests.sh44
2 files changed, 1 insertions, 64 deletions
diff --git a/service/tests/wifitests/README.md b/service/tests/wifitests/README.md
index 02ee000d0b..8908fcd772 100644
--- a/service/tests/wifitests/README.md
+++ b/service/tests/wifitests/README.md
@@ -8,26 +8,7 @@ libraries.
The easiest way to run tests is simply run
```
-frameworks/opt/net/wifi/tests/wifitests/runtests.sh
-```
-
-`runtests.sh` will build the test project and all of its dependencies and push the APK to the
-connected device. It will then run the tests on the device.
-
-See below for a few example of options to limit which tests are run.
-See the
-[AndroidJUnitRunner Documentation](https://developer.android.com/reference/android/support/test/runner/AndroidJUnitRunner.html)
-for more details on the supported options.
-
-```
-runtests.sh -e package com.android.server.wifi.util
-runtests.sh -e class com.android.server.wifi.WifiServiceImplTest
-```
-
-If you manually build and push the test APK to the device you can run tests using
-
-```
-adb shell am instrument -w 'com.android.server.wifi.test/androidx.test.runner.AndroidJUnitRunner'
+atest com.android.server.wifi
```
## Adding Tests
diff --git a/service/tests/wifitests/runtests.sh b/service/tests/wifitests/runtests.sh
deleted file mode 100755
index c03c9d4b80..0000000000
--- a/service/tests/wifitests/runtests.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env bash
-
-if [[ "$1" == "--help" ]]; then
- cat <<END
-Usage for $0
-
- <no-args> run all tests
- -r print raw results
- -e class <class-name> run all the tests in <class-name>
- -e class <class-name>#<method> run just the specified <method>
-
-Example:
-$ $0 -r -e class \\
- com.android.server.wifi.WifiDiagnosticsTest#startLoggingRegistersLogEventHandler
-Run just the specified test, and show the raw output.
-
-For more options, see https://goo.gl/JxYjIw
-END
- exit 0
-fi
-
-if [ -z $ANDROID_BUILD_TOP ]; then
- echo "You need to source and lunch before you can use this script"
- exit 1
-fi
-
-echo "Running tests"
-
-set -e # fail early
-
-echo "+ mmma -j32 $ANDROID_BUILD_TOP/frameworks/opt/net/wifi/tests"
-# NOTE Don't actually run the command above since this shell doesn't inherit functions from the
-# caller.
-$ANDROID_BUILD_TOP/build/soong/soong_ui.bash --make-mode MODULES-IN-frameworks-opt-net-wifi-tests-wifitests
-APK_NAME="$(ls -t $(find $OUT -name FrameworksWifiTests.apk) | head -n 1)"
-
-set -x # print commands
-
-adb wait-for-device
-
-adb install -r -g "$APK_NAME"
-
-adb shell am instrument --no-hidden-api-checks -w "$@" \
- 'com.android.server.wifi.test/com.android.server.wifi.CustomTestRunner'