mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 21:10:27 +02:00
* 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.
This commit is contained in:
parent
0004be0c48
commit
211e9d8a0d
12 changed files with 220 additions and 28 deletions
|
@ -1,3 +1,24 @@
|
|||
2001-07-17 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
|
||||
|
||||
* 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 <ttn@revel.glug.org>
|
||||
|
||||
* scripts/check.test: Add check for guile interpreter.
|
||||
|
|
|
@ -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
|
||||
|
|
48
examples/box-dynamic-module/check.test
Executable file
48
examples/box-dynamic-module/check.test
Executable file
|
@ -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 | diff -u - TMP
|
||||
#<box #f>
|
||||
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 | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
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 <<EOF | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
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 | diff -u - TMP
|
||||
(#<box 1> #<box 2> #<box 3>)
|
||||
(#<box 2> #<box 3> #<box 4>)
|
||||
EOF
|
||||
rm -f TMP
|
||||
|
||||
# check.test ends here
|
|
@ -19,10 +19,14 @@
|
|||
## 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
|
||||
|
|
38
examples/box-dynamic/check.test
Executable file
38
examples/box-dynamic/check.test
Executable file
|
@ -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 | diff -u - TMP
|
||||
#<box #f>
|
||||
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 | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
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 <<EOF | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
1
|
||||
EOF
|
||||
rm -f TMP
|
||||
|
||||
# check.test ends here
|
|
@ -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 $<
|
||||
CFLAGS=-I../..
|
||||
LIBS=`GUILE_LOAD_PATH=../.. ../../libguile/guile -e main -s ../../guile-config/guile-config link` -L../../libguile
|
||||
|
|
38
examples/box-module/check.test
Executable file
38
examples/box-module/check.test
Executable file
|
@ -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 | diff -u - TMP
|
||||
#<box #f>
|
||||
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 | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
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 <<EOF | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
1
|
||||
EOF
|
||||
rm -f TMP
|
||||
|
||||
# check.test ends here
|
|
@ -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 $<
|
||||
CFLAGS=-I../..
|
||||
LIBS=`GUILE_LOAD_PATH=../.. ../../libguile/guile -e main -s ../../guile-config/guile-config link` -L../../libguile
|
||||
|
||||
TESTS = check.test
|
||||
|
|
38
examples/box/check.test
Executable file
38
examples/box/check.test
Executable file
|
@ -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 | diff -u - TMP
|
||||
#<box #f>
|
||||
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 | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
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 <<EOF | diff -u - TMP
|
||||
#<box #f>
|
||||
#<box 1>
|
||||
1
|
||||
EOF
|
||||
rm -f TMP
|
||||
|
||||
# check.test ends here
|
|
@ -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 <<EOF | diff -u - TMP
|
||||
module-0 foo
|
||||
module-0 bar
|
||||
|
|
|
@ -8,7 +8,7 @@ set -e
|
|||
#
|
||||
# ./safe untrusted.scm
|
||||
#
|
||||
$guile -s safe untrusted.scm > TMP
|
||||
GUILE_LOAD_PATH=../.. $guile -s safe untrusted.scm > TMP
|
||||
cat <<EOF | diff -u - TMP
|
||||
1
|
||||
1
|
||||
|
@ -27,7 +27,7 @@ rm -f TMP
|
|||
#
|
||||
# ./safe evil.scm
|
||||
#
|
||||
$guile -s safe evil.scm > TMP
|
||||
GUILE_LOAD_PATH=../.. $guile -s safe evil.scm > TMP
|
||||
cat <<EOF | diff -u - TMP
|
||||
** Exception: (unbound-variable #f "Unbound variable: ~S" (open-input-file) #f)
|
||||
EOF
|
||||
|
|
|
@ -16,7 +16,7 @@ set -e
|
|||
#
|
||||
# simple-hello.scm
|
||||
#
|
||||
$guile -s simple-hello.scm > TMP
|
||||
GUILE_LOAD_PATH=../.. $guile -s simple-hello.scm > TMP
|
||||
cat <<EOF | diff -u - TMP
|
||||
Hello, World!
|
||||
EOF
|
||||
|
@ -25,15 +25,15 @@ rm -f TMP
|
|||
#
|
||||
# hello
|
||||
#
|
||||
$guile -s hello > 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 <<EOF | diff -u - TMP
|
||||
Usage: hello [options...]
|
||||
--help, -h Show this usage information
|
||||
|
@ -44,6 +44,6 @@ rm -f TMP
|
|||
#
|
||||
# fact
|
||||
#
|
||||
case `$guile -s fact 5` in 120) ;; *) echo $0: error: fact 5 ;; esac
|
||||
case `GUILE_LOAD_PATH=../.. $guile -s fact 5` in 120) ;; *) echo $0: error: fact 5 ;; esac
|
||||
|
||||
# check.test ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue