Chris@0: #!/bin/bash Chris@0: Chris@0: mypath=`dirname $0` Chris@42: r=$mypath/../sonic-annotator Chris@0: Chris@0: infile=$mypath/audio/3clicks8.wav Chris@0: testplug=vamp:vamp-example-plugins:percussiononsets Chris@0: tmpttl=$mypath/tmp_1_$$.ttl Chris@0: Chris@0: trap "rm -f $tmpttl" 0 Chris@0: Chris@0: fail() { Chris@0: echo "Test failed: $1" Chris@0: exit 1 Chris@0: } Chris@0: Chris@0: transformpfx=$mypath/transforms/transforms-rdf-writer-percussiononsets Chris@0: Chris@0: for rdfarg in "" "--rdf-plain" ; do Chris@0: Chris@0: note="" Chris@0: [ -n "$rdfarg" ] && note=" with $rdfarg" Chris@0: Chris@0: rm -f $tmpttl Chris@0: Chris@0: $r -t $transformpfx-onsets.n3 -w rdf $infile $rdfarg --rdf-one-file $tmpttl 2>/dev/null || \ Chris@0: fail "Fails to run with onsets transform and RDF writer$note" Chris@0: Chris@0: rapper -i turtle $tmpttl >/dev/null 2>&1 || \ Chris@0: fail "Fails to produce parseable RDF/TTL for onsets transform$note" Chris@0: Chris@0: rapper -i turtle -c $tmpttl 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' || Chris@0: fail "RDF output contains no triples (?) for onsets transform$note" Chris@0: Chris@0: rm -f $tmpttl Chris@0: Chris@0: $r -t $transformpfx-detectionfunction.n3 -w rdf $infile $rdfarg --rdf-one-file $tmpttl 2>/dev/null || \ Chris@0: fail "Fails to run with detectionfunction transform and RDF writer$note" Chris@0: Chris@0: rapper -i turtle $tmpttl >/dev/null 2>&1 || \ Chris@0: fail "Fails to produce parseable RDF/TTL for detectionfunction transform$note" Chris@0: Chris@0: rapper -i turtle -c $tmpttl 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' || Chris@0: fail "RDF output contains no triples (?) for detectionfunction transform$note" Chris@0: Chris@0: rm -f $tmpttl Chris@0: Chris@0: $r -t $transformpfx-onsets.n3 -t $transformpfx-detectionfunction.n3 -w rdf $infile $rdfarg --rdf-one-file $tmpttl 2>/dev/null || \ Chris@0: fail "Fails to run with detectionfunction and onsets transforms together and RDF writer$note" Chris@0: Chris@0: rapper -i turtle $tmpttl >/dev/null 2>&1 || \ Chris@0: fail "Fails to produce parseable RDF/TTL for detectionfunction and onsets transforms together$note" Chris@0: Chris@0: rapper -i turtle -c $tmpttl 2>&1 | egrep -q 'Parsing returned [1-9][0-9]+ triples' || Chris@0: fail "RDF output contains no triples (?) for detectionfunction and onsets transforms together$note" Chris@0: Chris@0: done Chris@0: Chris@0: exit 0