From 79cf0e254aa94d96027a767bf54230ab67262569 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Tue, 2 Oct 2012 21:36:59 +0200 Subject: Add wrapper for tests so we get a good summary at the end; also add trailing garbage for run/sexp's test --- tests/run.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/run.scm b/tests/run.scm index b72ca75..c37a241 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -3,6 +3,8 @@ (use test posix) +(test-begin "scsh-process") + (test-group "Procedural interface" (test "Fork/pipe \"hello world\" example from SCSH reference manual" "Hello, world." @@ -13,7 +15,10 @@ (read-line (open-input-file* 0)))) (test "run/string* returns a string output in a subprocess" "This is a test" - (run/string* (lambda () (display "This is a test"))))) + (run/string* (lambda () (display "This is a test")))) + + (test-error "run*/string* raises error if subprocess has nonzero exit status" + (run*/string* (lambda () (display "ohai") (exit 1))))) (test-group "Macro (EPF) interface" (delete-file* "outfile") ; Leftovers from last run @@ -25,7 +30,7 @@ (test "Simple run/sexp" '("hi, there") - (run/sexp (echo "(\"hi, there\")"))) + (run/sexp (echo "(\"hi, there\") trailing stuff is ignored"))) (test "Simple run/sexps" '(("hi, there") (a b c)) @@ -118,4 +123,6 @@ ;; one from a subshell. This happened before, but not sure how ;; to detect this except running it manually from the REPL. +(test-end) + (test-exit) \ No newline at end of file -- cgit v1.2.3