From 2229e51c1841201010f99337185a03934e50d2d6 Mon Sep 17 00:00:00 2001 From: Fred Gylys-Colwell Date: Mon, 27 Apr 2015 12:48:31 -0700 Subject: [PATCH] Set default GTEST_FILTER in android script Merge from widevine repo of http://go/wvgerrit/14218 If GTEST_FILTER was not set, it defaults to "" which matches no tests. This CL changes it to "*" if it was "". Also, quotes are added around the environment variable and command so that it multiple variables can be set. Change-Id: Icad9a1fbca2d1b436f6e37a2a080a70a384f0a1d --- libwvdrmengine/run_all_unit_tests.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libwvdrmengine/run_all_unit_tests.sh b/libwvdrmengine/run_all_unit_tests.sh index 1ebe4265..d993fd2b 100755 --- a/libwvdrmengine/run_all_unit_tests.sh +++ b/libwvdrmengine/run_all_unit_tests.sh @@ -3,11 +3,15 @@ final_result=0 failed_tests=() +if [ -z "$GTEST_FILTER" ]; then + 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" + 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