summaryrefslogtreecommitdiff
path: root/test/tools_common.sh
diff options
context:
space:
mode:
authorTom Finegan <tomfinegan@google.com>2014-05-15 15:31:02 -0700
committerTom Finegan <tomfinegan@google.com>2014-05-17 13:49:23 -0700
commit3d38cf9c12d9b9dfa9e4b707ec80ed98d6827b60 (patch)
tree343f9758b2afc50ac087590c0106a2b9e3b6d609 /test/tools_common.sh
parentb043c3e0813827f164c899fcd0b7f222f3018144 (diff)
downloadlibvpx-3d38cf9c12d9b9dfa9e4b707ec80ed98d6827b60.tar
libvpx-3d38cf9c12d9b9dfa9e4b707ec80ed98d6827b60.tar.gz
libvpx-3d38cf9c12d9b9dfa9e4b707ec80ed98d6827b60.tar.bz2
libvpx-3d38cf9c12d9b9dfa9e4b707ec80ed98d6827b60.zip
tools_common.sh: Allow over ride of test name.
Use VPX_TEST_NAME instead of the script name sans path and extension when reporting test results when the variable is not empty. Also: Clean up some style nits while I'm at it. Change-Id: I0319745a3b7a90d0f307e55c5108fea2204187cd
Diffstat (limited to 'test/tools_common.sh')
-rwxr-xr-xtest/tools_common.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/tools_common.sh b/test/tools_common.sh
index 9c10d48f0..472111c23 100755
--- a/test/tools_common.sh
+++ b/test/tools_common.sh
@@ -302,8 +302,13 @@ filter_strings() {
# functions and are run unconditionally. Functions in positional parameter two
# are run according to the rules specified in vpx_test_usage().
run_tests() {
- env_tests="verify_vpx_test_environment ${1}"
- tests_to_filter="${2}"
+ local env_tests="verify_vpx_test_environment $1"
+ local tests_to_filter="$2"
+ local test_name="${VPX_TEST_NAME}"
+
+ if [ -z "${test_name}" ]; then
+ test_name="$(basename \"${0%.*}\")"
+ fi
if [ "${VPX_TEST_RUN_DISABLED_TESTS}" != "yes" ]; then
# Filter out DISABLED tests.
@@ -315,7 +320,7 @@ run_tests() {
tests_to_filter=$(filter_strings "${tests_to_filter}" ${VPX_TEST_FILTER})
fi
- tests_to_run="${env_tests} ${tests_to_filter}"
+ local tests_to_run="${env_tests} ${tests_to_filter}"
check_git_hashes
@@ -328,8 +333,8 @@ run_tests() {
test_end "${test}"
done
- tested_config="$(test_configuration_target) @ $(current_hash)"
- echo $(basename "${0%.*}"): Done, all tests pass for ${tested_config}.
+ local tested_config="$(test_configuration_target) @ $(current_hash)"
+ echo "${test_name}: Done, all tests pass for ${tested_config}."
}
vpx_test_usage() {