comparison tests/test-json-destinations/test-json-destinations.sh @ 191:4ef452f5fefc

Add (failing) test for JSON output format (fails for grid output)
author Chris Cannam
date Wed, 22 Jul 2015 14:25:14 +0100
parents 859d8ec60e06
children 3b7ec45abd1c
comparison
equal deleted inserted replaced
190:2d2253469ca4 191:4ef452f5fefc
20 tmpjson=$mypath/tmp_1_$$.json 20 tmpjson=$mypath/tmp_1_$$.json
21 21
22 trap "rm -f $tmpjson $outfile1 $outfile2 $outfile3 $outfile4 $outfile5 $outfile6 $infile1dot $outfile1dot $audiopath/$outfile1 $audiopath/$outfile2 $audiopath/$outfile3 $audiopath/$outfile4 $audiopath/$outfile5 $audiopath/$outfile6 $audiopath/$outfile1dot" 0 22 trap "rm -f $tmpjson $outfile1 $outfile2 $outfile3 $outfile4 $outfile5 $outfile6 $infile1dot $outfile1dot $audiopath/$outfile1 $audiopath/$outfile2 $audiopath/$outfile3 $audiopath/$outfile4 $audiopath/$outfile5 $audiopath/$outfile6 $audiopath/$outfile1dot" 0
23 23
24 transformdir=$mypath/transforms 24 transformdir=$mypath/transforms
25
26 failshow() {
27 echo "Test failed: $1"
28 if [ -n "$2" ]; then
29 echo "Output follows:"
30 echo "--"
31 cat $2
32 echo "--"
33 fi
34 exit 1
35 }
36
37 check_json() {
38 test -f $1 || \
39 fail "Fails to write output to expected location $1 for $2"
40 cat $1 | json_verify -q || \
41 failshow "Writes invalid JSON to location $1 for $2" $1
42 rm -f $1
43 }
44 25
45 26
46 ctx="onsets transform, one audio file, default JSON writer destination" 27 ctx="onsets transform, one audio file, default JSON writer destination"
47 28
48 rm -f $audiopath/$outfile1 29 rm -f $audiopath/$outfile1