summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPeter Bex <peter@more-magic.net>2012-10-02 21:36:59 +0200
committerPeter Bex <peter@more-magic.net>2012-10-02 21:36:59 +0200
commit79cf0e254aa94d96027a767bf54230ab67262569 (patch)
tree321f0f29d5e632608452d01cd27d6122e209eda0 /tests
parent9aad14a928c3a2f8bff2ed9b0b6e13f528645f0b (diff)
downloadscsh-process-79cf0e254aa94d96027a767bf54230ab67262569.tar.gz
Add wrapper for tests so we get a good summary at the end; also add trailing garbage for run/sexp's test
Diffstat (limited to 'tests')
-rw-r--r--tests/run.scm11
1 files 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