Allow tests to take serial number as a parameter
[ Merge of http://go/wvgerrit/67583 ] The new command formats are $ build_and_run_all_unit_tests.sh [-j <num>] [-s <device_number>] $ run_all_unit_tests.sh [-s <device_number>] Bug: 120519038 Test: WV unit/integration tests with a single device and with two devices connected (with and without specifying a target serial number) Change-Id: I518038c3fc178a7eb658fcd4cf82dd13dfa7131f
This commit is contained in:
@@ -7,13 +7,18 @@ if [ -z "$ANDROID_BUILD_TOP" ]; then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
# Read arguments in case the user wants to do a multicore build
|
||||
# Read arguments in case the user wants to do a multicore build or
|
||||
# copy files to a specific android device by providing a serial number
|
||||
NUM_CORES=1
|
||||
while getopts "j:" opt; do
|
||||
SERIAL_NUM=""
|
||||
while getopts "j:s:" opt; do
|
||||
case $opt in
|
||||
j)
|
||||
NUM_CORES=$OPTARG
|
||||
;;
|
||||
s)
|
||||
SERIAL_NUM="-s $OPTARG"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
@@ -47,13 +52,13 @@ mm -j $NUM_CORES || mma -j $NUM_CORES
|
||||
|
||||
# Detect the device and check if Verity is going to stop the script from working
|
||||
echo "waiting for device"
|
||||
ADB_OUTPUT=`adb root && echo ". " && adb wait-for-device remount`
|
||||
ADB_OUTPUT=`adb $SERIAL_NUM root && echo ". " && adb $SERIAL_NUM wait-for-device remount`
|
||||
echo $ADB_OUTPUT
|
||||
if echo $ADB_OUTPUT | grep -qi "verity"; then
|
||||
echo
|
||||
echo "ERROR: This device has Verity enabled. build_and_run_all_unit_tests.sh "
|
||||
echo "does not work if Verity is enabled. Please disable Verity with"
|
||||
echo "\"adb disable-verity\" and try again."
|
||||
echo "\"adb $SERIAL_NUM disable-verity\" and try again."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
@@ -70,8 +75,8 @@ try_adb_push() {
|
||||
echo "I think it should be in $OUT/data/bin"
|
||||
exit 1
|
||||
fi
|
||||
adb shell mkdir -p /data/bin
|
||||
adb push $test_file /data/bin/$1
|
||||
adb $SERIAL_NUM shell mkdir -p /data/bin
|
||||
adb $SERIAL_NUM push $test_file /data/bin/$1
|
||||
}
|
||||
|
||||
# Push the tests to the device
|
||||
@@ -83,7 +88,6 @@ try_adb_push cdm_extended_duration_test
|
||||
try_adb_push cdm_session_unittest
|
||||
try_adb_push counter_metric_unittest
|
||||
try_adb_push crypto_session_unittest
|
||||
try_adb_push generic_crypto_unittest
|
||||
try_adb_push device_files_unittest
|
||||
try_adb_push distribution_unittest
|
||||
try_adb_push event_metric_unittest
|
||||
@@ -111,4 +115,4 @@ try_adb_push wv_cdm_metrics_test
|
||||
|
||||
# Run the tests using run_all_unit_tests.sh
|
||||
cd $ANDROID_BUILD_TOP/vendor/widevine/libwvdrmengine
|
||||
./run_all_unit_tests.sh
|
||||
./run_all_unit_tests.sh $SERIAL_NUM
|
||||
|
||||
Reference in New Issue
Block a user