testsuite: Introduce a new test for para_server.
[paraslash.git] / t / t0002-oggdec-performance.sh
1 #!/usr/bin/env bash
2
3 test_description='Measure time to decode ogg/vorbis files.
4
5 Executes para_filter -f oggdec on the test files provided by the
6 test suite and fails if it takes much longer than the reference
7 implementation.'
8
9 . ${0%/*}/test-lib.sh
10
11 test_require_objects "oggdec_filter"
12 missing_objects="$result"
13
14 get_audio_file_paths ogg
15 oggs="$result"
16
17 test_require_executables "oggdec"
18 missing_executables="$result"
19
20 for ogg in $oggs; do
21 if [[ -n "$missing_objects" ]]; then
22 test_skip "${ogg##*/}" "missing object(s): $missing_objects"
23 continue
24 fi
25 if [[ -n "$missing_executables" ]]; then
26 test_skip "${ogg##*/}" \
27 "missing executables(s): $missing_executables"
28 continue
29 fi
30 test_expect_success "${ogg##*/}" '
31 test_duration oggdec --quiet --raw --output - - < $ogg &&
32 t1=$result &&
33 test_duration $PARA_FILTER -f oggdec < $ogg &&
34 t2=$result &&
35 echo "oggdec: $t1, para_filter: $t2"
36 (($t2 <= $t1 * 3 / 2 + 100))
37 '
38 done
39 test_done