diff --git a/examples/ChangeLog b/examples/ChangeLog index ff3ddc2f6..958925215 100644 --- a/examples/ChangeLog +++ b/examples/ChangeLog @@ -1,3 +1,24 @@ +2001-07-17 Martin Grabmueller + + * box-module/Makefile.am (TESTS): New variable. + Create `box' on `make all'. + + * box-module/check.test, box-dynamic-module/check.test, + * box-dynamic/check.test: New files. + + * box-dynamic/Makefile.am (libbox): Create box library on `make + all'. + (TESTS): New variable. + + * box/Makefile.am (TESTS): New variable. + Create `box' program on `make all', use freshly built Guile for + building. + + * box/check.test: New file. + + * modules/check.test, safe/check.test, scripts/check.test: Set + GUILE_LOAD_PATH to make the tests run without installed Guile. + 2001-07-16 Thien-Thi Nguyen * scripts/check.test: Add check for guile interpreter. diff --git a/examples/box-dynamic-module/Makefile.am b/examples/box-dynamic-module/Makefile.am index 4d7df0210..3944f468e 100644 --- a/examples/box-dynamic-module/Makefile.am +++ b/examples/box-dynamic-module/Makefile.am @@ -19,10 +19,17 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA +all: libbox-module + EXTRA_DIST = README box.c box-module.scm box-mixed.scm -CFLAGS=`guile-config compile` -LIBS=`guile-config link` +CFLAGS=-I../.. +LIBS=`GUILE_LOAD_PATH=../.. ../../libguile/guile -e main -s ../../guile-config/guile-config link` -L../../libguile + +TESTS = check.test + +#CFLAGS=`guile-config compile` +#LIBS=`guile-config link` libbox-module: box.lo sh ../../libtool --mode=link $(CC) $< $(LIBS) -rpath $(prefix)/lib -o libbox-module.la diff --git a/examples/box-dynamic-module/check.test b/examples/box-dynamic-module/check.test new file mode 100755 index 000000000..77a5209c9 --- /dev/null +++ b/examples/box-dynamic-module/check.test @@ -0,0 +1,48 @@ +#!/bin/sh + +# must be run from this directory +guile=${GUILE-../../libguile/guile} + +set -e + +# +# ./box test #1 +# +LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=../..:. ../../libguile/guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP +cat < +EOF +rm -f TMP + +# +# ./box test #2 +# +LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=../..:. ../../libguile/guile -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box test #3 +# +LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=../..:. ../../libguile/guile -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 +cat < +# +1 +EOF +rm -f TMP + +# +# ./box test #4 +# +LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=../..:. ../../libguile/guile -c '(begin (use-modules (box-mixed)) (let ((b (make-box-list 1 2 3))) (display b) (newline) (display (box-map 1+ b)) (newline)))' > TMP +cat < # #) +(# # #) +EOF +rm -f TMP + +# check.test ends here diff --git a/examples/box-dynamic/Makefile.am b/examples/box-dynamic/Makefile.am index 7bb9f46c2..639ef202d 100644 --- a/examples/box-dynamic/Makefile.am +++ b/examples/box-dynamic/Makefile.am @@ -19,13 +19,17 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA +all: libbox + EXTRA_DIST = README box.c -CFLAGS=`guile-config compile` -LIBS=`guile-config link` +CFLAGS=-I../.. +LIBS=`GUILE_LOAD_PATH=../.. ../../libguile/guile -e main -s ../../guile-config/guile-config link` -L../../libguile + +TESTS = check.test libbox: box.lo sh ../../libtool --mode=link $(CC) $< $(LIBS) -rpath $(prefix)/lib -o libbox.la box.lo: box.c - sh ../../libtool --mode=compile $(CC) $(CFLAGS) -c $< \ No newline at end of file + sh ../../libtool --mode=compile $(CC) $(CFLAGS) -c $< diff --git a/examples/box-dynamic/check.test b/examples/box-dynamic/check.test new file mode 100755 index 000000000..1df1672bd --- /dev/null +++ b/examples/box-dynamic/check.test @@ -0,0 +1,38 @@ +#!/bin/sh + +# must be run from this directory +guile=${GUILE-../../libguile/guile} + +set -e + +# +# ./box test #1 +# +LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=../..:. ../../libguile/guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline)))' > TMP +cat < +EOF +rm -f TMP + +# +# ./box test #2 +# +LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=../..:. ../../libguile/guile -c '(begin (load-extension "libbox" "scm_init_box") (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box test #3 +# +LTDL_LIBRARY_PATH=.libs GUILE_LOAD_PATH=../..:. ../../libguile/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 +cat < +# +1 +EOF +rm -f TMP + +# check.test ends here diff --git a/examples/box-module/Makefile.am b/examples/box-module/Makefile.am index 3e1f92032..01d567d38 100644 --- a/examples/box-module/Makefile.am +++ b/examples/box-module/Makefile.am @@ -19,13 +19,11 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -EXTRA_DIST = README box.c +noinst_PROGRAMS = box -CFLAGS=`guile-config compile` -LIBS=`guile-config link` +box_SOURCES = box.c -box: box.o - $(CC) $< $(LIBS) -o box +EXTRA_DIST = README -box.o: box.c - $(CC) $(CFLAGS) -c $< \ No newline at end of file +CFLAGS=-I../.. +LIBS=`GUILE_LOAD_PATH=../.. ../../libguile/guile -e main -s ../../guile-config/guile-config link` -L../../libguile diff --git a/examples/box-module/check.test b/examples/box-module/check.test new file mode 100755 index 000000000..cb379d179 --- /dev/null +++ b/examples/box-module/check.test @@ -0,0 +1,38 @@ +#!/bin/sh + +# must be run from this directory +guile=${GUILE-../../libguile/guile} + +set -e + +# +# ./box test #1 +# +GUILE_LOAD_PATH=../..:. ./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline)))' > TMP +cat < +EOF +rm -f TMP + +# +# ./box test #2 +# +GUILE_LOAD_PATH=../..:. ./box -c '(begin (use-modules (box-module)) (let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline)))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box test #3 +# +GUILE_LOAD_PATH=../..:. ./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 +cat < +# +1 +EOF +rm -f TMP + +# check.test ends here diff --git a/examples/box/Makefile.am b/examples/box/Makefile.am index 3e1f92032..8c6dae7a6 100644 --- a/examples/box/Makefile.am +++ b/examples/box/Makefile.am @@ -19,13 +19,13 @@ ## to the Free Software Foundation, Inc., 59 Temple Place, Suite ## 330, Boston, MA 02111-1307 USA -EXTRA_DIST = README box.c +noinst_PROGRAMS = box -CFLAGS=`guile-config compile` -LIBS=`guile-config link` +box_SOURCES = box.c -box: box.o - $(CC) $< $(LIBS) -o box +EXTRA_DIST = README -box.o: box.c - $(CC) $(CFLAGS) -c $< \ No newline at end of file +CFLAGS=-I../.. +LIBS=`GUILE_LOAD_PATH=../.. ../../libguile/guile -e main -s ../../guile-config/guile-config link` -L../../libguile + +TESTS = check.test diff --git a/examples/box/check.test b/examples/box/check.test new file mode 100755 index 000000000..c61306439 --- /dev/null +++ b/examples/box/check.test @@ -0,0 +1,38 @@ +#!/bin/sh + +# must be run from this directory +guile=${GUILE-../../libguile/guile} + +set -e + +# +# ./box test #1 +# +GUILE_LOAD_PATH=../.. ./box -c '(let ((b (make-box))) (display b) (newline))' > TMP +cat < +EOF +rm -f TMP + +# +# ./box test #2 +# +GUILE_LOAD_PATH=../.. ./box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline))' > TMP +cat < +# +EOF +rm -f TMP + +# +# ./box test #3 +# +GUILE_LOAD_PATH=../.. ./box -c '(let ((b (make-box))) (display b) (newline) (box-set! b 1) (display b) (newline) (display (box-ref b)) (newline))' > TMP +cat < +# +1 +EOF +rm -f TMP + +# check.test ends here diff --git a/examples/modules/check.test b/examples/modules/check.test index 394920306..9dd66e6a7 100755 --- a/examples/modules/check.test +++ b/examples/modules/check.test @@ -6,9 +6,9 @@ guile=${GUILE-../../libguile/guile} set -e # -# ./safe untrusted.scm +# ./main test # -$guile -s main > TMP +GUILE_LOAD_PATH=../.. $guile -s main > TMP cat < TMP +GUILE_LOAD_PATH=../.. $guile -s safe untrusted.scm > TMP cat < TMP +GUILE_LOAD_PATH=../.. $guile -s safe evil.scm > TMP cat < TMP +GUILE_LOAD_PATH=../.. $guile -s simple-hello.scm > TMP cat < TMP +GUILE_LOAD_PATH=../.. $guile -s hello > TMP echo "Hello, World!" | diff -u - TMP rm -f TMP -$guile -s hello --version > TMP +GUILE_LOAD_PATH=../.. $guile -s hello --version > TMP echo "hello 0.0.1" | diff -u - TMP rm -f TMP -$guile -s hello --help > TMP +GUILE_LOAD_PATH=../.. $guile -s hello --help > TMP cat <