From ea985a81d618e5406c29c5b7e059a71c1009a265 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Tue, 19 Oct 2010 17:16:00 -0500 Subject: [PATCH] added some more information to the error messages when a syncheck test case fails --- collects/drracket/private/syncheck/gui.rkt | 7 ++++++- collects/tests/drracket/syncheck-test.rkt | 10 ++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/collects/drracket/private/syncheck/gui.rkt b/collects/drracket/private/syncheck/gui.rkt index ed7e59afef..faa0ca93b2 100644 --- a/collects/drracket/private/syncheck/gui.rkt +++ b/collects/drracket/private/syncheck/gui.rkt @@ -1022,7 +1022,8 @@ If the namespace does not, they are colored the unbound color. (define syncheck-frame<%> (interface () syncheck:button-callback - syncheck:error-report-visible?)) + syncheck:error-report-visible? + syncheck:get-error-report-contents)) (define tab-mixin @@ -1154,6 +1155,10 @@ If the namespace does not, they are colored the unbound color. (and (is-a? report-error-parent-panel area-container<%>) (member report-error-panel (send report-error-parent-panel get-children)))) + (define/public-final (syncheck:get-error-report-contents) + (and (syncheck:error-report-visible?) + (send (send report-error-canvas get-editor) get-text))) + (define/public (hide-error-report) (when (syncheck:error-report-visible?) (send (get-current-tab) turn-off-error-report) diff --git a/collects/tests/drracket/syncheck-test.rkt b/collects/tests/drracket/syncheck-test.rkt index 20cd3cf0e7..92cb8eff4b 100644 --- a/collects/tests/drracket/syncheck-test.rkt +++ b/collects/tests/drracket/syncheck-test.rkt @@ -898,10 +898,12 @@ trigger runtime errors in check syntax. (when (send defs in-edit-sequence?) (error 'syncheck-test.rkt "still in edit sequence for ~s" input)) - (when (send drs syncheck:error-report-visible?) - (fprintf (current-error-port) - "FAILED ~s\n error report window is visible\n" - input)) + (let ([err (send drs syncheck:get-error-report-contents)]) + (when err + (fprintf (current-error-port) + "FAILED ~s\n error report window is visible:\n ~a\n" + input + err))) ;; need to check for syntax error here (let ([got (get-annotated-output drs)])