summaryrefslogtreecommitdiff
path: root/examples/scripts/check.test
diff options
context:
space:
mode:
authorMartin Grabmüller <mgrabmue@cs.tu-berlin.de>2001-07-27 16:11:13 +0000
committerMartin Grabmüller <mgrabmue@cs.tu-berlin.de>2001-07-27 16:11:13 +0000
commit024001c213e229f9a6ba0066184f59349559003a (patch)
tree9c7613f25394238f09275efebd88194070abe8bf /examples/scripts/check.test
parenta0f5718e1556066cc536a7871529dc077b70a594 (diff)
downloadguile-024001c213e229f9a6ba0066184f59349559003a.tar.gz
Check in forgotten test scripts.
Diffstat (limited to 'examples/scripts/check.test')
-rwxr-xr-xexamples/scripts/check.test53
1 files changed, 53 insertions, 0 deletions
diff --git a/examples/scripts/check.test b/examples/scripts/check.test
new file mode 100755
index 000000000..2a3e753d6
--- /dev/null
+++ b/examples/scripts/check.test
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# must be run from this directory
+guile=${GUILE-../../libguile/guile}
+if [ -x $guile ] ; then
+ :
+else
+ echo could not find guile interpreter.
+ echo '(are you running this script from' `dirname $0` '?)'
+ echo GUILE env var: ${GUILE-not set}
+ exit 1
+fi
+
+if test "X$srcdir" = X; then
+ srcdir=.
+fi
+
+set -e
+
+#
+# simple-hello.scm
+#
+$guile -s $srcdir/simple-hello.scm > TMP
+cat <<EOF | diff -u - TMP
+Hello, World!
+EOF
+rm -f TMP
+
+#
+# hello
+#
+$guile -s $srcdir/hello > TMP
+echo "Hello, World!" | diff -u - TMP
+rm -f TMP
+
+$guile -s $srcdir/hello --version > TMP
+echo "hello 0.0.1" | diff -u - TMP
+rm -f TMP
+
+$guile -s $srcdir/hello --help > TMP
+cat <<EOF | diff -u - TMP
+Usage: hello [options...]
+ --help, -h Show this usage information
+ --version, -v Show version information
+EOF
+rm -f TMP
+
+#
+# fact
+#
+case `$guile -s $srcdir/fact 5` in 120) ;; *) echo $0: error: fact 5 ;; esac
+
+# check.test ends here