3 # must be run from this directory
4 guile=${GUILE-../libguile/guile}
5 if [ -x $guile ] ; then
8 echo could not find guile interpreter.
9 echo '(are you running this script from' `dirname $0` '?)'
10 echo GUILE env var: ${GUILE-not set}
14 if test "X$srcdir" = X; then
23 $guile -s $srcdir/scripts/simple-hello.scm > TMP
24 cat <<EOF | diff -u - TMP
32 $guile -s $srcdir/scripts/hello > TMP
33 echo "Hello, World!" | diff -u - TMP
36 $guile -s $srcdir/scripts/hello --version > TMP
37 echo "hello 0.0.1" | diff -u - TMP
40 $guile -s $srcdir/scripts/hello --help > TMP
41 cat <<EOF | diff -u - TMP
42 Usage: hello [options...]
43 --help, -h Show this usage information
44 --version, -v Show version information
51 case `$guile -s $srcdir/scripts/fact 5` in 120) ;; *) echo $0: error: fact 5 ;; esac
57 ./box/box -c '(let ((b (make-box))) (display b) (newline))' > TMP
58 cat <<EOF | diff -u - TMP
66 ./box/box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline))' > TMP
67 cat <<EOF | diff -u - TMP
76 ./box/box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline))' > TMP
77 cat <<EOF | diff -u - TMP
87 # ./box-module/box test #1
89 ./box-module/box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP
90 cat <<EOF | diff -u - TMP
96 # ./box-module/box test #2
98 ./box-module/box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP
99 cat <<EOF | diff -u - TMP
106 # ./box-module/box test #3
108 ./box-module/box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP
109 cat <<EOF | diff -u - TMP
118 # ./box-dynamic/box test #1
120 $guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline)))' > TMP
121 cat <<EOF | diff -u - TMP
127 # ./box-dynamic/box test #2
129 $guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP
130 cat <<EOF | diff -u - TMP
137 # ./box-dynamic/box test #3
139 $guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP
140 cat <<EOF | diff -u - TMP
149 # ./box-dynamic-module/box test #1
151 $guile -L $srcdir/box-dynamic-module \
152 -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP
153 cat <<EOF | diff -u - TMP
159 # ./box-dynamic-module/box test #2
161 $guile -L $srcdir/box-dynamic-module \
162 -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP
163 cat <<EOF | diff -u - TMP
170 # ./box-dynamic-module/box test #3
172 $guile -L $srcdir/box-dynamic-module \
173 -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline)))' > TMP
174 cat <<EOF | diff -u - TMP
182 # ./box-dynamic-module/box test #4
184 $guile -L $srcdir/box-dynamic-module \
185 -c '(begin (use-modules (box-mixed)) (let ((b (make-box-list 1 2 3))) (display b) (newline) (display (box-map 1+ b)) (newline)))' > TMP
186 cat <<EOF | diff -u - TMP
187 (#<box 1> #<box 2> #<box 3>)
188 (#<box 2> #<box 3> #<box 4>)
197 $guile -L $srcdir/modules -s $srcdir/modules/main > TMP
198 cat <<EOF | diff -u - TMP
211 # ./safe untrusted.scm
213 $guile -s $srcdir/safe/safe $srcdir/safe/untrusted.scm > TMP
214 cat <<EOF | diff -u - TMP
232 $guile -s $srcdir/safe/safe $srcdir/safe/evil.scm > TMP
233 cat <<EOF | diff -u - TMP
234 ** Exception: (unbound-variable #f "Unbound variable: ~S" (open-input-file) #f)
238 # check.test ends here