From e8cb4015a73b097f975184fa8fe53d5ed02e866c Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 22 Aug 2019 09:08:20 -0600 Subject: [PATCH] adjust tests to accomodate no-pthread build modes The new fifo handling requires pthreads, so skip some tests where the implementation falls back to a less complete implementation. --- pkgs/racket-test-core/tests/racket/file.rktl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/pkgs/racket-test-core/tests/racket/file.rktl b/pkgs/racket-test-core/tests/racket/file.rktl index b595c93728..d6300eeebe 100644 --- a/pkgs/racket-test-core/tests/racket/file.rktl +++ b/pkgs/racket-test-core/tests/racket/file.rktl @@ -1726,6 +1726,13 @@ (current-directory original-dir) (unless (eq? 'windows (system-type)) + (define can-open-nonblocking-fifo? + ;; The general implementation of fifo-write ports requires + ;; OS-managed threads internally. Use support forr futures and/or + ;; places as an indication that OS threads are available. + (or (place-enabled?) + (futures-enabled?))) + (define fifo (build-path work-dir "ff")) (system* (find-executable-path "mkfifo") fifo) @@ -1756,12 +1763,13 @@ (sync t1) (sync t2)) - (check-output-blocking (lambda (o2) (write-bytes #"abc" o2))) - (check-output-blocking (lambda (o2) - (parameterize ([current-output-port o2]) - (system* (find-executable-path "echo") - "-n" - "abc")))) + (when can-open-nonblocking-fifo? + (check-output-blocking (lambda (o2) (write-bytes #"abc" o2))) + (check-output-blocking (lambda (o2) + (parameterize ([current-output-port o2]) + (system* (find-executable-path "echo") + "-n" + "abc"))))) (delete-file fifo))