Added support for the 2 versions of optimizer tests to be written in

different languages.

original commit: 1886572906c40c11eb777a3eb1e273ce3877037b
This commit is contained in:
Vincent St-Amour 2010-07-02 11:51:51 -04:00
parent 228f9a971b
commit f121650526
2 changed files with 15 additions and 7 deletions

View File

@ -0,0 +1,4 @@
;; to see if the harness supports having the 2 versions of a test being
;; written in different languages
(module different-langs typed/scheme #:optimize
(+ 1 2))

View File

@ -5,13 +5,17 @@
;; we compare the expansion of automatically optimized and hand optimized
;; modules
(define (read-and-expand file)
(syntax->datum
(parameterize ([current-namespace (make-base-namespace)])
(with-handlers
([exn:fail? (lambda (exn)
(printf "~a\n" (exn-message exn))
#'#f)])
(expand (with-input-from-file file read-syntax))))))
;; drop the "module", its name and its language, so that we can write the
;; 2 versions of each test in different languages (typed and untyped) if
;; need be
(cdddr
(syntax->datum
(parameterize ([current-namespace (make-base-namespace)])
(with-handlers
([exn:fail? (lambda (exn)
(printf "~a\n" (exn-message exn))
#'(#f #f #f #f))]) ; for cdddr
(expand (with-input-from-file file read-syntax)))))))
(define (test gen)
(let-values (((base name _) (split-path gen)))