Peter Qiu 601964b927 wifi: add test target/directory for unit testing WiFi framework APIs
The existing tests for the WiFi frameworks API android.net.wifi are
copied from frameworks/opt/wifi/tests, and will be removed in
frameworks/opt/wifi/tests.

Bug: 31745421
Change-Id: I789e983bc7dd02b6c3fa6a982ca671347912be0f
Test: frameworks/base/wifi/runtests.sh
2016-09-27 15:13:20 -07:00

25 lines
693 B
Bash
Executable File

#!/usr/bin/env bash
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/base/wifi/tests"
# NOTE Don't actually run the command above since this shell doesn't inherit functions from the
# caller.
make -j32 -C $ANDROID_BUILD_TOP -f build/core/main.mk MODULES-IN-frameworks-base-wifi-tests
set -x # print commands
adb root
adb wait-for-device
adb install -r -g "$OUT/data/app/FrameworksWifiApiTests/FrameworksWifiApiTests.apk"
adb shell am instrument -w "$@" 'android.net.wifi.test/android.support.test.runner.AndroidJUnitRunner'