annotate tests/test-summaries/test-summaries-testplugin.sh @ 235:6a804920b4a8

Toward checking summary values
author Chris Cannam
date Tue, 01 Mar 2016 12:10:40 +0000
parents
children a0d093495a1f
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@235 11 for output in curve-vsr grid-fsr notes-regions; do
Chris@235 12
Chris@235 13 for summary in min max mean median mode sum variance sd count; do
Chris@235 14
Chris@235 15 id="$testplug:$output"
Chris@235 16 expected="$mypath/expected/testplug-$output-$summary.csv"
Chris@235 17
Chris@235 18 cat "$expected" | grep -v '^#' > "$tmpfile2"
Chris@235 19
Chris@235 20 $r -d $id -w csv --csv-stdout -S $summary --summary-only --csv-omit-filename $infile > $tmpfile 2>/dev/null || \
Chris@235 21 fail "Fails to run transform id $id with summary type $summary"
Chris@235 22
Chris@235 23 csvcompare "$tmpfile" "$tmpfile2" ||
Chris@235 24 faildiff "Output mismatch for output $output with summary type $summary" "$tmpfile" "$tmpfile2"
Chris@235 25
Chris@235 26 done
Chris@235 27 done