diff tests/test-helpfulflags.sh @ 0:581b1b150a4d

* copy to sonic-annotator
author Chris Cannam
date Thu, 11 Dec 2008 10:22:33 +0000
parents
children 03a02c1f0a9f
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-helpfulflags.sh	Thu Dec 11 10:22:33 2008 +0000
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+mypath=`dirname $0`
+r=$mypath/../sonic-annotator
+
+testplug=vamp:vamp-example-plugins:percussiononsets
+
+fail() {
+    echo "Test failed: $1"
+    exit 1
+}
+
+$r >/dev/null 2>&1 && \
+    fail "Return code 0 when run without args (should be a failure code)"
+
+$r 2>&1 >/dev/null | grep -q "for help" || \
+    fail "Improper response when run without args"
+
+$r --help 2>&1 | grep -q Copy || \
+    fail "Expected help not printed when run with --help"
+
+$r --list >/dev/null 2>&1 || \
+    fail "Fails to run with --list"
+
+$r --list 2>/dev/null | grep -q $testplug || \
+    fail "Fails to print $testplug in plugin list (if you haven't got it, install it -- it's needed for other tests)"
+
+$r --skeleton $testplug >/dev/null || \
+    fail "Fails to run with --skeleton $testplug"
+
+$r -s $testplug >/dev/null || \
+    fail "Fails to run with -s $testplug"
+
+$r --skeleton $testplug >/dev/null || \
+    fail "Fails to run with --skeleton $testplug"
+
+$r --skeleton $testplug | rapper -i turtle - test >/dev/null 2>&1 || \
+    fail "Invalid XML skeleton produced with --skeleton $testplug"
+
+exit 0