ref: 2003263ca345c4b97edf052ce901ee38dd1c4ba8
parent: 7f83a3bcdc3fd5ed4f85de0a406cd1dcda9e2382
parent: 39c5a4b8be3f9e624270dd6e8571ed5e39d99ee9
author: Tom Finegan <tomfinegan@google.com>
date: Tue Apr 22 16:39:49 EDT 2014
Merge "tools_common.sh: Set VPX_TEST_EXE_SUFFIX for windows targets."
--- a/test/tools_common.sh
+++ b/test/tools_common.sh
@@ -130,11 +130,9 @@
# Echoes yes to stdout when the file named by positional parameter one exists
# in LIBVPX_BIN_PATH, and is executable.
vpx_tool_available() {
- tool_name="${1}"
- if [ "$(is_windows_target)" = "yes" ]; then
- tool_name="${tool_name}.exe"
- fi
- [ -x "${LIBVPX_BIN_PATH}/${1}" ] && echo yes
+ local tool_name="$1"
+ local tool="${LIBVPX_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}"
+ [ -x "${tool}" ] && echo yes
}
# Echoes yes to stdout when vpx_config_option_enabled() reports yes for
@@ -178,8 +176,8 @@
# present, is interpreted as a boolean flag that means the input should be sent
# to vpxdec via pipe from cat instead of directly.
vpxdec() {
- input="${1}"
- pipe_input=${2}
+ local input="${1}"
+ local pipe_input=${2}
if [ $# -gt 2 ]; then
# shift away $1 and $2 so the remaining arguments can be passed to vpxdec
@@ -187,12 +185,8 @@
shift 2
fi
- decoder="${LIBVPX_BIN_PATH}/vpxdec"
+ local decoder="${LIBVPX_BIN_PATH}/vpxdec${VPX_TEST_EXE_SUFFIX}"
- if [ "$(is_windows_target)" = "yes" ]; then
- decoder="${decoder}.exe"
- fi
-
if [ -z "${pipe_input}" ]; then
"${decoder}" "$input" --summary --noblit "$@" > /dev/null 2>&1
else
@@ -218,19 +212,15 @@
# Note: Extra flags currently supports a special case: when set to "-"
# input is piped to vpxenc via cat.
vpxenc() {
- encoder="${LIBVPX_BIN_PATH}/vpxenc"
- codec="${1}"
- width=${2}
- height=${3}
- frames=${4}
- input=${5}
- output="${VPX_TEST_OUTPUT_DIR}/${6}"
- extra_flags=${7}
+ local encoder="${LIBVPX_BIN_PATH}/vpxenc${VPX_TEST_EXE_SUFFIX}"
+ local codec="${1}"
+ local width=${2}
+ local height=${3}
+ local frames=${4}
+ local input=${5}
+ local output="${VPX_TEST_OUTPUT_DIR}/${6}"
+ local extra_flags=${7}
- if [ "$(is_windows_target)" = "yes" ]; then
- encoder="${encoder}.exe"
- fi
-
# Because --ivf must be within the command line to get IVF from vpxenc.
if echo "${output}" | egrep -q 'ivf$'; then
use_ivf=--ivf
@@ -419,6 +409,10 @@
echo "${0##*/}: Cannot create output directory, giving up."
echo "${0##*/}: VPX_TEST_OUTPUT_DIR=${VPX_TEST_OUTPUT_DIR}"
exit 1
+fi
+
+if [ "$(is_windows_target)" = "yes" ]; then
+ VPX_TEST_EXE_SUFFIX=".exe"
fi
trap cleanup EXIT
--
⑨