Mercurial > hg > sonic-annotator
comparison tests/test-parse-errors/test-parse-errors.sh @ 228:56ff594b022c
Add tests for parse errors in invalid transform files
author | Chris Cannam |
---|---|
date | Thu, 25 Feb 2016 12:04:10 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
227:88044af67bd1 | 228:56ff594b022c |
---|---|
1 #!/bin/bash | |
2 | |
3 . ../include.sh | |
4 | |
5 infile=$audiopath/3clicks8.wav | |
6 tmpfile=$mypath/tmp_$$ | |
7 trap "rm -f $tmpfile" 0 | |
8 | |
9 for transform in "$mypath"/inputs/* ; do | |
10 | |
11 base=$(basename "$transform") | |
12 expected="$mypath"/expected/"$base".txt | |
13 | |
14 if [ ! -f "$expected" ]; then | |
15 fail "Internal error: Expected file $expected not found for transform $transform" | |
16 fi | |
17 | |
18 if $r -t "$transform" -w csv --csv-one-file /dev/null "$infile" 2>"$tmpfile" ; then | |
19 fail "Erroneously succeeds in running bogus transform $transform" | |
20 fi | |
21 | |
22 cat "$expected" | while read line; do | |
23 if ! fgrep -q "$line" "$tmpfile" ; then | |
24 fail "Expected output text \"$line\" not found in diagnostic output for transform $base" | |
25 fi | |
26 done | |
27 | |
28 done | |
29 |