summaryrefslogtreecommitdiff
path: root/examples/scripts/check.test
blob: 2a3e753d69c7f338636689eb9d3c169c081c1ea5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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