Make sure the test results are displayed, even when an exception
occurs running the tests. svn: r15724
This commit is contained in:
parent
79c4f9651e
commit
28d27a5074
|
@ -59,7 +59,7 @@
|
||||||
,@(map (λ (x) `(require ,x)) teachpacks)
|
,@(map (λ (x) `(require ,x)) teachpacks)
|
||||||
,@body-exps
|
,@body-exps
|
||||||
,@(if enable-testing?
|
,@(if enable-testing?
|
||||||
(if (null? body-exps) '() `((,#'run-tests) (,#'display-results)))
|
(if (null? body-exps) '() `((,#'test)))
|
||||||
'()))))
|
'()))))
|
||||||
rep)))]
|
rep)))]
|
||||||
[(require)
|
[(require)
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
(module scheme-gui scheme/base
|
(module scheme-gui scheme/base
|
||||||
|
|
||||||
(require mred framework scheme/class
|
(require mred framework scheme/class
|
||||||
mzlib/pconvert mzlib/pretty)
|
mzlib/pconvert mzlib/pretty
|
||||||
|
(for-syntax scheme/base))
|
||||||
|
|
||||||
(require (except-in "scheme-tests.ss" test) "test-display.scm")
|
(require (except-in "scheme-tests.ss" test) "test-display.scm")
|
||||||
|
|
||||||
|
@ -32,7 +33,12 @@
|
||||||
text-snip))]
|
text-snip))]
|
||||||
[else (format "~v" value)]))
|
[else (format "~v" value)]))
|
||||||
|
|
||||||
(define (test) (run-tests) (pop-up))
|
(define-syntax (test stx)
|
||||||
|
(syntax-case stx ()
|
||||||
|
[(_)
|
||||||
|
(syntax-property
|
||||||
|
#'(begin (run-tests) (pop-up))
|
||||||
|
'test-call #t)]))
|
||||||
|
|
||||||
(define (pop-up)
|
(define (pop-up)
|
||||||
(let ([test-info (namespace-variable-value 'test~object #f builder (current-namespace))])
|
(let ([test-info (namespace-variable-value 'test~object #f builder (current-namespace))])
|
||||||
|
|
|
@ -225,7 +225,15 @@
|
||||||
(namespace-set-variable-value! 'test~object te (current-namespace))
|
(namespace-set-variable-value! 'test~object te (current-namespace))
|
||||||
te))
|
te))
|
||||||
|
|
||||||
(define (test) (run-tests) (display-results))
|
(define-syntax (test stx)
|
||||||
|
(syntax-case stx ()
|
||||||
|
[(_)
|
||||||
|
(syntax-property
|
||||||
|
#'(dynamic-wind
|
||||||
|
values
|
||||||
|
(lambda () (run-tests))
|
||||||
|
(lambda () (display-results)))
|
||||||
|
'test-call #t)]))
|
||||||
|
|
||||||
(define-syntax (run-tests stx)
|
(define-syntax (run-tests stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user