Mercurial > hg > sonic-annotator
annotate tests/test-multiple-audio.sh @ 103:344d5982bbf8
Add simple test for multiple audio file input and playlists
author | Chris Cannam |
---|---|
date | Wed, 01 Oct 2014 15:18:45 +0100 |
parents | |
children | 4852625eb62b |
rev | line source |
---|---|
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@103 | 33 |
Chris@103 | 34 |