X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=t%2Ft0002-oggdec-performance.sh;fp=t%2Ft0002-oggdec-performance.sh;h=d496a3ec6c937290f736a19c17f706b15e5abcf7;hb=c7250fb279af132333266af36e19c156dd84eca1;hp=0000000000000000000000000000000000000000;hpb=dd98d31d017bbbe16bf6711e0343b267dd6cfe89;p=paraslash.git diff --git a/t/t0002-oggdec-performance.sh b/t/t0002-oggdec-performance.sh new file mode 100755 index 00000000..d496a3ec --- /dev/null +++ b/t/t0002-oggdec-performance.sh @@ -0,0 +1,39 @@ +#!/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.sh + +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