Mercurial > hg > sonic-annotator
comparison tests/test-lab-writer/test-lab-writer.sh @ 160:2a399bed0184
Merge from branch "labfile"
author | Chris Cannam |
---|---|
date | Wed, 15 Oct 2014 11:23:05 +0100 |
parents | 237ccacbb85e |
children | 704a8b27f3ed |
comparison
equal
deleted
inserted
replaced
148:04945e74d314 | 160:2a399bed0184 |
---|---|
1 #!/bin/bash | |
2 | |
3 . ../include.sh | |
4 | |
5 infile=$audiopath/20sec-silence.wav | |
6 tmplab=$mypath/tmp_1_$$.lab | |
7 | |
8 trap "rm -f $tmplab" 0 | |
9 | |
10 for output in notes-regions curve-vsr; do | |
11 | |
12 flag="" | |
13 | |
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" | |
16 | |
17 csvcompare "$tmplab" "$mypath/expected/$output-no-flags.lab" || \ | |
18 faildiff "Output differs from expected for output $output and no additional flags" "$tmplab" "$mypath/expected/$output-no-flags.lab" | |
19 | |
20 flag=fill-ends | |
21 | |
22 $r -d "$testplug:$output" -w lab --lab-$flag --lab-stdout "$infile" 2>/dev/null > "$tmplab" || \ | |
23 fail "Failed to run for plugin $testplug with output $output and $flag flag" | |
24 | |
25 csvcompare "$tmplab" "$mypath/expected/$output-$flag.lab" || \ | |
26 faildiff "Output differs from expected for output $output and $flag flag" "$tmplab" "$mypath/expected/$output-$flag.lab" | |
27 done | |
28 | |
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' | |
31 # --csv-end-times --csv-omit-filename | |
32 | |
33 for output in notes-regions curve-vsr; do | |
34 | |
35 flag="" | |
36 | |
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" | |
39 | |
40 csvcompare "$tmplab" "$mypath/expected/$output-no-flags.lab" || \ | |
41 faildiff "Output differs from expected for CSV writer with output $output and no additional flags" "$tmplab" "$mypath/expected/$output-no-flags.lab" | |
42 | |
43 flag=fill-ends | |
44 | |
45 $r -d "$testplug:$output" -w csv --csv-separator '\t' --csv-end-times --csv-omit-filename --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmplab" || \ | |
46 fail "Failed to run for plugin $testplug and CSV writer with output $output and $flag flag" | |
47 | |
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" | |
50 done | |
51 | |
52 exit 0 | |
53 |