comparison 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
comparison
equal deleted inserted replaced
155:6dc824c3f5e1 156:0fd5c3c28814
1 #!/bin/bash
2
3 . ../include.sh
4
5 infile=$audiopath/20sec-silence.wav
6 tmpcsv=$mypath/tmp_1_$$.csv
7
8 trap "rm -f $tmpcsv" 0
9
10 for output in notes-regions curve-vsr; do
11
12 flag=""
13
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"
16
17 csvcompare "$tmpcsv" "$mypath/expected/$output-no-flags.csv" || \
18 faildiff "Output differs from expected for output $output and no additional flags" "$tmpcsv" "$mypath/expected/$output-no-flags.csv"
19
20 flag=sample-timing
21
22 $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
23 fail "Failed to run for plugin $testplug with output $output and $flag flag"
24
25 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \
26 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
27
28 flag=end-times
29
30 $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
31 fail "Failed to run for plugin $testplug with output $output and $flag flag"
32
33 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \
34 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
35
36 flag=separator
37
38 $r -d "$testplug:$output" -w csv --csv-$flag '@' --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \
39 fail "Failed to run for plugin $testplug with output $output and $flag flag"
40
41 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \
42 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
43
44 done
45
46 exit 0
47