From 28882ed5d5d3fda85d50efdf3598ceda83df6c4d Mon Sep 17 00:00:00 2001 From: mukesh agrawal Date: Tue, 28 Mar 2017 18:19:49 -0700 Subject: [PATCH] utiltests: add script to run tests Make it easier to run the tests, so that more people will run them. Bug: 36698401 Test: tests/utiltests/runtests.sh \ -e class com.android.internal.util.StateMachineTest Change-Id: I3151fb6b2f609f45c7d8154b51f13cce58ccdc13 --- core/tests/utiltests/runtests.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 core/tests/utiltests/runtests.sh diff --git a/core/tests/utiltests/runtests.sh b/core/tests/utiltests/runtests.sh new file mode 100755 index 0000000000000..853119f623347 --- /dev/null +++ b/core/tests/utiltests/runtests.sh @@ -0,0 +1,24 @@ +#!/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/core/tests/utiltests" +# 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-core-tests-utiltests + +set -x # print commands + +adb root +adb wait-for-device + +adb install -r -g "$OUT/data/app/FrameworksUtilTests/FrameworksUtilTests.apk" + +adb shell am instrument -w "$@" 'com.android.frameworks.utiltests/android.support.test.runner.AndroidJUnitRunner'