Wait for compile-time logs to be processed before running optimizer tests.

This should solve the log ordering problems that caused non-deterministic
test failures during the nightly builds.
This commit is contained in:
Vincent St-Amour 2012-02-14 16:09:00 -05:00
parent 84e2880715
commit 37ba3672d4

View File

@ -1,5 +1,5 @@
#lang racket
(require racket/runtime-path
(require racket/runtime-path compiler/compiler
rackunit rackunit/text-ui
typed-racket/optimizer/logging)
@ -7,19 +7,21 @@
test-opt test-missed-optimization test-file?
generate-log tests-dir missed-optimizations-dir)
(define comp (compile-zos #f #:module? #t))
(define (generate-log name dir)
;; some tests require other tests, so some fiddling is required
(define f (build-path dir name))
(with-output-to-string
(lambda ()
(with-tr-logging-to-port
(current-output-port)
(lambda ()
(parameterize
([current-namespace (make-base-empty-namespace)]
[current-load-relative-directory dir])
(dynamic-require
(build-path (current-load-relative-directory) name)
#f)))))))
(comp (list f) 'auto)))
(parameterize
([current-namespace (make-base-empty-namespace)]
[current-load-relative-directory dir])
(dynamic-require f #f)))))
;; we log optimizations and compare to an expected log to make sure that all
;; the optimizations we expected did indeed happen