comparison tests/test-lab-writer/test-lab-writer.sh @ 206:704a8b27f3ed

Add & test the digits option in the Lab file writer
author Chris Cannam
date Tue, 03 Nov 2015 13:42:11 +0000
parents 237ccacbb85e
children e8f2f530c091
comparison
equal deleted inserted replaced
205:7a287e5d5df6 206:704a8b27f3ed
5 infile=$audiopath/20sec-silence.wav 5 infile=$audiopath/20sec-silence.wav
6 tmplab=$mypath/tmp_1_$$.lab 6 tmplab=$mypath/tmp_1_$$.lab
7 7
8 trap "rm -f $tmplab" 0 8 trap "rm -f $tmplab" 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 lab --lab-stdout "$infile" 2>/dev/null > "$tmplab" || \ 14 $r -d "$testplug:$output" -w lab --lab-stdout "$infile" 2>/dev/null > "$tmplab" || \
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"
28 28
29 # Do it all over again, but using the CSV writer. The Lab writer is 29 # Do it all over again, but using the CSV writer. The Lab writer is
30 # actually redundant, it's equivalent to -w csv --csv-separator '\t' 30 # actually redundant, it's equivalent to -w csv --csv-separator '\t'
31 # --csv-end-times --csv-omit-filename 31 # --csv-end-times --csv-omit-filename
32 32
33 for output in notes-regions curve-vsr; do 33 for output in notes-regions curve-vsr grid-oss; do
34 34
35 flag="" 35 flag=""
36 36
37 $r -d "$testplug:$output" -w csv --csv-separator '\t' --csv-end-times --csv-omit-filename --csv-stdout "$infile" 2>/dev/null > "$tmplab" || \ 37 $r -d "$testplug:$output" -w csv --csv-separator '\t' --csv-end-times --csv-omit-filename --csv-stdout "$infile" 2>/dev/null > "$tmplab" || \
38 fail "Failed to run for plugin $testplug and CSV writer with output $output and no additional flags" 38 fail "Failed to run for plugin $testplug and CSV writer with output $output and no additional flags"
47 47
48 csvcompare "$tmplab" "$mypath/expected/$output-$flag.lab" || \ 48 csvcompare "$tmplab" "$mypath/expected/$output-$flag.lab" || \
49 faildiff "Output differs from expected for CSV writer with output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab" 49 faildiff "Output differs from expected for CSV writer with output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab"
50 done 50 done
51 51
52 for output in grid-oss; do
53 for digits in 0 6 2; do
54
55 $r -d "$testplug:$output" -w lab --lab-stdout --lab-digits "$digits" "$infile" 2>/dev/null > "$tmplab" || \
56 fail "Failed to run for plugin $testplug with output $output and digits $digits"
57
58 csvcompare "$tmplab" "$mypath/expected/$output-$digits.lab" || \
59 faildiff "Output differs from expected for CSV writer with output $output and digits $digits" "$tmplab" "$mypath/expected/$output-$digits.lab"
60
61 done
62 done
63
52 exit 0 64 exit 0
53 65