Mercurial > hg > sonic-annotator
annotate tests/test-summaries/test-summaries-testplugin.sh @ 298:9e98a1a8ebbd
Exclude mode from this test
author | Chris Cannam |
---|---|
date | Thu, 25 May 2017 10:52:03 +0100 |
parents | a0d093495a1f |
children |
rev | line source |
---|---|
Chris@235 | 1 #!/bin/bash |
Chris@235 | 2 |
Chris@235 | 3 . ../include.sh |
Chris@235 | 4 |
Chris@235 | 5 infile=$audiopath/3clicks8.wav |
Chris@235 | 6 tmpfile=$mypath/tmp_1_$$ |
Chris@235 | 7 tmpfile2=$mypath/tmp_2_$$ |
Chris@235 | 8 |
Chris@235 | 9 trap "rm -f $tmpfile $tmpfile2" 0 |
Chris@235 | 10 |
Chris@236 | 11 for output in curve-vsr grid-fsr; do |
Chris@235 | 12 |
Chris@235 | 13 for summary in min max mean median mode sum variance sd count; do |
Chris@235 | 14 |
Chris@236 | 15 # grid-fsr is bulkier, and we're only really concerned that |
Chris@236 | 16 # we're getting a sane result per bin, so just do min and max |
Chris@236 | 17 # there |
Chris@236 | 18 if [ "$output" = "grid-fsr" ]; then |
Chris@236 | 19 case "$summary" in |
Chris@236 | 20 mean|median|mode|sum|variance|sd|count) continue;; |
Chris@236 | 21 esac |
Chris@236 | 22 fi |
Chris@236 | 23 |
Chris@235 | 24 id="$testplug:$output" |
Chris@235 | 25 expected="$mypath/expected/testplug-$output-$summary.csv" |
Chris@235 | 26 |
Chris@235 | 27 cat "$expected" | grep -v '^#' > "$tmpfile2" |
Chris@235 | 28 |
Chris@235 | 29 $r -d $id -w csv --csv-stdout -S $summary --summary-only --csv-omit-filename $infile > $tmpfile 2>/dev/null || \ |
Chris@235 | 30 fail "Fails to run transform id $id with summary type $summary" |
Chris@235 | 31 |
Chris@235 | 32 csvcompare "$tmpfile" "$tmpfile2" || |
Chris@235 | 33 faildiff "Output mismatch for output $output with summary type $summary" "$tmpfile" "$tmpfile2" |
Chris@235 | 34 |
Chris@235 | 35 done |
Chris@235 | 36 done |