-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathio.lisp
More file actions
38 lines (29 loc) · 971 Bytes
/
io.lisp
File metadata and controls
38 lines (29 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(defpackage #:scriptl-test.io
(:use #:cl
#:FiveAM))
(in-package :scriptl-test.io)
(scriptl:start)
; there's a way for checking the server has started?
(sleep 1)
(defun eval-string (string)
(eval (read-from-string string)))
(defun run-test (string)
(uiop:call-with-temporary-file
(lambda (tmp)
(let ((tmpfile (namestring tmp)))
(scriptl:make-script tmpfile 'eval-string)
(inferior-shell:run/i `(,tmpfile ,string))))
:want-stream-p nil
:want-pathname-p t))
(defmacro test-finishes (name form)
`(test ,name (finishes (run-test (prin1-to-string ',form)))))
(def-suite output-io-suite
:description "The output I/O test suite.")
(in-suite output-io-suite)
(test-finishes format-t
(format t "ok~%"))
(test-finishes inferior-shell-echo
(inferior-shell:run '(/bin/echo ok)))
(test-finishes uiop-echo
(uiop:run-program '("/bin/echo" "ok") :output t))
(run! 'output-io-suite)