diff options
author | Peter Bex <peter@more-magic.net> | 2012-10-03 23:59:33 +0200 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2012-10-03 23:59:33 +0200 |
commit | 8483bd870ca83ab62f7733e141ca3b4101ea2dbe (patch) | |
tree | eaae8a02e3008a22290e0ca856b135878c911c3b /tests | |
parent | 0c5c27fd2d2a4f595ea57e32f6d0cf04376cf919 (diff) | |
download | scsh-process-8483bd870ca83ab62f7733e141ca3b4101ea2dbe.tar.gz |
Add bookkeeping code for processes so we can get rid of all zombie processes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run.scm | 18 |
1 files changed, 11 insertions, 7 deletions
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) |