0.6.8.25:
[sbcl.git] / tests / run-program.test.sh
1 #!/bin/sh
2
3 # tests related to SB-EXT:RUN-PROGRAM
4
5 # This software is part of the SBCL system. See the README file for
6 # more information.
7 #
8 # While most of SBCL is derived from the CMU CL system, the test
9 # files (like this one) were written from scratch after the fork
10 # from CMU CL.
11
12 # This software is in the public domain and is provided with
13 # absolutely no warranty. See the COPYING and CREDITS files for
14 # more information.
15
16 sbcl --noinform --noprint --sysinit /dev/null --userinit /dev/null <<EOF
17   (let ((string (with-output-to-string (stream)
18                   (sb-ext:run-program "/bin/echo"
19                                       '("foo" "bar")
20                                       :output stream))))
21     (when (string= string "foo bar
22 ")
23       (sb-ext:quit :unix-status 52)))
24 EOF
25 if [ $? != 52 ]; then
26     echo test failed: $?
27     exit 1
28 fi
29
30 # known bugs:
31 #
32 #   sbcl-0.6.8:
33 #
34 #     (SB-EXT:RUN-PROGRAM "echo" NIL)
35 #     => error in function SB-IMPL::%ENUMERATE-SEARCH-LIST:
36 #        Undefined search list: path
37 #
38 #     (SB-EXT:RUN-PROGRAM "/bin/uname" '("-a") :OUTPUT :STREAM)
39 #     doesn't return a STREAM (the way doc string claims)
40
41 # success convention
42 exit 104