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@103
|
15 # would have to regenerate it if we added more test audio files
|
Chris@103
|
16 $r -t $transform -w csv --csv-stdout $mypath -r --summary-only > $tmpfile 2>/dev/null || \
|
Chris@103
|
17 fail "Fails to run transform $transform with recursive dir option"
|
Chris@103
|
18
|
Chris@103
|
19 expected=$mypath/expected/transforms-summaries-percussiononsets-all-files
|
Chris@103
|
20 csvcompare $tmpfile $expected.csv || \
|
Chris@103
|
21 fail "Output mismatch for transform $transform with summaries and recursive dir option"
|
Chris@103
|
22
|
Chris@103
|
23 # Here we remove any leading path from the audio file in the output,
|
Chris@103
|
24 # because the playlist reader will have resolved files to absolute
|
Chris@103
|
25 # paths and those will differ between systems
|
Chris@103
|
26 $r -t $transform -w csv --csv-stdout $mypath/audio/playlist.m3u --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \
|
Chris@103
|
27 fail "Fails to run transform $transform with playlist input"
|
Chris@103
|
28
|
Chris@103
|
29 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
|
Chris@103
|
30 csvcompare $tmpfile $expected.csv || \
|
Chris@103
|
31 fail "Output mismatch for transform $transform with summaries and playlist input"
|
Chris@103
|
32
|
Chris@104
|
33 # Same here, just so we can use the same output comparison file as above
|
Chris@104
|
34 $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
|
35 fail "Fails to run transform $transform with 2-file input"
|
Chris@103
|
36
|
Chris@104
|
37 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
|
Chris@104
|
38 csvcompare $tmpfile $expected.csv || \
|
Chris@104
|
39 fail "Output mismatch for transform $transform with summaries and 2-file input"
|
Chris@103
|
40
|
Chris@104
|
41
|
Chris@104
|
42
|