comparison tests/test-csv-writer/test-csv-writer.sh @ 207:e8f2f530c091

Add & test the digits option in the CSV file writer
author Chris Cannam
date Tue, 03 Nov 2015 14:31:59 +0000
parents a2310369b2cc
children
comparison
equal deleted inserted replaced
206:704a8b27f3ed 207:e8f2f530c091
5 infile=$audiopath/20sec-silence.wav 5 infile=$audiopath/20sec-silence.wav
6 tmpcsv=$mypath/tmp_1_$$.csv 6 tmpcsv=$mypath/tmp_1_$$.csv
7 7
8 trap "rm -f $tmpcsv" 0 8 trap "rm -f $tmpcsv" 0
9 9
10 for output in notes-regions curve-vsr; do 10 for output in notes-regions curve-vsr grid-oss; do
11 11
12 flag="" 12 flag=""
13 13
14 $r -d "$testplug:$output" -w csv --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 14 $r -d "$testplug:$output" -w csv --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
15 fail "Failed to run for plugin $testplug with output $output and no additional flags" 15 fail "Failed to run for plugin $testplug with output $output and no additional flags"
57 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 57 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \
58 faildiff "Output differs from expected for output $output and all flags" "$tmpcsv" "$mypath/expected/$output-$flag.csv" 58 faildiff "Output differs from expected for output $output and all flags" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
59 59
60 done 60 done
61 61
62 for output in grid-oss; do
63 for digits in 0 6 2; do
64
65 $r -d "$testplug:$output" -w csv --csv-stdout --csv-digits "$digits" "$infile" 2>/dev/null > "$tmpcsv" || \
66 fail "Failed to run for plugin $testplug with output $output and digits $digits"
67
68 # no fuzz here
69 cmp -s "$tmpcsv" "$mypath/expected/$output-$digits.csv" || \
70 faildiff "Output differs from expected for CSV writer with output $output and digits $digits" "$tmpcsv" "$mypath/expected/$output-$digits.csv"
71
72 done
73 done
74
62 exit 0 75 exit 0
63 76