#!/usr/bin/env bash test_description='Measure time to decode ogg/vorbis files. Executes para_filter -f oggdec on the test files provided by the test suite and fails if it takes much longer than the reference implementation.' . ${0%/*}/test-lib.bash test_require_objects "oggdec_filter" missing_objects="$result" get_audio_file_paths ogg oggs="$result" test_require_executables "oggdec" missing_executables="$result" for ogg in $oggs; do if [[ -n "$missing_objects" ]]; then test_skip "${ogg##*/}" "missing object(s): $missing_objects" continue fi if [[ -n "$missing_executables" ]]; then test_skip "${ogg##*/}" \ "missing executables(s): $missing_executables" continue fi test_expect_success "${ogg##*/}" ' test_duration oggdec --quiet --raw --output - - < $ogg && t1=$result && test_duration $PARA_FILTER -f oggdec < $ogg && t2=$result && echo "oggdec: $t1, para_filter: $t2" (($t2 <= $t1 * 3 / 2 + 100)) ' done test_done