Mercurial > hg > sonic-annotator
annotate tests/test-helpfulflags.sh @ 50:d40b62a2006f
Add forgotten test file!
author | Chris Cannam |
---|---|
date | Wed, 15 Jun 2011 15:39:08 +0100 |
parents | 94d988cef54e |
children | 2633976fbef5 |
rev | line source |
---|---|
Chris@0 | 1 #!/bin/bash |
Chris@0 | 2 |
Chris@0 | 3 mypath=`dirname $0` |
Chris@42 | 4 r=$mypath/../sonic-annotator |
Chris@0 | 5 |
Chris@0 | 6 testplug=vamp:vamp-example-plugins:percussiononsets |
Chris@0 | 7 |
Chris@0 | 8 fail() { |
Chris@0 | 9 echo "Test failed: $1" |
Chris@0 | 10 exit 1 |
Chris@0 | 11 } |
Chris@0 | 12 |
Chris@0 | 13 $r >/dev/null 2>&1 && \ |
Chris@0 | 14 fail "Return code 0 when run without args (should be a failure code)" |
Chris@0 | 15 |
Chris@0 | 16 $r 2>&1 >/dev/null | grep -q "for help" || \ |
Chris@0 | 17 fail "Improper response when run without args" |
Chris@0 | 18 |
Chris@0 | 19 $r --help 2>&1 | grep -q Copy || \ |
Chris@0 | 20 fail "Expected help not printed when run with --help" |
Chris@0 | 21 |
Chris@0 | 22 $r --list >/dev/null 2>&1 || \ |
Chris@0 | 23 fail "Fails to run with --list" |
Chris@0 | 24 |
Chris@0 | 25 $r --list 2>/dev/null | grep -q $testplug || \ |
Chris@0 | 26 fail "Fails to print $testplug in plugin list (if you haven't got it, install it -- it's needed for other tests)" |
Chris@0 | 27 |
Chris@0 | 28 $r --skeleton $testplug >/dev/null || \ |
Chris@0 | 29 fail "Fails to run with --skeleton $testplug" |
Chris@0 | 30 |
Chris@0 | 31 $r -s $testplug >/dev/null || \ |
Chris@0 | 32 fail "Fails to run with -s $testplug" |
Chris@0 | 33 |
Chris@0 | 34 $r --skeleton $testplug >/dev/null || \ |
Chris@0 | 35 fail "Fails to run with --skeleton $testplug" |
Chris@0 | 36 |
Chris@0 | 37 $r --skeleton $testplug | rapper -i turtle - test >/dev/null 2>&1 || \ |
Chris@0 | 38 fail "Invalid XML skeleton produced with --skeleton $testplug" |
Chris@0 | 39 |
Chris@0 | 40 exit 0 |