Mercurial > hg > sonic-annotator
comparison tests/test-multiple-audio.sh @ 111:74f7ad72fee6
Simplify playlist handling (hoist it up a level)
author | Chris Cannam |
---|---|
date | Thu, 02 Oct 2014 15:21:16 +0100 |
parents | 4852625eb62b |
children | 5be4995f4029 |
comparison
equal
deleted
inserted
replaced
109:78a7c77ba432 | 111:74f7ad72fee6 |
---|---|
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 # Note, the output here depends on all the audio files present -- we | 14 # 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 | 15 # 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 | |
17 # audio files | |
16 $r -t $transform -w csv --csv-stdout $mypath -r --summary-only > $tmpfile 2>/dev/null || \ | 18 $r -t $transform -w csv --csv-stdout $mypath -r --summary-only > $tmpfile 2>/dev/null || \ |
17 fail "Fails to run transform $transform with recursive dir option" | 19 fail "Fails to run transform $transform with recursive dir option" |
18 | 20 |
19 expected=$mypath/expected/transforms-summaries-percussiononsets-all-files | 21 expected=$mypath/expected/transforms-summaries-percussiononsets-all-files |
20 csvcompare $tmpfile $expected.csv || \ | 22 csvcompare $tmpfile $expected.csv || \ |
21 fail "Output mismatch for transform $transform with summaries and recursive dir option" | 23 faildiff "Output mismatch for transform $transform with summaries and recursive dir option" $tmpfile $expected.csv |
22 | 24 |
23 # Here we remove any leading path from the audio file in the output, | 25 # Here we remove any leading path from the audio file in the output, |
24 # because the playlist reader will have resolved files to absolute | 26 # because the playlist reader will have resolved files to absolute |
25 # paths and those will differ between systems | 27 # paths and those will differ between systems |
26 $r -t $transform -w csv --csv-stdout $mypath/audio/playlist.m3u --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \ | 28 $r -t $transform -w csv --csv-stdout $mypath/audio/playlist.m3u --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \ |
27 fail "Fails to run transform $transform with playlist input" | 29 fail "Fails to run transform $transform with playlist input" |
28 | 30 |
29 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist | 31 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist |
30 csvcompare $tmpfile $expected.csv || \ | 32 csvcompare $tmpfile $expected.csv || \ |
31 fail "Output mismatch for transform $transform with summaries and playlist input" | 33 faildiff "Output mismatch for transform $transform with summaries and playlist input" $tmpfile $expected.csv |
32 | 34 |
33 # Same here, just so we can use the same output comparison file as above | 35 # Same here, just so we can use the same output comparison file as above |
34 $r -t $transform -w csv --csv-stdout $mypath/audio/3clicks8.wav $mypath/audio/6clicks8.wav --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \ | 36 $r -t $transform -w csv --csv-stdout $mypath/audio/3clicks8.wav $mypath/audio/6clicks8.wav --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \ |
35 fail "Fails to run transform $transform with 2-file input" | 37 fail "Fails to run transform $transform with 2-file input" |
36 | 38 |
37 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist | 39 expected=$mypath/expected/transforms-summaries-percussiononsets-playlist |
38 csvcompare $tmpfile $expected.csv || \ | 40 csvcompare $tmpfile $expected.csv || \ |
39 fail "Output mismatch for transform $transform with summaries and 2-file input" | 41 faildiff "Output mismatch for transform $transform with summaries and 2-file input" $tmpfile $expected.csv |
40 | 42 |
41 | 43 |
42 | 44 |