mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Skip ports tests that require popen if popen not available
* test-suite/tests/ports.test (define-module): don't use (ice-9 popen) (if-supported): new syntax (pipe:write, pipe:write): disable if no popen provided (line-counter): disable if no popen provided
This commit is contained in:
parent
ddbb110e87
commit
147912530c
1 changed files with 89 additions and 82 deletions
|
@ -21,7 +21,6 @@
|
|||
(define-module (test-suite test-ports)
|
||||
#:use-module (test-suite lib)
|
||||
#:use-module (test-suite guile-test)
|
||||
#:use-module (ice-9 popen)
|
||||
#:use-module (ice-9 rdelim)
|
||||
#:use-module (ice-9 threads)
|
||||
#:use-module (rnrs bytevectors)
|
||||
|
@ -618,6 +617,13 @@
|
|||
|
||||
;;;; Pipe (popen) ports.
|
||||
|
||||
(define-syntax-rule (if-supported body ...)
|
||||
(when (provided? 'popen)
|
||||
(begin body ...)))
|
||||
|
||||
(if-supported
|
||||
(use-modules (ice-9 popen))
|
||||
|
||||
;;; Run a command, and read its output.
|
||||
(let* ((pipe (open-pipe "echo 'Howdy there, partner!'" "r"))
|
||||
(in-string (read-all pipe)))
|
||||
|
@ -634,7 +640,7 @@
|
|||
(let ((in-string (read-file filename)))
|
||||
(pass-if "pipe: write"
|
||||
(equal? in-string "Mommy, why does everybody have a bomb?\n")))
|
||||
(delete-file filename))
|
||||
(delete-file filename)))
|
||||
|
||||
(pass-if-equal "pipe, fdopen, and line buffering"
|
||||
"foo\nbar\n"
|
||||
|
@ -1020,6 +1026,7 @@
|
|||
|
||||
;;;; Generic operations across all port types.
|
||||
|
||||
(if-supported
|
||||
(let ((port-loop-temp (test-file)))
|
||||
|
||||
;; Return a list of input ports that all return the same text.
|
||||
|
@ -1093,7 +1100,7 @@
|
|||
" --- Thomas Jefferson\n"
|
||||
"no newline here")
|
||||
"He who receives an idea from me, receives instruction"
|
||||
15)))
|
||||
15))))
|
||||
|
||||
;; Test port-line and port-column for output ports
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue