Chris@0: #!/bin/bash Chris@0: Chris@0: mypath=`dirname $0` Chris@3: r=$mypath/../runner/sonic-annotator Chris@0: Chris@0: infile=$mypath/audio/3clicks8.wav Chris@0: testplug=vamp:vamp-example-plugins:percussiononsets Chris@0: tmpfile1=$mypath/tmp_1_$$ Chris@0: tmpfile2=$mypath/tmp_2_$$ Chris@0: Chris@0: trap "rm -f $tmpfile1 $tmpfile2" 0 Chris@0: Chris@0: fail() { Chris@0: echo "Test failed: $1" Chris@0: exit 1 Chris@0: } Chris@0: Chris@0: $r --skeleton $testplug > $tmpfile1 2>/dev/null || \ Chris@0: fail "Fails to run with --skeleton $testplug" Chris@0: Chris@0: $r -t $tmpfile1 -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ Chris@0: fail "Fails to run with -t $tmpfile -w csv --csv-stdout $infile" Chris@0: Chris@0: cmp -s $tmpfile2 $mypath/expected/transforms-basic-skeleton-1.csv || \ Chris@0: fail "Output mismatch for transforms-basic-skeleton-1.csv" Chris@0: Chris@0: for suffix in \ Chris@0: -no-parameters-default-output \ Chris@0: -no-parameters \ Chris@0: "" \ Chris@0: -set-parameters \ Chris@0: -set-step-and-block-size \ Chris@0: -set-sample-rate \ Chris@0: ; do Chris@0: Chris@0: for type in xml n3 ; do Chris@0: Chris@0: transform=$mypath/transforms/transforms-basic-percussiononsets$suffix.$type Chris@0: expected=$mypath/expected/transforms-basic-percussiononsets$suffix.csv Chris@0: Chris@0: test -f $transform || \ Chris@0: fail "Internal error: no transforms file for suffix $suffix" Chris@0: Chris@0: test -f $expected || \ Chris@0: fail "Internal error: no expected output file for suffix $suffix" Chris@0: Chris@0: $r -t $transform -w csv --csv-stdout $infile > $tmpfile2 2>/dev/null || \ Chris@0: fail "Fails to run transform $transform" Chris@0: Chris@0: cmp -s $tmpfile2 $expected || \ Chris@0: fail "Output mismatch for transform $transform" Chris@0: done Chris@0: done Chris@0: Chris@0: exit 0 Chris@0: