improve zo-{parse,marshal} test
After a RacketCS build, a random ".zo" file may not work for the current Racket variant, so only try ".zo" files that can work.
This commit is contained in:
parent
fc7c4bb42c
commit
9c104a8ea4
|
@ -61,7 +61,15 @@ exec racket -t "$0" -- -s -t 60 -v -R $*
|
||||||
(for ([sp (in-list (maybe-randomize-list (directory-list p)))])
|
(for ([sp (in-list (maybe-randomize-list (directory-list p)))])
|
||||||
(for-zos ! (build-path p sp)))]
|
(for-zos ! (build-path p sp)))]
|
||||||
[(regexp-match #rx"\\.zo$" p-str)
|
[(regexp-match #rx"\\.zo$" p-str)
|
||||||
(! p-str)]))
|
(when (valid-bytecode? p-str)
|
||||||
|
(! p-str))]))
|
||||||
|
|
||||||
|
(define (valid-bytecode? f)
|
||||||
|
;; Make sure the file makes sense for the current platform
|
||||||
|
(with-handlers ([exn:fail:read? (lambda (exn) #f)])
|
||||||
|
(parameterize ([read-accept-compiled #t])
|
||||||
|
(call-with-input-file* f read))
|
||||||
|
#t))
|
||||||
|
|
||||||
(define-runtime-path zo-test-worker-path "zo-test-worker.rkt")
|
(define-runtime-path zo-test-worker-path "zo-test-worker.rkt")
|
||||||
(define racket-path (path->string (find-exe)))
|
(define racket-path (path->string (find-exe)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user