1*77c1e3ccSAndroid Build Coastguard Worker#!/bin/sh 2*77c1e3ccSAndroid Build Coastguard Worker## Copyright (c) 2016, Alliance for Open Media. All rights reserved. 3*77c1e3ccSAndroid Build Coastguard Worker## 4*77c1e3ccSAndroid Build Coastguard Worker## This source code is subject to the terms of the BSD 2 Clause License and 5*77c1e3ccSAndroid Build Coastguard Worker## the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6*77c1e3ccSAndroid Build Coastguard Worker## was not distributed with this source code in the LICENSE file, you can 7*77c1e3ccSAndroid Build Coastguard Worker## obtain it at www.aomedia.org/license/software. If the Alliance for Open 8*77c1e3ccSAndroid Build Coastguard Worker## Media Patent License 1.0 was not distributed with this source code in the 9*77c1e3ccSAndroid Build Coastguard Worker## PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10*77c1e3ccSAndroid Build Coastguard Worker## 11*77c1e3ccSAndroid Build Coastguard Worker## This file runs all of the tests for the libaom examples. 12*77c1e3ccSAndroid Build Coastguard Worker## 13*77c1e3ccSAndroid Build Coastguard Workerreadonly EXEC_DIR="$(pwd)" 14*77c1e3ccSAndroid Build Coastguard Worker. $(dirname $0)/tools_common.sh 15*77c1e3ccSAndroid Build Coastguard Worker 16*77c1e3ccSAndroid Build Coastguard Workerexample_tests=$(ls -r $(dirname $0)/*.sh) 17*77c1e3ccSAndroid Build Coastguard Worker 18*77c1e3ccSAndroid Build Coastguard Worker# List of script names to exclude. 19*77c1e3ccSAndroid Build Coastguard Workerexclude_list="best_encode examples run_encodes tools_common" 20*77c1e3ccSAndroid Build Coastguard Worker 21*77c1e3ccSAndroid Build Coastguard Workerif [ "$(realtime_only_build)" = "yes" ]; then 22*77c1e3ccSAndroid Build Coastguard Worker exclude_list="${exclude_list} twopass_encoder simple_decoder lightfield_test" 23*77c1e3ccSAndroid Build Coastguard Workerfi 24*77c1e3ccSAndroid Build Coastguard Worker 25*77c1e3ccSAndroid Build Coastguard Worker# Filter out the scripts in $exclude_list. 26*77c1e3ccSAndroid Build Coastguard Workerfor word in ${exclude_list}; do 27*77c1e3ccSAndroid Build Coastguard Worker example_tests=$(filter_strings "${example_tests}" "${word}" exclude) 28*77c1e3ccSAndroid Build Coastguard Workerdone 29*77c1e3ccSAndroid Build Coastguard Worker 30*77c1e3ccSAndroid Build Coastguard Workerfor test in ${example_tests}; do 31*77c1e3ccSAndroid Build Coastguard Worker # Source each test script so that exporting variables can be avoided. 32*77c1e3ccSAndroid Build Coastguard Worker AOM_TEST_NAME="$(basename ${test%.*})" 33*77c1e3ccSAndroid Build Coastguard Worker . "${test}" 34*77c1e3ccSAndroid Build Coastguard Worker # Restore the working directory to the one at the beginning of execution. 35*77c1e3ccSAndroid Build Coastguard Worker # This avoids side-effects from tests that change the directory. 36*77c1e3ccSAndroid Build Coastguard Worker cd "${EXEC_DIR}" 37*77c1e3ccSAndroid Build Coastguard Workerdone 38