blob: 093230b694a2bc6c0ab3808065c8b32d82119b8f [file] [log] [blame]
Tom Finegan36c39d62014-04-03 13:16:58 -07001#!/bin/sh
2##
3## Copyright (c) 2014 The WebM project authors. All Rights Reserved.
4##
5## Use of this source code is governed by a BSD-style license
6## that can be found in the LICENSE file in the root of the source
7## tree. An additional intellectual property rights grant can be found
8## in the file PATENTS. All contributing project authors may
9## be found in the AUTHORS file in the root of the source tree.
10##
11## This file tests vpxdec. To add new tests to this file, do the following:
12## 1. Write a shell function (this is your test).
13## 2. Add the function to vpxdec_tests (on a new line).
14##
15. $(dirname $0)/tools_common.sh
16
Tom Finegan36c39d62014-04-03 13:16:58 -070017# Environment check: Make sure input is available.
18vpxdec_verify_environment() {
19 if [ ! -e "${VP8_IVF_FILE}" ] || [ ! -e "${VP9_WEBM_FILE}" ]; then
20 echo "Libvpx test data must exist in LIBVPX_TEST_DATA_PATH."
21 return 1
22 fi
23}
24
25vpxdec_can_decode_vp8() {
26 if [ "$(vpxdec_available)" = "yes" ] && \
27 [ "$(vp8_decode_available)" = "yes" ]; then
28 echo yes
29 fi
30}
31
32vpxdec_can_decode_vp9() {
33 if [ "$(vpxdec_available)" = "yes" ] && \
34 [ "$(vp9_decode_available)" = "yes" ]; then
35 echo yes
36 fi
37}
38
39vpxdec_vp8_ivf() {
40 if [ "$(vpxdec_can_decode_vp8)" = "yes" ]; then
41 vpxdec "${VP8_IVF_FILE}"
42 fi
43}
44
45vpxdec_vp8_ivf_pipe_input() {
46 if [ "$(vpxdec_can_decode_vp8)" = "yes" ]; then
47 vpxdec "${VP8_IVF_FILE}" -
48 fi
49}
50
51vpxdec_vp9_webm() {
52 if [ "$(vpxdec_can_decode_vp9)" = "yes" ] && \
53 [ "$(webm_io_available)" = "yes" ]; then
54 vpxdec "${VP9_WEBM_FILE}"
55 fi
56}
57
58vpxdec_tests="vpxdec_vp8_ivf
59 vpxdec_vp8_ivf_pipe_input
60 vpxdec_vp9_webm"
61
62run_tests vpxdec_verify_environment "${vpxdec_tests}"