Merge remote-tracking branch 'fml/master'
[paraslash.git] / t / t0001-oggdec-correctness.sh
1 #!/usr/bin/env bash
2
3 test_description='Check correctness of oggdec output.
4
5 Executes para_filter -f oggdec on the test files provided by the test
6 suite and compares the output against the output of the reference
7 implementation.'
8
9 . ${0%/*}/test-lib.sh
10
11 test_require_objects "oggdec_filter"
12 missing_objects="$result"
13
14 test_require_executables "oggdec"
15 missing_executables="$result"
16
17 get_audio_file_paths ogg
18 oggs="$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 $PARA_FILTER -f oggdec < $ogg | sha1sum > filter.sha1 &&
32 oggdec --quiet --raw --output - - < $ogg | sha1sum > oggdec.sha1 &&
33 diff -u filter.sha1 oggdec.sha1
34 "
35 done
36 test_done