Chris@0: #!/bin/bash Chris@0: Chris@0: mypath=`dirname $0` Chris@42: r=$mypath/../sonic-annotator Chris@0: Chris@0: testplug=vamp:vamp-example-plugins:percussiononsets Chris@0: Chris@0: fail() { Chris@0: echo "Test failed: $1" Chris@0: exit 1 Chris@0: } Chris@0: Chris@0: $r >/dev/null 2>&1 && \ Chris@0: fail "Return code 0 when run without args (should be a failure code)" Chris@0: Chris@0: $r 2>&1 >/dev/null | grep -q "for help" || \ Chris@0: fail "Improper response when run without args" Chris@0: Chris@0: $r --help 2>&1 | grep -q Copy || \ Chris@0: fail "Expected help not printed when run with --help" Chris@0: Chris@0: $r --list >/dev/null 2>&1 || \ Chris@0: fail "Fails to run with --list" Chris@0: Chris@0: $r --list 2>/dev/null | grep -q $testplug || \ Chris@0: fail "Fails to print $testplug in plugin list (if you haven't got it, install it -- it's needed for other tests)" Chris@0: Chris@0: $r --skeleton $testplug >/dev/null || \ Chris@0: fail "Fails to run with --skeleton $testplug" Chris@0: Chris@0: $r -s $testplug >/dev/null || \ Chris@0: fail "Fails to run with -s $testplug" Chris@0: Chris@0: $r --skeleton $testplug >/dev/null || \ Chris@0: fail "Fails to run with --skeleton $testplug" Chris@0: Chris@0: $r --skeleton $testplug | rapper -i turtle - test >/dev/null 2>&1 || \ Chris@0: fail "Invalid XML skeleton produced with --skeleton $testplug" Chris@0: Chris@0: exit 0