3 # This software is part of the SBCL system. See the README file for
6 # While most of SBCL is derived from the CMU CL system, the test
7 # files (like this one) were written from scratch after the fork
10 # This software is in the public domain and is provided with
11 # absolutely no warranty. See the COPYING and CREDITS files for
18 tmpfilename
="$TEST_FILESTEM.lisp"
19 tmpcore
="stream-test.core"
21 cat > $tmpfilename <<EOF
23 (if (equal (concatenate 'string "Bivalent *STANDARD-INPUT*" (string #\newline))
24 (with-output-to-string (s)
25 (loop for byte = (read-byte *standard-input* nil)
26 while byte do (write-char (code-char byte) s))))
27 (exit :code $EXIT_LISP_WIN)
28 (exit :code $EXIT_LOSE))
30 run_sbcl
--disable-debugger --load $tmpfilename <<EOF
31 Bivalent *STANDARD-INPUT*
33 check_status_maybe_lose bivalent-standard-input $?
35 cat > $tmpfilename <<EOF
37 (loop for char across "Bivalent *STANDARD-OUTPUT*"
38 do (write-byte (char-code char) *standard-output*))
39 (terpri *standard-output*)
40 (exit :code $EXIT_LISP_WIN)
42 run_sbcl
--disable-debugger --load $tmpfilename > $tmpfilename.out
43 check_status_maybe_lose bivalent-standard-output $?
44 test_output
=`cat $tmpfilename.out`
45 rm -f $tmpfilename.out
46 if [ 'Bivalent *STANDARD-OUTPUT*' != "$test_output" ]; then
47 echo "bad test output: '$test_output'"
51 cat > $tmpfilename <<EOF
53 (loop for char across "Bivalent *ERROR-OUTPUT*"
54 do (write-byte (char-code char) *error-output*))
55 (terpri *error-output*)
56 (exit :code $EXIT_LISP_WIN)
58 run_sbcl
--disable-debugger --load $tmpfilename 2> $tmpfilename.out
59 check_status_maybe_lose bivalent-error-output $?
60 test_output
=`cat $tmpfilename.out`
61 rm -f $tmpfilename.out
62 if [ 'Bivalent *ERROR-OUTPUT*' != "$test_output" ]; then
63 echo "bad test output: '$test_output'"
68 (setf sb-ext:*default-external-format* '(:utf-8 :newline :crlf))
69 (sb-ext:save-lisp-and-die "$tmpcore")
72 echo "failure saving core"
76 run_sbcl_with_core
"$tmpcore" --disable-ldb --noinform --no-sysinit --no-userinit --disable-debugger \
77 --eval '(sb-ext:quit :unix-status 52)'
78 check_status_maybe_lose
"stdstream external format setting" $?
52 "(loading worked)"