tools_common.sh: Set VPX_TEST_EXE_SUFFIX for windows targets.

Change-Id: Ic3c792bcb76917c4d4b829d0377a9c36e06dd77d
This commit is contained in:
Tom Finegan 2014-04-22 19:36:40 -07:00
parent b0d9bfe420
commit 39c5a4b8be

View File

@ -130,11 +130,9 @@ is_windows_target() {
# Echoes yes to stdout when the file named by positional parameter one exists # Echoes yes to stdout when the file named by positional parameter one exists
# in LIBVPX_BIN_PATH, and is executable. # in LIBVPX_BIN_PATH, and is executable.
vpx_tool_available() { vpx_tool_available() {
tool_name="${1}" local tool_name="$1"
if [ "$(is_windows_target)" = "yes" ]; then local tool="${LIBVPX_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}"
tool_name="${tool_name}.exe" [ -x "${tool}" ] && echo yes
fi
[ -x "${LIBVPX_BIN_PATH}/${1}" ] && echo yes
} }
# Echoes yes to stdout when vpx_config_option_enabled() reports yes for # Echoes yes to stdout when vpx_config_option_enabled() reports yes for
@ -178,8 +176,8 @@ vpxdec_available() {
# present, is interpreted as a boolean flag that means the input should be sent # present, is interpreted as a boolean flag that means the input should be sent
# to vpxdec via pipe from cat instead of directly. # to vpxdec via pipe from cat instead of directly.
vpxdec() { vpxdec() {
input="${1}" local input="${1}"
pipe_input=${2} local pipe_input=${2}
if [ $# -gt 2 ]; then if [ $# -gt 2 ]; then
# shift away $1 and $2 so the remaining arguments can be passed to vpxdec # shift away $1 and $2 so the remaining arguments can be passed to vpxdec
@ -187,11 +185,7 @@ vpxdec() {
shift 2 shift 2
fi 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 if [ -z "${pipe_input}" ]; then
"${decoder}" "$input" --summary --noblit "$@" > /dev/null 2>&1 "${decoder}" "$input" --summary --noblit "$@" > /dev/null 2>&1
@ -218,18 +212,14 @@ vpxenc_available() {
# Note: Extra flags currently supports a special case: when set to "-" # Note: Extra flags currently supports a special case: when set to "-"
# input is piped to vpxenc via cat. # input is piped to vpxenc via cat.
vpxenc() { vpxenc() {
encoder="${LIBVPX_BIN_PATH}/vpxenc" local encoder="${LIBVPX_BIN_PATH}/vpxenc${VPX_TEST_EXE_SUFFIX}"
codec="${1}" local codec="${1}"
width=${2} local width=${2}
height=${3} local height=${3}
frames=${4} local frames=${4}
input=${5} local input=${5}
output="${VPX_TEST_OUTPUT_DIR}/${6}" local output="${VPX_TEST_OUTPUT_DIR}/${6}"
extra_flags=${7} 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. # Because --ivf must be within the command line to get IVF from vpxenc.
if echo "${output}" | egrep -q 'ivf$'; then if echo "${output}" | egrep -q 'ivf$'; then
@ -421,6 +411,10 @@ if ! mkdir -p "${VPX_TEST_OUTPUT_DIR}" || \
exit 1 exit 1
fi fi
if [ "$(is_windows_target)" = "yes" ]; then
VPX_TEST_EXE_SUFFIX=".exe"
fi
trap cleanup EXIT trap cleanup EXIT
if [ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ]; then if [ "${VPX_TEST_VERBOSE_OUTPUT}" = "yes" ]; then