Extra require.

Compile files first.

original commit: bbae1112294a6f92342af3d3ca77a139b3b1c729
This commit is contained in:
Sam Tobin-Hochstadt 2008-07-01 11:27:05 -04:00
parent 02f34aa0fd
commit f84545ceef
2 changed files with 15 additions and 13 deletions

View File

@ -4,8 +4,8 @@
(require (planet schematics/schemeunit/test)
(planet schematics/schemeunit/text-ui)
#;(planet schematics/schemeunit/graphical-ui)
mzlib/etc
compiler/compiler
scheme/match
"unit-tests/all-tests.ss"
"unit-tests/test-utils.ss")
@ -30,11 +30,10 @@
(define (exn-pred p)
(let ([sexp (with-handlers
([values (lambda _ #f)])
(let ([prt (open-input-file p)])
(begin0 (begin (read-line prt 'any)
(read prt))
(close-input-port prt))))])
([exn:fail? (lambda _ #f)])
(with-input-from-file p
(lambda ()
(read-line 'any) (read))))])
(match sexp
[(list-rest 'exn-pred e)
(eval `(exn-matches . ,e) (namespace-anchor->namespace a))]
@ -52,20 +51,23 @@
(build-path path p)
(lambda ()
(parameterize ([read-accept-reader #t]
[current-load-relative-directory
path])
[current-load-relative-directory path]
[current-directory path])
(with-output-to-file "/dev/null" #:exists 'append
(lambda () (loader p)))))))))
(apply test-suite dir
tests)))
(define (dr p)
((compile-zos #f) (list p) 'auto)
(parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require `(file ,(path->string p)) #f)))
(define succ-tests (mk-tests "succeed"
(lambda (p) (parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require `(file ,(path->string p)) #f)))
dr
(lambda (p thnk) (check-not-exn thnk))))
(define fail-tests (mk-tests "fail"
(lambda (p) (parameterize ([current-namespace (make-base-empty-namespace)])
(dynamic-require `(file ,(path->string p)) #f)))
dr
(lambda (p thnk)
(define-values (pred info) (exn-pred p))
(with-check-info

View File

@ -11,7 +11,7 @@
type-name-env init-envs mutated-vars
effect-rep type-annotation type-utils)
(for-syntax (private tc-utils typechecker base-env type-env))
(for-template (private base-env)))
(for-template (private base-env base-types)))
(require (schemeunit))