comparison tests/test-json-destinations/test-json-destinations.sh @ 169:859d8ec60e06 jams

Add setNofM logic which the JSON writer can use to write a list when sending multiple files' worth to a single target
author Chris Cannam
date Wed, 15 Oct 2014 16:05:15 +0100
parents db83ea0e102d
children 4ef452f5fefc
comparison
equal deleted inserted replaced
168:3e30dbb68ca2 169:859d8ec60e06
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 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
26 check_json() { 37 check_json() {
27 test -f $1 || \ 38 test -f $1 || \
28 fail "Fails to write output to expected location $1 for $2" 39 fail "Fails to write output to expected location $1 for $2"
29 cat $1 | json_verify || \ 40 cat $1 | json_verify -q || \
30 fail "Writes invalid JSON to location $1 for $2" 41 failshow "Writes invalid JSON to location $1 for $2" $1
31 rm -f $1 42 rm -f $1
32 } 43 }
33 44
34 45
35 ctx="onsets transform, one audio file, default JSON writer destination" 46 ctx="onsets transform, one audio file, default JSON writer destination"