From 8483bd870ca83ab62f7733e141ca3b4101ea2dbe Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Wed, 3 Oct 2012 23:59:33 +0200 Subject: Add bookkeeping code for processes so we can get rid of all zombie processes --- tests/run.scm | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/run.scm b/tests/run.scm index c37a241..ab023eb 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -8,10 +8,11 @@ (test-group "Procedural interface" (test "Fork/pipe \"hello world\" example from SCSH reference manual" "Hello, world." - (begin (fork/pipe - (lambda () - (with-output-to-port (open-output-file* 1) - (lambda () (display "Hello, world.\n"))))) + (begin (process-wait + (fork/pipe + (lambda () + (with-output-to-port (open-output-file* 1) + (lambda () (display "Hello, world.\n")))))) (read-line (open-input-file* 0)))) (test "run/string* returns a string output in a subprocess" "This is a test" @@ -119,9 +120,12 @@ #f (|| (false) (epf (sh -c "echo hi && false") (- 1)))))) -;; TODO: Find a way to test that the input port didn't get replaced by -;; one from a subshell. This happened before, but not sure how -;; to detect this except running it manually from the REPL. +(test-group "finalization" + ;; TODO: Find a way to test that the input port didn't get replaced by + ;; one from a subshell. This happened before, but not sure how + ;; to detect this except running it manually from the REPL. + (test-error "No more zombies lying around after we're done" + (process-wait))) (test-end) -- cgit v1.2.3