The call to display-results depends on the value of the current-namespace
parameter. Specifically, it is expected to be a namespace that has the GUI bindings available. Unfortunately, during the dynamic extent of the uncaught-exception-handler when a syntax error is raised, this may not be the case because you get a phase 1 namespace, not a phase 0 one. So, move the call to display-results to the code that runs the student language programs and out of the uncaught exception handler.
This commit is contained in:
parent
e2958e0605
commit
8032705cf9
|
@ -157,11 +157,6 @@
|
|||
(namespace-require scheme-signature-module-name)
|
||||
;; hack: the test-engine code knows about the test~object name; we do, too
|
||||
(namespace-set-variable-value! 'test~object (build-test-engine))
|
||||
(uncaught-exception-handler
|
||||
(let ((previous (uncaught-exception-handler)))
|
||||
(lambda (exc)
|
||||
(display-results)
|
||||
(previous exc))))
|
||||
;; record signature violations with the test engine
|
||||
(signature-violation-proc
|
||||
(lambda (obj signature message blame)
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
#f
|
||||
`(,#'module ,module-name ,language-module
|
||||
,@(map (λ (x) `(require ,x)) teachpacks)
|
||||
,@body-exps
|
||||
,@(if enable-testing?
|
||||
(if (null? body-exps)
|
||||
'()
|
||||
|
@ -65,24 +64,26 @@
|
|||
;; over to the one that is used in the REPL when module->namepsace
|
||||
;; grabs a hold of this module to make a namespace for the REPL
|
||||
`(,(syntax-property
|
||||
#'(define test~object (namespace-variable-value 'test~object))
|
||||
'test-call #t)
|
||||
(,#'test)))
|
||||
'()))))
|
||||
#'(define test~object (namespace-variable-value 'test~object))
|
||||
'test-call #t)))
|
||||
'())
|
||||
,@body-exps)))
|
||||
rep)))]
|
||||
[(require)
|
||||
(set! state 'done-or-exn)
|
||||
(stepper-syntax-property
|
||||
(quasisyntax
|
||||
(let ([done-already? #f])
|
||||
(dynamic-wind
|
||||
void
|
||||
(lambda ()
|
||||
(dynamic-require ''#,module-name #f)) ;; work around a bug in dynamic-require
|
||||
(lambda ()
|
||||
(unless done-already?
|
||||
(set! done-already? #t)
|
||||
(current-namespace (module->namespace ''#,module-name)))))))
|
||||
#`(let ([done-already? #f])
|
||||
(dynamic-wind
|
||||
void
|
||||
(lambda ()
|
||||
(dynamic-require ''#,module-name #f)) ;; work around a bug in dynamic-require
|
||||
(lambda ()
|
||||
(unless done-already?
|
||||
(set! done-already? #t)
|
||||
#,(if enable-testing?
|
||||
#'(test)
|
||||
#'(begin))
|
||||
(current-namespace (module->namespace ''#,module-name))))))
|
||||
'stepper-skip-completely
|
||||
#t)]
|
||||
[(done-or-exn)
|
||||
|
|
Loading…
Reference in New Issue
Block a user