Move all tests to a single directory for "make check".

git-svn-id: svn://svn.zoy.org/elk/trunk@275 55e467fa-43c5-0310-a8a2-de718669efc6
This commit is contained in:
sam 2009-12-19 12:28:36 +00:00
parent 776c2c2fcc
commit 0948041886
11 changed files with 69 additions and 65 deletions

3
.gitignore vendored
View File

@ -22,6 +22,9 @@ stamp-*
# Configure-generated files
include/site.h
scm/slib.scm
test/check-gc
test/check-gc2
test/check-r4rs
# Build-generated files
src/elk
lib/xwidgets/xaw/*.c

View File

@ -571,7 +571,7 @@ AM_CONDITIONAL(HAVE_GROFF, test "${ac_cv_my_have_groff}" = "yes")
dnl
dnl Finished!
dnl
AC_OUTPUT([
AC_CONFIG_FILES([
Makefile
doc/Makefile
doc/bitstring/Makefile
@ -587,7 +587,6 @@ AC_OUTPUT([
doc/xlib/Makefile
doc/xt/Makefile
examples/Makefile
examples/tests/Makefile
include/Makefile
lib/Makefile
lib/misc/Makefile
@ -599,10 +598,16 @@ AC_OUTPUT([
scm/Makefile
src/Makefile
test/Makefile
])
AC_CONFIG_FILES([
scm/slib.scm
include/site.h
])
AC_CONFIG_FILES([test/check-gc], [chmod 0755 test/check-gc])
AC_CONFIG_FILES([test/check-gc2], [chmod 0755 test/check-gc2])
AC_CONFIG_FILES([test/check-r4rs], [chmod 0755 test/check-r4rs])
AC_OUTPUT
cat << EOF

View File

@ -1,6 +1,5 @@
NULL =
SUBDIRS = tests
EXTRA_DIST = $(DATA)
examplesdir = $(datadir)/doc/@PACKAGE@/examples
@ -43,12 +42,6 @@ scheme_DATA = \
scheme/unify.scm \
$(NULL)
testsdir = $(examplesdir)/tests
tests_DATA = \
tests/README \
tests/r4rstest.scm \
$(NULL)
unixdir = $(examplesdir)/unix
unix_DATA = \
unix/pipsiz.scm \

View File

@ -1,20 +0,0 @@
CLEANFILES = $(allstamps) mytest.scm tmp1 tmp2 tmp3
allstamps = stamp-r4rs stamp-gc
if NATIVE_BUILD
check-local: $(allstamps)
endif
stamp-r4rs: $(top_builddir)/src/elk
rm -f $@ mytest.scm
sed -e 's/r4rstest/mytest/g' < $(srcdir)/r4rstest.scm > mytest.scm
echo '(test-cont) (test-sc4) (test-delay)' >> mytest.scm
-$(top_builddir)/src/elk -p .:$(top_srcdir)/scm -l mytest.scm
rm -f mytest.scm tmp1 tmp2 tmp3
printf "" > $@
stamp-gc: $(top_builddir)/src/elk
-$(top_builddir)/src/elk -p .:$(top_srcdir)/scm -l gc-stress.scm

View File

@ -1,33 +0,0 @@
;; this test sometimes crashes the GC with the well-known
;; Panic: Visit: object not in prev space at 0x40210b2c ('pair') 8199 8201 (dumping core).
(display "testing garbage collector integrity (1000 loops)\n")
;(set! garbage-collect-notify? #t)
(define c 0)
(define cb
(lambda ignore
(let ((s '()))
(set! c (+ 1 c))
(call/cc
(lambda (return)
(do ((i 0 (+ i 1)))
((= i 100))
(let ((a (+ i 1)))
(set! s (append s (list i))))
(if (= i 60) (return #t))))))))
(do ((i 0 (+ i 1))) ((= i 1000)) (cb))
(display "test passed.\n")
;; This test used to crash the GC, too.
(display "testing deep calls (2000 calls)\n")
(define crash
(lambda (x)
(begin
(if (> x 0)
(crash (- x 1)))
(collect))))
(crash 2000)
(display "test passed.\n")

View File

@ -1,6 +1,12 @@
# $Id$
EXTRA_DIST = check-build
EXTRA_DIST = README check-build r4rstest.scm \
check-gc.in check-gc2.in check-r4rs.in
DISTCLEANFILES = check-gc check-gc2 check-r4rs
TESTS = check-build
if NATIVE_BUILD
native_tests = check-gc check-gc2 check-r4rs
endif
TESTS = check-build $(native_tests)

26
test/check-gc.in Normal file
View File

@ -0,0 +1,26 @@
#!/bin/sh
# this test sometimes crashes the GC with the well-known
# Panic: Visit: object not in prev space at 0x40210b2c ('pair') 8199 8201 (dumping core).
cat << EOF | @top_builddir@/src/elk -p .:@top_srcdir@/scm -l -
(display "testing garbage collector integrity (10000 loops)\n")
;(set! garbage-collect-notify? #t)
(define c 0)
(define cb
(lambda ignore
(let ((s '()))
(set! c (+ 1 c))
(call/cc
(lambda (return)
(do ((i 0 (+ i 1)))
((= i 100))
(let ((a (+ i 1)))
(set! s (append s (list i))))
(if (= i 60) (return #t))))))))
(do ((i 0 (+ i 1))) ((= i 10000)) (cb))
(display "test passed.\n")
EOF

18
test/check-gc2.in Normal file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# This test used to crash the GC.
cat << EOF | @top_builddir@/src/elk -p .:@top_srcdir@/scm -l -
(display "testing deep calls (2000 calls)\n")
(define crash
(lambda (x)
(begin
(if (> x 0)
(crash (- x 1)))
(collect))))
(crash 2000)
(display "test passed.\n")
EOF

6
test/check-r4rs.in Normal file
View File

@ -0,0 +1,6 @@
#!/bin/sh
(cat @srcdir@/r4rstest.scm; echo '(test-cont) (test-sc4) (test-delay)') \
| @top_builddir@/src/elk -p .:@top_srcdir@/scm -l -
rm -f tmp1 tmp2 tmp3