comparison tests/test-csv-writer/test-csv-writer.sh @ 158:a2310369b2cc labfile

Add fill-ends option to CSV writer (and test it)
author Chris Cannam
date Wed, 15 Oct 2014 10:18:13 +0100
parents 0fd5c3c28814
children e8f2f530c091
comparison
equal deleted inserted replaced
157:946115b8badd 158:a2310369b2cc
23 fail "Failed to run for plugin $testplug with output $output and $flag flag" 23 fail "Failed to run for plugin $testplug with output $output and $flag flag"
24 24
25 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 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" 26 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
27 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
28 flag=end-times 36 flag=end-times
29 37
30 $r -d "$testplug:$output" -w csv --csv-$flag --csv-stdout "$infile" 2>/dev/null > "$tmpcsv" || \ 38 $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" 39 fail "Failed to run for plugin $testplug with output $output and $flag flag"
32 40
39 fail "Failed to run for plugin $testplug with output $output and $flag flag" 47 fail "Failed to run for plugin $testplug with output $output and $flag flag"
40 48
41 csvcompare "$tmpcsv" "$mypath/expected/$output-$flag.csv" || \ 49 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" 50 faildiff "Output differs from expected for output $output and $flag flag" "$tmpcsv" "$mypath/expected/$output-$flag.csv"
43 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
44 done 60 done
45 61
46 exit 0 62 exit 0
47 63