fix bugs in the way the Racket|Disable Tests menu item worked
also adjust the test-engine-test.rkt test suite to bring it into
sync with the changes to the way the DrRacket REPL works from
commit bfa6b1d953
This commit is contained in:
parent
2cacbfe8e2
commit
462a348f19
|
@ -170,7 +170,8 @@
|
|||
[scheme-test-module-name
|
||||
((current-module-name-resolver) '(lib "test-engine/scheme-tests.rkt") #f #f)]
|
||||
[scheme-signature-module-name
|
||||
((current-module-name-resolver) '(lib "deinprogramm/signature/signature-german.rkt") #f #f)])
|
||||
((current-module-name-resolver) '(lib "deinprogramm/signature/signature-german.rkt") #f #f)]
|
||||
[tests-on? (preferences:get 'test-engine:enable?)])
|
||||
(run-in-user-thread
|
||||
(lambda ()
|
||||
(when (getenv "PLTDRHTDPNOCOMPILED") (use-compiled-file-paths '()))
|
||||
|
@ -201,7 +202,7 @@
|
|||
(send (send engine get-info) signature-failed
|
||||
obj signature message blame))))))
|
||||
(scheme-test-data (list (drscheme:rep:current-rep) drs-eventspace test-display%))
|
||||
(test-execute (get-preference 'tests:enable? (lambda () #t)))
|
||||
(test-execute tests-on?)
|
||||
(signature-checking-enabled? (preferences:get 'signatures:enable-checking?))
|
||||
(test-format (make-formatter (lambda (v o)
|
||||
(render-value/format (if (procedure? v)
|
||||
|
|
|
@ -143,7 +143,8 @@
|
|||
[scheme-test-module-name
|
||||
((current-module-name-resolver) '(lib "test-engine/scheme-tests.ss") #f #f)]
|
||||
[scheme-signature-module-name
|
||||
((current-module-name-resolver) '(lib "deinprogramm/signature/signature-english.rkt") #f #f)])
|
||||
((current-module-name-resolver) '(lib "deinprogramm/signature/signature-english.rkt") #f #f)]
|
||||
[tests-on? (preferences:get 'test-engine:enable?)])
|
||||
(run-in-user-thread
|
||||
(lambda ()
|
||||
(when (getenv "PLTDRHTDPNOCOMPILED") (use-compiled-file-paths '()))
|
||||
|
@ -171,7 +172,7 @@
|
|||
(send (send engine get-info) signature-failed
|
||||
obj signature message blame))))))
|
||||
(scheme-test-data (list (drscheme:rep:current-rep) drs-eventspace test-display%))
|
||||
(test-execute (get-preference 'tests:enable? (lambda () #t)))
|
||||
(test-execute tests-on?)
|
||||
(signature-checking-enabled? (get-preference 'signatures:enable-checking? (lambda () #t)))
|
||||
(test-format (make-formatter (lambda (v o) (render-value/format v settings o 40)))))))
|
||||
(super on-execute settings run-in-user-thread)
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
(when enabled?
|
||||
(set! enabled? #f)
|
||||
(send this set-label enable-label)
|
||||
(preferences:set 'test-engine:enable? #t)))
|
||||
(preferences:set 'test-engine:enable? #f)))
|
||||
(super-instantiate ()))]
|
||||
[enable? (preferences:get 'test-engine:enable?)]
|
||||
[enable-menu-item (make-object enable-menu-item%
|
||||
|
|
|
@ -39,11 +39,11 @@
|
|||
(list (make-signature-violation "\"bar\"" 1 7)))
|
||||
(test-expression "(: foo (Integer -> Integer)) (define (foo x) x) (foo \"foo\")"
|
||||
"\"foo\""
|
||||
#:repl-expected "foo: this name was defined previously and cannot be re-defined\n\"foo\""
|
||||
#:repl-expected "foo: this name was defined previously and cannot be re-defined\n"
|
||||
#:signature-violations-expected
|
||||
(list (make-signature-violation "\"foo\" at line 1, column 48 " 1 8))
|
||||
#:repl-signature-violations-expected
|
||||
(list (make-signature-violation "\"foo\" at line 4, column 50 " 1 8)))
|
||||
(list))
|
||||
(test-expression "(: foo (Integer -> Integer)) (define foo (lambda (x) x))"
|
||||
""
|
||||
#:repl-expression "(foo \"foo\")"
|
||||
|
@ -62,11 +62,11 @@
|
|||
(list (make-signature-violation "\"bar\"" 1 7)))
|
||||
(test-expression "(: foo (integer -> integer)) (define foo (lambda (x) x)) (foo \"foo\")"
|
||||
"\"foo\""
|
||||
#:repl-expected "define: Zweite Definition für denselben Namen\n\"foo\""
|
||||
#:repl-expected "define: Zweite Definition für denselben Namen"
|
||||
#:signature-violations-expected
|
||||
(list (make-signature-violation "\"foo\" at line 1, column 57 " 1 8))
|
||||
#:repl-signature-violations-expected
|
||||
(list (make-signature-violation "\"foo\" at line 4, column 59 " 1 8)))
|
||||
(list))
|
||||
(test-expression "(: foo (integer -> integer)) (define foo (lambda (x) x))"
|
||||
""
|
||||
#:repl-expression "(foo \"foo\")"
|
||||
|
@ -459,7 +459,20 @@
|
|||
(check-failures (append signature-violations-expected repl-signature-violations-expected)
|
||||
(append check-failures-expected repl-check-failures-expected))))
|
||||
|
||||
(define (test-disabling-tests)
|
||||
(define drs (wait-for-drscheme-frame))
|
||||
|
||||
(parameterize ([language (list "How to Design Programs" #rx"Beginning Student(;|$)")])
|
||||
(prepare-for-test-expression)
|
||||
(test:menu-select "Racket" "Disable Tests")
|
||||
(test-expression "(check-expect 1 2)" "Tests disabled.")
|
||||
(test:menu-select "Racket" "Enable Tests"))
|
||||
|
||||
(parameterize ([language (list "DeinProgramm" #rx"Die Macht der Abstraktion - Anfänger(;|$)")])
|
||||
(prepare-for-test-expression)
|
||||
(test:menu-select "Racket" "Disable Tests")
|
||||
(test-expression "(check-expect 1 2)" "Tests disabled.")
|
||||
(test:menu-select "Racket" "Enable Tests")))
|
||||
|
||||
(define-syntax (go stx)
|
||||
(syntax-case stx ()
|
||||
|
@ -479,6 +492,7 @@
|
|||
(go DMdA-beginner)
|
||||
(go DMdA-vanilla)
|
||||
(go DMdA-assignments)
|
||||
(go DMdA-advanced))
|
||||
(go DMdA-advanced)
|
||||
(go test-disabling-tests))
|
||||
|
||||
(fire-up-drscheme-and-run-tests run-test)
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
racket/gui/base
|
||||
drracket/tool
|
||||
string-constants
|
||||
framework/preferences
|
||||
(only-in test-engine/scheme-gui make-formatter)
|
||||
(only-in test-engine/scheme-tests
|
||||
scheme-test-data test-format test-execute)
|
||||
|
@ -151,7 +152,8 @@
|
|||
(let* ([drracket-namespace (current-namespace)]
|
||||
[test-engine-path
|
||||
((current-module-name-resolver)
|
||||
'test-engine/scheme-tests #f #f)])
|
||||
'test-engine/scheme-tests #f #f)]
|
||||
[tests-on? (preferences:get 'test-engine:enable?)])
|
||||
(run-in-user-thread
|
||||
(lambda ()
|
||||
(namespace-attach-module drracket-namespace test-engine-path)
|
||||
|
@ -160,7 +162,7 @@
|
|||
(list (drracket:rep:current-rep)
|
||||
drracket-eventspace
|
||||
test-display%))
|
||||
(test-execute (get-preference 'tests:enable? (lambda () #t)))
|
||||
(test-execute tests-on?)
|
||||
(test-format
|
||||
(make-formatter
|
||||
(lambda (v o) (render-value/format v settings o 40))))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user