Files
android/libwvdrmengine/run_all_unit_tests.sh
Aaron Vaage a249c67504 OEMCrypto Profiler
This CL is a merge from the widevine repo of:
http://go/wvgerrit/16491 Circular Buffer
http://go/wvgerrit/16512 Circular Buffer Tests
http://go/wvgerrit/16493 Entry Writer
http://go/wvgerrit/16495 Profiled Scope
http://go/wvgerrit/16500 Stats Collection
http://go/wvgerrit/16543 Disallow Stats Copy or Assign
http://go/wvgerrit/16514 Moving OEM Function Enum
http://go/wvgerrit/16501 Defining Session Interface
http://go/wvgerrit/16502 Session Definitions
http://go/wvgerrit/16573 Remove code to num bytes table
http://go/wvgerrit/16556 Connecting Profiler to Profiled Scope
http://go/wvgerrit/16557 Android Reading Profiler History
http://go/wvgerrit/16574 Adding Get Stats Method
http://go/wvgerrit/16606 Seperating Session Parsing
http://go/wvgerrit/16607 Adding get stats method to DRMPlugin
http://go/wvgerrit/16608 Fixing Linux Build Failure
http://go/wvgerrit/16612 Stop Clearing History
http://go/wvgerrit/16613 Accessing profiler information using session id
http://go/wvgerrit/16614 Making All Session Subsets of Global Session

BUG: 25123303
BUG: 26027857
Change-Id: Ie2422e644aa631871852ea0e461695aeb7060f88
2016-01-27 10:14:46 -08:00

79 lines
2.7 KiB
Bash
Executable File

#!/bin/sh
final_result=0
failed_tests=()
# Below, we will append filters to the exclusion portion of GTEST_FILTER, so we
# need to guarantee it has one.
if [ -z "$GTEST_FILTER" ]; then
# If it wasn't set, make it add all tests, and remove none.
GTEST_FILTER="*-"
# if GTEST_FILTER already has a negative sign, we leave it alone.
elif [ 0 -eq `expr index "$GTEST_FILTER" "-"` ]; then
# If GTEST_FILTER was set, but does not have a negative sign, add one. This
# gives gtest an empty list of tests to skip.
GTEST_FILTER="$GTEST_FILTER-"
fi
# Execute a command in "adb shell" and capture the result.
adb_shell_run() {
local tmp_log="$OUT/mediadrmtest.log"
local adb_error="[ADB SHELL] $@ failed"
adb shell "GTEST_FILTER=$GTEST_FILTER $@" \|\| echo "$adb_error" | tee "$tmp_log"
! grep -Fq "$adb_error" "$tmp_log"
local result=$?
if [ $result -ne 0 ]; then
final_result=$result
failed_tests+=("$adb_error")
fi
}
if [ -z "$ANDROID_BUILD_TOP" ]; then
echo "Android build environment not set"
exit -1
fi
echo "waiting for device"
ADB_OUTPUT=`adb root && adb wait-for-device remount`
echo $ADB_OUTPUT
if echo $ADB_OUTPUT | grep -qi "verity"; then
echo
echo "ERROR: This device has Verity enabled. run_all_unit_tests.sh does not "
echo "work if Verity is enabled. Please disable Verity with"
echo "\"adb disable-verity\" and try again."
exit -1
fi
adb_shell_run GTEST_FILTER="$GTEST_FILTER:*Level1Required" FORCE_LEVEL3_OEMCRYPTO=yes \
/system/bin/oemcrypto_test
adb_shell_run /system/bin/oemcrypto_test
adb_shell_run /system/bin/request_license_test
# cdm_extended_duration_test takes >30 minutes to run.
# adb_shell_run /system/bin/cdm_extended_duration_test
adb_shell_run /system/bin/max_res_engine_unittest
adb_shell_run /system/bin/policy_engine_unittest
adb_shell_run /system/bin/libwvdrmmediacrypto_test
adb_shell_run /system/bin/libwvdrmdrmplugin_test
adb_shell_run /system/bin/cdm_engine_test
adb_shell_run /system/bin/cdm_session_unittest
adb_shell_run /system/bin/file_store_unittest
adb_shell_run /system/bin/license_unittest
adb_shell_run /system/bin/initialization_data_unittest
adb_shell_run /system/bin/device_files_unittest
adb_shell_run /system/bin/timer_unittest
adb_shell_run /system/bin/buffer_reader_test
adb_shell_run /system/bin/circular_buffer_test
adb_shell_run /system/bin/entry_writer_test
library_path="/system/vendor/lib/mediadrm/ "
adb_shell_run LD_LIBRARY_PATH=$library_path /system/bin/libwvdrmengine_test
adb_shell_run am start com.widevine.test/com.widevine.test.MediaDrmAPITest
if [ $final_result -eq 0 ]; then
echo "MediaDrm unittests completed successfully!"
else
printf '\n%s\n' "${failed_tests[@]}"
exit $final_result
fi