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