Commit c5d962d5 authored by Tom Finegan's avatar Tom Finegan

tools_common.sh: Add vlog()

Add a verbose logging function instead of checking
$VPX_TEST_VERBOSE_OUTPUT in multiple places.

Change-Id: I82618809f0964f696ed17ca4d99d8d7d252232f4
parent 5573301d
...@@ -16,6 +16,10 @@ VPX_TEST_TOOLS_COMMON_SH=included ...@@ -16,6 +16,10 @@ VPX_TEST_TOOLS_COMMON_SH=included
set -e set -e
vlog() {
[ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ] && echo "$@"
}
# Sets $VPX_TOOL_TEST to the name specified by positional parameter one. # Sets $VPX_TOOL_TEST to the name specified by positional parameter one.
test_begin() { test_begin() {
VPX_TOOL_TEST="${1}" VPX_TOOL_TEST="${1}"
...@@ -313,9 +317,9 @@ run_tests() { ...@@ -313,9 +317,9 @@ run_tests() {
# Run tests. # Run tests.
for test in ${tests_to_run}; do for test in ${tests_to_run}; do
test_begin "${test}" test_begin "${test}"
[ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ] && echo " RUN ${test}" vlog " RUN ${test}"
"${test}" "${test}"
[ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ] && echo " PASS ${test}" vlog " PASS ${test}"
test_end "${test}" test_end "${test}"
done done
...@@ -434,17 +438,13 @@ YUV_RAW_INPUT_HEIGHT=288 ...@@ -434,17 +438,13 @@ YUV_RAW_INPUT_HEIGHT=288
# Setup a trap function to clean up after tests complete. # Setup a trap function to clean up after tests complete.
trap cleanup EXIT trap cleanup EXIT
if [ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ]; then vlog "$(basename "${0%.*}") test configuration:
cat << EOF
$(basename "${0%.*}") test configuration:
LIBVPX_BIN_PATH=${LIBVPX_BIN_PATH} LIBVPX_BIN_PATH=${LIBVPX_BIN_PATH}
LIBVPX_CONFIG_PATH=${LIBVPX_CONFIG_PATH} LIBVPX_CONFIG_PATH=${LIBVPX_CONFIG_PATH}
LIBVPX_TEST_DATA_PATH=${LIBVPX_TEST_DATA_PATH} LIBVPX_TEST_DATA_PATH=${LIBVPX_TEST_DATA_PATH}
VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR} VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}
VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT} VPX_TEST_VERBOSE_OUTPUT=${VPX_TEST_VERBOSE_OUTPUT}
VPX_TEST_FILTER=${VPX_TEST_FILTER} VPX_TEST_FILTER=${VPX_TEST_FILTER}
VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS} VPX_TEST_RUN_DISABLED_TESTS=${VPX_TEST_RUN_DISABLED_TESTS}"
EOF
fi
fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard. fi # End $VPX_TEST_TOOLS_COMMON_SH pseudo include guard.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment