Fixing error message re Robby and rearranging tests a little

svn: r18117
This commit is contained in:
Jay McCarthy 2010-02-17 16:04:13 +00:00
parent d2d84ae674
commit 9a468dd9d0
5 changed files with 26 additions and 2 deletions

View File

@ -208,12 +208,12 @@
(with-syntax ([(env-id ...) (syntax-parameter-value #'mutator-env-roots)])
(if (syntax-parameter-value #'mutator-tail-call?)
; If this call is in tail position, we will not need access to its environment when it returns.
(syntax/loc stx ((deref fe) ae ...))
(syntax/loc stx ((deref-proc fe) ae ...))
; If this call is not in tail position, we make the environment at the call site
; reachable.
#`(with-continuation-mark gc-roots-key
(list (make-env-root env-id) ...)
#,(syntax/loc stx ((deref fe) ae ...)))))]))
#,(syntax/loc stx ((deref-proc fe) ae ...)))))]))
(define-syntax mutator-quote
(syntax-rules ()
[(_ (a . d))
@ -455,6 +455,15 @@
[(location? proc/loc) (collector:deref proc/loc)]
[else (error 'deref "expected <location?> or <procedure?>; received ~a" proc/loc)]))
(define (deref-proc proc-or-loc)
(define v
(with-handlers ([exn? (lambda (x)
(error 'procedure-application "expected procedure, given something else"))])
(deref proc-or-loc)))
(if (procedure? v)
v
(error 'procedure-application "expected procedure, given ~e" v)))
(define (gc->scheme loc)
(define-struct an-unset ())
(define unset (make-an-unset))

View File

@ -0,0 +1,4 @@
#lang plai/mutator
(allocator-setup "../good-collectors/no-compact-cheat.ss" 100)
(define x (cons 1 2))
((set-first! x 2) 1)

View File

@ -14,7 +14,17 @@
(parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require m #f)))
(define run-good? (make-parameter #f))
(command-line #:program "run-test"
#:once-each ["-g" "Enable running good mutators" (run-good? #t)])
(test
(if (run-good?)
(for ([m (in-directory (build-path here "good-mutators") #rx"ss$")])
(test
(test-mutator m)))
(void))
(for ([m (in-directory (build-path here "bad-mutators") #rx"ss$")])
(test
(test-mutator m) =error> #rx"")))

View File

@ -25,6 +25,7 @@
(find-relative-path
(simple-form-path tmpfile)
(build-path (simple-form-path here)
"gc" "good-collectors"
"no-compact-cheat.ss")))
100))
(for-each (λ (exp) (pretty-print exp port)) exps))