Chris@103: #!/bin/bash Chris@103: Chris@103: mypath=`dirname $0` Chris@103: r=$mypath/../sonic-annotator Chris@103: Chris@103: tmpfile=$mypath/tmp_1_$$ Chris@103: Chris@103: trap "rm -f $tmpfile" 0 Chris@103: Chris@103: . test-include.sh Chris@103: Chris@103: transform=$mypath/transforms/transforms-summaries-percussiononsets-detectionfunction.n3 Chris@103: Chris@103: # Note, the output here depends on all the audio files present -- we Chris@111: # would have to regenerate it if we added more test audio files. Note Chris@111: # that the -r flag is not supposed to pick up playlist files, only Chris@111: # audio files Chris@103: $r -t $transform -w csv --csv-stdout $mypath -r --summary-only > $tmpfile 2>/dev/null || \ Chris@103: fail "Fails to run transform $transform with recursive dir option" Chris@103: Chris@103: expected=$mypath/expected/transforms-summaries-percussiononsets-all-files Chris@103: csvcompare $tmpfile $expected.csv || \ Chris@111: faildiff "Output mismatch for transform $transform with summaries and recursive dir option" $tmpfile $expected.csv Chris@103: Chris@103: # Here we remove any leading path from the audio file in the output, Chris@103: # because the playlist reader will have resolved files to absolute Chris@103: # paths and those will differ between systems Chris@103: $r -t $transform -w csv --csv-stdout $mypath/audio/playlist.m3u --summary-only 2>/dev/null | sed 's,^"\.*/[^"]*/,",' > $tmpfile || \ Chris@103: fail "Fails to run transform $transform with playlist input" Chris@103: Chris@103: expected=$mypath/expected/transforms-summaries-percussiononsets-playlist Chris@103: csvcompare $tmpfile $expected.csv || \ Chris@111: faildiff "Output mismatch for transform $transform with summaries and playlist input" $tmpfile $expected.csv Chris@103: Chris@104: # Same here, just so we can use the same output comparison file as above Chris@104: $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: fail "Fails to run transform $transform with 2-file input" Chris@103: Chris@104: expected=$mypath/expected/transforms-summaries-percussiononsets-playlist Chris@104: csvcompare $tmpfile $expected.csv || \ Chris@111: faildiff "Output mismatch for transform $transform with summaries and 2-file input" $tmpfile $expected.csv Chris@103: Chris@104: Chris@104: