comparison tests/test-multiple-audio.sh @ 117:5be4995f4029

Tests (and minor resulting fixes) for remote file download
author Chris Cannam
date Wed, 08 Oct 2014 13:14:39 +0100
parents 74f7ad72fee6
children 0fe5abb56a6e
comparison
equal deleted inserted replaced
116:1c0799754670 117:5be4995f4029
9 9
10 . test-include.sh 10 . test-include.sh
11 11
12 transform=$mypath/transforms/transforms-summaries-percussiononsets-detectionfunction.n3 12 transform=$mypath/transforms/transforms-summaries-percussiononsets-detectionfunction.n3
13 13
14 urlbase=http://vamp-plugins.org/sonic-annotator/testfiles
15
16
17 # 1. Recursive local directory
18
14 # Note, the output here depends on all the audio files present -- we 19 # Note, the output here depends on all the audio files present -- we
15 # would have to regenerate it if we added more test audio files. Note 20 # would have to regenerate it if we added more test audio files. Note
16 # that the -r flag is not supposed to pick up playlist files, only 21 # that the -r flag is not supposed to pick up playlist files, only
17 # audio files 22 # audio files
18 $r -t $transform -w csv --csv-stdout $mypath -r --summary-only > $tmpfile 2>/dev/null || \ 23 $r -t $transform -w csv --csv-stdout $mypath -r --summary-only > $tmpfile 2>/dev/null || \
20 25
21 expected=$mypath/expected/transforms-summaries-percussiononsets-all-files 26 expected=$mypath/expected/transforms-summaries-percussiononsets-all-files
22 csvcompare $tmpfile $expected.csv || \ 27 csvcompare $tmpfile $expected.csv || \
23 faildiff "Output mismatch for transform $transform with summaries and recursive dir option" $tmpfile $expected.csv 28 faildiff "Output mismatch for transform $transform with summaries and recursive dir option" $tmpfile $expected.csv
24 29
25 # Here we remove any leading path from the audio file in the output, 30
31 # 2. Local playlist file referring to local audio files
32
33 # Here we strip any leading path from the audio file in the output,
26 # because the playlist reader will have resolved files to absolute 34 # because the playlist reader will have resolved files to absolute
27 # paths and those will differ between systems 35 # paths and those will differ between systems
28 $r -t $transform -w csv --csv-stdout $mypath/audio/playlist.m3u --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \ 36 $r -t $transform -w csv --csv-stdout $mypath/audio/playlist.m3u --summary-only 2>/dev/null | sed 's,^"[^"]*/,",' > $tmpfile || \
29 fail "Fails to run transform $transform with playlist input" 37 fail "Fails to run transform $transform with playlist input"
30 38
31 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist 39 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
32 csvcompare $tmpfile $expected.csv || \ 40 csvcompare $tmpfile $expected.csv || \
33 faildiff "Output mismatch for transform $transform with summaries and playlist input" $tmpfile $expected.csv 41 faildiff "Output mismatch for transform $transform with summaries and playlist input" $tmpfile $expected.csv
34 42
35 # Same here, just so we can use the same output comparison file as above 43
36 $r -t $transform -w csv --csv-stdout $mypath/audio/3clicks8.wav $mypath/audio/6clicks8.wav --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \ 44 # 3. Multiple files supplied directly on command line
45
46 # Strip paths again, just so we can use the same output comparison
47 # file as above
48 $r -t $transform -w csv --csv-stdout $mypath/audio/3clicks.mp3 $mypath/audio/6clicks.ogg --summary-only 2>/dev/null | sed 's,^"[^"]*/,",' > $tmpfile || \
37 fail "Fails to run transform $transform with 2-file input" 49 fail "Fails to run transform $transform with 2-file input"
38 50
39 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist 51 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
40 csvcompare $tmpfile $expected.csv || \ 52 csvcompare $tmpfile $expected.csv || \
41 faildiff "Output mismatch for transform $transform with summaries and 2-file input" $tmpfile $expected.csv 53 faildiff "Output mismatch for transform $transform with summaries and 2-file input" $tmpfile $expected.csv
42 54
43 55
56 # 4. Remote playlist file referring to remote audio files
44 57
58 $r -t $transform -w csv --csv-stdout $urlbase/playlist.m3u --summary-only 2>/dev/null | sed 's,^"[^"]*/,",' > $tmpfile || \
59 fail "Fails to run transform $transform with remote playlist input"
60
61 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
62 csvcompare $tmpfile $expected.csv || \
63 faildiff "Output mismatch for transform $transform with summaries and remote playlist input" $tmpfile $expected.csv
64
65
66 # 5. Local playlist file referring to mixture of remote and local audio files
67
68 $r -t $transform -w csv --csv-stdout $mypath/audio/remote-playlist.m3u --summary-only 2>/dev/null | sed 's,^"[^"]*/,",' > $tmpfile || \
69 fail "Fails to run transform $transform with playlist of remote files"
70
71 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
72 csvcompare $tmpfile $expected.csv || \
73 faildiff "Output mismatch for transform $transform with summaries and remote playlist input" $tmpfile $expected.csv
74
75
76 # 6. Multiple remote files supplied directly on command line
77
78 $r -t $transform -w csv --csv-stdout $urlbase/3clicks.mp3 $urlbase/6clicks.ogg --summary-only 2>/dev/null | sed 's,^"[^"]*/,",' > $tmpfile || \
79 fail "Fails to run transform $transform with 2-file remote input"
80
81 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
82 csvcompare $tmpfile $expected.csv || \
83 faildiff "Output mismatch for transform $transform with summaries and 2-file input" $tmpfile $expected.csv
84
85
86 # 7. Mixture of remote and local files supplied on command line
87
88 $r -t $transform -w csv --csv-stdout $mypath/audio/3clicks.mp3 $urlbase/6clicks.ogg --summary-only 2>/dev/null | sed 's,^"[^"]*/,",' > $tmpfile || \
89 fail "Fails to run transform $transform with 2-file remote input"
90
91 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist
92 csvcompare $tmpfile $expected.csv || \
93 faildiff "Output mismatch for transform $transform with summaries and mixed local/remote 2-file input" $tmpfile $expected.csv
94