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