annotate tests/test-csv-writer/test-csv-writer.sh @ 156:0fd5c3c28814 labfile

Add CSV writer tests (passing!)
author Chris Cannam
date Tue, 14 Oct 2014 18:50:01 +0100
parents tests/test-lab-writer/test-lab-writer.sh@6dc824c3f5e1
children a2310369b2cc
rev   line source
Chris@155 1 #!/bin/bash
Chris@155 2
Chris@155 3 . ../include.sh
Chris@155 4
Chris@155 5 infile=$audiopath/20sec-silence.wav
Chris@156 6 tmpcsv=$mypath/tmp_1_$$.csv
Chris@155 7
Chris@156 8 trap "rm -f $tmpcsv" 0
Chris@155 9
Chris@155 10 for output in notes-regions curve-vsr; do
Chris@155 11
Chris@155 12 flag=""
Chris@155 13
Chris@156 14 $r -d "$testplug:$output" -w csv --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
Chris@155 15 fail "Failed to run for plugin $testplug with output $output and no additional flags"
Chris@155 16
Chris@156 17 csvcompare "$tmpcsv" "$mypath/expected/$output-no-flags.csv" || \
Chris@156 18 faildiff "Output differs from expected for output $output and no additional flags" "$tmpcsv" "$mypath/expected/$output-no-flags.csv"
Chris@155 19
Chris@156 20 flag=sample-timing
Chris@155 21
Chris@156 22 $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
Chris@155 23 fail "Failed to run for plugin $testplug with output $output and $flag flag"
Chris@155 24
Chris@156 25 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \
Chris@156 26 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
Chris@156 27
Chris@156 28 flag=end-times
Chris@156 29
Chris@156 30 $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
Chris@156 31 fail "Failed to run for plugin $testplug with output $output and $flag flag"
Chris@156 32
Chris@156 33 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \
Chris@156 34 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
Chris@156 35
Chris@156 36 flag=separator
Chris@156 37
Chris@156 38 $r -d "$testplug:$output" -w csv --csv-$flag '@' --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
Chris@156 39 fail "Failed to run for plugin $testplug with output $output and $flag flag"
Chris@156 40
Chris@156 41 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \
Chris@156 42 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
Chris@156 43
Chris@155 44 done
Chris@155 45
Chris@155 46 exit 0
Chris@155 47