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.
This commit is contained in:
Matthew Flatt 2019-08-22 09:08:20 -06:00
parent 2d0f10f473
commit e8cb4015a7

View File

@ -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))