Mercurial > hg > sonic-annotator
comparison tests/test-audioformat.sh @ 28:102bb1729184 sonic-annotator-0.4
* Test fixes for cases where the behaviour has actually been fixed for 0.4
* Emphasise this change in CHANGELOG
author | Chris Cannam |
---|---|
date | Fri, 25 Sep 2009 12:00:58 +0000 |
parents | 03a02c1f0a9f |
children | 94d988cef54e |
comparison
equal
deleted
inserted
replaced
27:9fef62a3696d | 28:102bb1729184 |
---|---|
8 tmpfile1=$mypath/tmp_1_$$ | 8 tmpfile1=$mypath/tmp_1_$$ |
9 tmpfile2=$mypath/tmp_2_$$ | 9 tmpfile2=$mypath/tmp_2_$$ |
10 | 10 |
11 trap "rm -f $tmpfile1 $tmpfile2" 0 | 11 trap "rm -f $tmpfile1 $tmpfile2" 0 |
12 | 12 |
13 fail() { | 13 . test-include.sh |
14 echo "Test failed: $1" | |
15 exit 1 | |
16 } | |
17 | 14 |
18 for extension in wav ogg mp3 ; do | 15 for extension in wav ogg mp3 ; do |
19 | 16 |
20 transform=$mypath/transforms/transforms-audioformat-percussiononsets.n3 | 17 transform=$mypath/transforms/transforms-audioformat-percussiononsets.n3 |
21 expected=$mypath/expected/transforms-audioformat-percussiononsets-$extension.csv | 18 expected=$mypath/expected/transforms-audioformat-percussiononsets-$extension.csv |
34 | 31 |
35 $r -t $transform -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ | 32 $r -t $transform -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ |
36 fail "Fails to run transform $transform against audio file $infile" | 33 fail "Fails to run transform $transform against audio file $infile" |
37 | 34 |
38 if [ "$extension" = "wav" ]; then | 35 if [ "$extension" = "wav" ]; then |
39 cmp -s $tmpfile2 $expected || \ | 36 csvcompare $tmpfile2 $expected || \ |
40 fail "Output mismatch for transform $transform with audio file $infile" | 37 fail "Output mismatch for transform $transform with audio file $infile" |
41 else | 38 else |
42 cmp -s $tmpfile2 $expected || \ | 39 csvcompare $tmpfile2 $expected || \ |
43 ( echo "NOTE: Output mismatch for transform $transform with audio file $infile" ; \ | 40 ( echo "NOTE: Output mismatch for transform $transform with audio file $infile" ; \ |
44 echo "This may be the result of differences in the audio file decoder, so I am not" ; \ | 41 echo "This may be the result of differences in the audio file decoder, so I am not" ; \ |
45 echo "failing the test, but I recommend that you check the results." ) | 42 echo "failing the test, but I recommend that you check the results." ) |
46 fi | 43 fi |
47 done | 44 done |