From: Tobias R. <tri...@us...> - 2009-12-16 09:59:39
|
Update of /cvsroot/sbcl/sbcl/tests In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv31538/tests Modified Files: expect.sh compiler.test.sh Log Message: 1.0.33.13: Catch errors during compile-time-too processing. * Errors signaled within an (EVAL-WHEN (:COMPILE-TOPLEVEL) ...), i.e. during ``compile-time-too' processing, are now caught and reported just like errors at macroexpansion time. Previously, we landed in the debugger from within the compiler and thus provided pretty much no information about the actual source context to the user. Now, we won't land in the debugger, and the appropriate source context is reported along the error. * Some slight generalization in the test suite. * So we can add tests for errors in EVAL-WHEN and during macroexpansion. Index: expect.sh =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/expect.sh,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- expect.sh 21 May 2008 12:25:44 -0000 1.7 +++ expect.sh 16 Dec 2009 09:58:54 -0000 1.8 @@ -99,24 +99,24 @@ check_status_maybe_lose abort-compile $? } -fail_on_compiler_note () +fail_on_condition_during_compile () { run_sbcl <<EOF - (handler-bind ((sb-ext:compiler-note #'error)) - (compile-file "$1") + (handler-bind (($1 #'error)) + (compile-file "$2") (sb-ext:quit :unix-status $EXIT_LISP_WIN)) EOF - check_status_maybe_lose fail-on-compiler-note $? + check_status_maybe_lose "fail-on-condition_$1" $? } -expect_compiler_note () +expect_condition_during_compile () { run_sbcl <<EOF - (handler-bind ((sb-ext:compiler-note (lambda (c) - (declare (ignore c)) - (sb-ext:quit :unix-status - $EXIT_LISP_WIN)))) - (compile-file "$1")) + (handler-bind (($1 (lambda (c) + (declare (ignore c)) + (sb-ext:quit :unix-status $EXIT_LISP_WIN)))) + (compile-file "$2")) EOF - check_status_maybe_lose expect-compiler-note $? + check_status_maybe_lose "expect-condition_$1" $? } + Index: compiler.test.sh =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/compiler.test.sh,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- compiler.test.sh 12 Nov 2009 10:42:50 -0000 1.27 +++ compiler.test.sh 16 Dec 2009 09:58:57 -0000 1.28 @@ -156,7 +156,7 @@ (defun foo (x) (error x)) EOF -fail_on_compiler_note $tmpfilename +fail_on_condition_during_compile sb-ext:compiler-note $tmpfilename # test case from Rudi for some CLOS WARNINGness that shouldn't have # been there @@ -213,7 +213,7 @@ (declare (muffle-conditions code-deletion-note)) (if t (foo) (foo))) EOF -fail_on_compiler_note $tmpfilename +fail_on_condition_during_compile sb-ext:compiler-note $tmpfilename cat > $tmpfilename <<EOF (defun foo (x y) @@ -221,7 +221,7 @@ (declare (optimize speed)) (+ x y)) EOF -fail_on_compiler_note $tmpfilename +fail_on_condition_during_compile sb-ext:compiler-note $tmpfilename cat > $tmpfilename <<EOF (declaim (muffle-conditions compiler-note)) @@ -229,7 +229,7 @@ (declare (optimize speed)) (+ x y)) EOF -fail_on_compiler_note $tmpfilename +fail_on_condition_during_compile sb-ext:compiler-note $tmpfilename cat > $tmpfilename <<EOF (declaim (muffle-conditions compiler-note)) @@ -238,7 +238,7 @@ (declare (optimize speed)) (+ x y)) EOF -expect_compiler_note $tmpfilename +expect_condition_during_compile sb-ext:compiler-note $tmpfilename # undefined variable causes a WARNING cat > $tmpfilename <<EOF @@ -441,5 +441,17 @@ EOF expect_clean_cload $tmpfilename +cat > $tmpfilename <<EOF +(in-package :cl-user) +(defmacro foo () (error "ERROR at macroexpansion time.")) +(defun bar () (foo)) +EOF +expect_condition_during_compile sb-c:compiler-error $tmpfilename + +cat > $tmpfilename <<EOF +(eval-when (:compile-toplevel) + (error "ERROR within EVAL-WHEN.")) +EOF +expect_condition_during_compile sb-c:compiler-error $tmpfilename # success exit $EXIT_TEST_WIN |