examples.sh: Run all example tests.
- Remove vpxdec and vpxenc from the exclude list. - vpx{dec,enc}.sh: Updates to support finding their executable when LIBVPX_BIN_PATH is setup for the examples. - tools_common.sh: New library function, vpx_tool_path(). Provides support for finding the exectuables in vpx{dec,enc}.sh. Change-Id: I730f11cceb44646491a7a7ff58603a4a760129ef
This commit is contained in:
parent
c5d8c1e785
commit
4d91e16501
@ -15,7 +15,7 @@
|
|||||||
example_tests=$(ls $(dirname $0)/*.sh)
|
example_tests=$(ls $(dirname $0)/*.sh)
|
||||||
|
|
||||||
# List of script names to exclude.
|
# List of script names to exclude.
|
||||||
exclude_list="examples vpxdec vpxenc tools_common"
|
exclude_list="examples tools_common"
|
||||||
|
|
||||||
# Filter out the scripts in $exclude_list.
|
# Filter out the scripts in $exclude_list.
|
||||||
for word in ${exclude_list}; do
|
for word in ${exclude_list}; do
|
||||||
|
@ -144,6 +144,24 @@ is_windows_target() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Echoes path to $1 when it's executable and exists in ${LIBVPX_BIN_PATH}, or an
|
||||||
|
# empty string. Caller is responsible for testing the string once the function
|
||||||
|
# returns.
|
||||||
|
vpx_tool_path() {
|
||||||
|
local readonly tool_name="$1"
|
||||||
|
local tool_path="${LIBVPX_BIN_PATH}/${tool_name}${VPX_TEST_EXE_SUFFIX}"
|
||||||
|
if [ ! -x "${tool_path}" ]; then
|
||||||
|
# Try one directory up: when running via examples.sh the tool could be in
|
||||||
|
# the parent directory of $LIBVPX_BIN_PATH.
|
||||||
|
tool_path="${LIBVPX_BIN_PATH}/../${tool_name}${VPX_TEST_EXE_SUFFIX}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -x "${tool_path}" ]; then
|
||||||
|
tool_path=""
|
||||||
|
fi
|
||||||
|
echo "${tool_path}"
|
||||||
|
}
|
||||||
|
|
||||||
# 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() {
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
# Environment check: Make sure input is available.
|
# Environment check: Make sure input is available.
|
||||||
vpxdec_verify_environment() {
|
vpxdec_verify_environment() {
|
||||||
if [ ! -e "${VP8_IVF_FILE}" ] || [ ! -e "${VP9_WEBM_FILE}" ]; then
|
if [ ! -e "${VP8_IVF_FILE}" ] || [ ! -e "${VP9_WEBM_FILE}" ]; then
|
||||||
echo "Libvpx test data must exist in LIBVPX_TEST_DATA_PATH."
|
elog "Libvpx test data must exist in LIBVPX_TEST_DATA_PATH."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [ -z "$(vpx_tool_path vpxdec)" ]; then
|
||||||
|
elog "vpxdec not found. It must exist in LIBVPX_BIN_PATH or its parent."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
# Echoes yes to stdout when vpxdec exists according to vpx_tool_available().
|
|
||||||
vpxdec_available() {
|
|
||||||
[ -n "$(vpx_tool_available vpxdec)" ] && echo yes
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Wrapper function for running vpxdec with pipe input. Requires that
|
# Wrapper function for running vpxdec with pipe input. Requires that
|
||||||
@ -32,7 +31,7 @@ vpxdec_available() {
|
|||||||
# input file path and shifted away. All remaining parameters are passed through
|
# input file path and shifted away. All remaining parameters are passed through
|
||||||
# to vpxdec.
|
# to vpxdec.
|
||||||
vpxdec_pipe() {
|
vpxdec_pipe() {
|
||||||
local decoder="${LIBVPX_BIN_PATH}/vpxdec${VPX_TEST_EXE_SUFFIX}"
|
local decoder="$(vpx_tool_path vpxdec)"
|
||||||
local input="$1"
|
local input="$1"
|
||||||
shift
|
shift
|
||||||
cat "${input}" | eval "${VPX_TEST_PREFIX}" "${decoder}" - "$@" ${devnull}
|
cat "${input}" | eval "${VPX_TEST_PREFIX}" "${decoder}" - "$@" ${devnull}
|
||||||
@ -42,22 +41,20 @@ vpxdec_pipe() {
|
|||||||
# the directory containing vpxdec. $1 one is used as the input file path and
|
# the directory containing vpxdec. $1 one is used as the input file path and
|
||||||
# shifted away. All remaining parameters are passed through to vpxdec.
|
# shifted away. All remaining parameters are passed through to vpxdec.
|
||||||
vpxdec() {
|
vpxdec() {
|
||||||
local decoder="${LIBVPX_BIN_PATH}/vpxdec${VPX_TEST_EXE_SUFFIX}"
|
local decoder="$(vpx_tool_path vpxdec)"
|
||||||
local input="${1}"
|
local input="${1}"
|
||||||
shift
|
shift
|
||||||
eval "${VPX_TEST_PREFIX}" "${decoder}" "$input" "$@" ${devnull}
|
eval "${VPX_TEST_PREFIX}" "${decoder}" "$input" "$@" ${devnull}
|
||||||
}
|
}
|
||||||
|
|
||||||
vpxdec_can_decode_vp8() {
|
vpxdec_can_decode_vp8() {
|
||||||
if [ "$(vpxdec_available)" = "yes" ] && \
|
if [ "$(vp8_decode_available)" = "yes" ]; then
|
||||||
[ "$(vp8_decode_available)" = "yes" ]; then
|
|
||||||
echo yes
|
echo yes
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
vpxdec_can_decode_vp9() {
|
vpxdec_can_decode_vp9() {
|
||||||
if [ "$(vpxdec_available)" = "yes" ] && \
|
if [ "$(vp9_decode_available)" = "yes" ]; then
|
||||||
[ "$(vp9_decode_available)" = "yes" ]; then
|
|
||||||
echo yes
|
echo yes
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -23,33 +23,30 @@ vpxenc_verify_environment() {
|
|||||||
echo "The file ${YUV_RAW_INPUT##*/} must exist in LIBVPX_TEST_DATA_PATH."
|
echo "The file ${YUV_RAW_INPUT##*/} must exist in LIBVPX_TEST_DATA_PATH."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
if [ -z "$(vpx_tool_path vpxenc)" ]; then
|
||||||
|
elog "vpxenc not found. It must exist in LIBVPX_BIN_PATH or its parent."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
vpxenc_can_encode_vp8() {
|
vpxenc_can_encode_vp8() {
|
||||||
if [ "$(vpxenc_available)" = "yes" ] && \
|
if [ "$(vp8_encode_available)" = "yes" ]; then
|
||||||
[ "$(vp8_encode_available)" = "yes" ]; then
|
|
||||||
echo yes
|
echo yes
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
vpxenc_can_encode_vp9() {
|
vpxenc_can_encode_vp9() {
|
||||||
if [ "$(vpxenc_available)" = "yes" ] && \
|
if [ "$(vp9_encode_available)" = "yes" ]; then
|
||||||
[ "$(vp9_encode_available)" = "yes" ]; then
|
|
||||||
echo yes
|
echo yes
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Echoes yes to stdout when vpxenc exists according to vpx_tool_available().
|
|
||||||
vpxenc_available() {
|
|
||||||
[ -n "$(vpx_tool_available vpxenc)" ] && echo yes
|
|
||||||
}
|
|
||||||
|
|
||||||
# Wrapper function for running vpxenc with pipe input. Requires that
|
# Wrapper function for running vpxenc with pipe input. Requires that
|
||||||
# LIBVPX_BIN_PATH points to the directory containing vpxenc. $1 is used as the
|
# LIBVPX_BIN_PATH points to the directory containing vpxenc. $1 is used as the
|
||||||
# input file path and shifted away. All remaining parameters are passed through
|
# input file path and shifted away. All remaining parameters are passed through
|
||||||
# to vpxenc.
|
# to vpxenc.
|
||||||
vpxenc_pipe() {
|
vpxenc_pipe() {
|
||||||
local readonly encoder="${LIBVPX_BIN_PATH}/vpxenc${VPX_TEST_EXE_SUFFIX}"
|
local readonly encoder="$(vpx_tool_path vpxenc)"
|
||||||
local readonly input="$1"
|
local readonly input="$1"
|
||||||
shift
|
shift
|
||||||
cat "${input}" | eval "${VPX_TEST_PREFIX}" "${encoder}" - "$@" ${devnull}
|
cat "${input}" | eval "${VPX_TEST_PREFIX}" "${encoder}" - "$@" ${devnull}
|
||||||
@ -59,7 +56,7 @@ vpxenc_pipe() {
|
|||||||
# the directory containing vpxenc. $1 one is used as the input file path and
|
# the directory containing vpxenc. $1 one is used as the input file path and
|
||||||
# shifted away. All remaining parameters are passed through to vpxenc.
|
# shifted away. All remaining parameters are passed through to vpxenc.
|
||||||
vpxenc() {
|
vpxenc() {
|
||||||
local readonly encoder="${LIBVPX_BIN_PATH}/vpxenc${VPX_TEST_EXE_SUFFIX}"
|
local readonly encoder="$(vpx_tool_path vpxenc)"
|
||||||
local readonly input="${1}"
|
local readonly input="${1}"
|
||||||
shift
|
shift
|
||||||
eval "${VPX_TEST_PREFIX}" "${encoder}" "$input" "$@" ${devnull}
|
eval "${VPX_TEST_PREFIX}" "${encoder}" "$input" "$@" ${devnull}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user