From 2d04022ce290feb5eb3d59fc066b5aeed5909cbf Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Sun, 21 Oct 2007 20:45:45 +0000 Subject: [PATCH] * tests/continuations.test ("continuations"): Use with-debugging-evaluator. * lib.scm (with-debugging-evaluator*, with-debugging-evaluator): New utilities. * standalone/test-use-srfi: Use -q to avoid picking up the user's ~/.guile file. * tests/eval.test (promises)[unmemoizing a promise]: New test. --- test-suite/ChangeLog | 13 +++++++++++++ test-suite/lib.scm | 19 +++++++++++++++++++ test-suite/standalone/test-use-srfi | 12 ++++++------ test-suite/tests/continuations.test | 7 ++----- test-suite/tests/eval.test | 18 +++++++++++++++++- 5 files changed, 57 insertions(+), 12 deletions(-) diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog index a48a11c12..d7bf15be9 100644 --- a/test-suite/ChangeLog +++ b/test-suite/ChangeLog @@ -1,3 +1,16 @@ +2007-10-21 Neil Jerram + + * tests/continuations.test ("continuations"): Use + with-debugging-evaluator. + + * lib.scm (with-debugging-evaluator*, with-debugging-evaluator): + New utilities. + + * standalone/test-use-srfi: Use -q to avoid picking up the user's + ~/.guile file. + + * tests/eval.test (promises)[unmemoizing a promise]: New test. + 2007-10-20 Julian Graham * tests/threads.test: Use proper `define-module'. diff --git a/test-suite/lib.scm b/test-suite/lib.scm index 2daf95c60..c4ddf9e7c 100644 --- a/test-suite/lib.scm +++ b/test-suite/lib.scm @@ -42,6 +42,9 @@ with-test-prefix with-test-prefix* current-test-prefix format-test-name + ;; Using the debugging evaluator. + with-debugging-evaluator with-debugging-evaluator* + ;; Reporting results in various ways. register-reporter unregister-reporter reporter-registered? make-count-reporter print-counts @@ -408,6 +411,22 @@ (defmacro with-test-prefix (prefix . body) `(with-test-prefix* ,prefix (lambda () ,@body))) +;;; Call THUNK using the debugging evaluator. +(define (with-debugging-evaluator* thunk) + (let ((dopts #f)) + (dynamic-wind + (lambda () + (set! dopts (debug-options)) + (debug-enable 'debug)) + thunk + (lambda () + (debug-options dopts))))) + +;;; Evaluate BODY... using the debugging evaluator. +(define-macro (with-debugging-evaluator . body) + `(with-debugging-evaluator* (lambda () ,@body))) + + ;;;; REPORTERS ;;;; diff --git a/test-suite/standalone/test-use-srfi b/test-suite/standalone/test-use-srfi index 309b3bda7..7186b5a24 100755 --- a/test-suite/standalone/test-use-srfi +++ b/test-suite/standalone/test-use-srfi @@ -19,14 +19,14 @@ # Test that two srfi numbers on the command line work. # -guile --use-srfi=1,10 >/dev/null </dev/null </dev/null </dev/null </dev/null </dev/null </dev/null <