Mercurial > hg > sonic-annotator
comparison tests/test-csv-writer/test-csv-writer.sh @ 161:4b19d824a213 jams
Merge from default branch
author | Chris Cannam |
---|---|
date | Wed, 15 Oct 2014 11:33:14 +0100 |
parents | a2310369b2cc |
children | e8f2f530c091 |
comparison
equal
deleted
inserted
replaced
153:ad96fd5f9cd7 | 161:4b19d824a213 |
---|---|
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=fill-ends | |
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=end-times | |
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 flag=separator | |
45 | |
46 $r -d "$testplug:$output" -w csv --csv-$flag '@' --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ | |
47 fail "Failed to run for plugin $testplug with output $output and $flag flag" | |
48 | |
49 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ | |
50 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv" | |
51 | |
52 flag=all | |
53 | |
54 $r -d "$testplug:$output" -w csv --csv-sample-timing --csv-fill-ends --csv-end-times --csv-separator '@' --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ | |
55 fail "Failed to run for plugin $testplug with output $output and all flags" | |
56 | |
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" | |
59 | |
60 done | |
61 | |
62 exit 0 | |
63 |