Chris@103
|
1 #!/bin/bash
|
Chris@103
|
2
|
Chris@103
|
3 mypath=`dirname $0`
|
Chris@103
|
4 r=$mypath/../sonic-annotator
|
Chris@103
|
5
|
Chris@103
|
6 tmpfile=$mypath/tmp_1_$$
|
Chris@103
|
7
|
Chris@103
|
8 trap "rm -f $tmpfile" 0
|
Chris@103
|
9
|
Chris@103
|
10 . test-include.sh
|
Chris@103
|
11
|
Chris@103
|
12 transform=$mypath/transforms/transforms-summaries-percussiononsets-detectionfunction.n3
|
Chris@103
|
13
|
Chris@103
|
14 # Note, the output here depends on all the audio files present -- we
|
Chris@111
|
15 # would have to regenerate it if we added more test audio files. Note
|
Chris@111
|
16 # that the -r flag is not supposed to pick up playlist files, only
|
Chris@111
|
17 # audio files
|
Chris@103
|
18 $r -t $transform -w csv --csv-stdout $mypath -r --summary-only > $tmpfile 2>/dev/null || \
|
Chris@103
|
19 fail "Fails to run transform $transform with recursive dir option"
|
Chris@103
|
20
|
Chris@103
|
21 expected=$mypath/expected/transforms-summaries-percussiononsets-all-files
|
Chris@103
|
22 csvcompare $tmpfile $expected.csv || \
|
Chris@111
|
23 faildiff "Output mismatch for transform $transform with summaries and recursive dir option" $tmpfile $expected.csv
|
Chris@103
|
24
|
Chris@103
|
25 # Here we remove any leading path from the audio file in the output,
|
Chris@103
|
26 # because the playlist reader will have resolved files to absolute
|
Chris@103
|
27 # paths and those will differ between systems
|
Chris@103
|
28 $r -t $transform -w csv --csv-stdout $mypath/audio/playlist.m3u --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \
|
Chris@103
|
29 fail "Fails to run transform $transform with playlist input"
|
Chris@103
|
30
|
Chris@103
|
31 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
|
Chris@103
|
32 csvcompare $tmpfile $expected.csv || \
|
Chris@111
|
33 faildiff "Output mismatch for transform $transform with summaries and playlist input" $tmpfile $expected.csv
|
Chris@103
|
34
|
Chris@104
|
35 # Same here, just so we can use the same output comparison file as above
|
Chris@104
|
36 $r -t $transform -w csv --csv-stdout $mypath/audio/3clicks8.wav $mypath/audio/6clicks8.wav --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \
|
Chris@104
|
37 fail "Fails to run transform $transform with 2-file input"
|
Chris@103
|
38
|
Chris@104
|
39 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
|
Chris@104
|
40 csvcompare $tmpfile $expected.csv || \
|
Chris@111
|
41 faildiff "Output mismatch for transform $transform with summaries and 2-file input" $tmpfile $expected.csv
|
Chris@103
|
42
|
Chris@104
|
43
|
Chris@104
|
44
|