get-defined-fun: handle :declared-verify.
[sbcl.git] / tests / stream.test.sh
bloba2465beda3a12d14c7555ad0af17441fd9661664
1 #!/bin/sh
3 # This software is part of the SBCL system. See the README file for
4 # more information.
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
8 # from CMU CL.
10 # This software is in the public domain and is provided with
11 # absolutely no warranty. See the COPYING and CREDITS files for
12 # more information.
14 . ./subr.sh
16 use_test_subdirectory
18 tmpfilename="$TEST_FILESTEM.lisp"
19 tmpcore="stream-test.core"
21 cat > $tmpfilename <<EOF
22 (in-package :cl-user)
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))
29 EOF
30 run_sbcl --disable-debugger --load $tmpfilename <<EOF
31 Bivalent *STANDARD-INPUT*
32 EOF
33 check_status_maybe_lose bivalent-standard-input $?
35 cat > $tmpfilename <<EOF
36 (in-package :cl-user)
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)
41 EOF
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'"
48 exit $EXIT_LOSE
51 cat > $tmpfilename <<EOF
52 (in-package :cl-user)
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)
57 EOF
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'"
64 exit $EXIT_LOSE
67 run_sbcl <<EOF
68 (setf sb-ext:*default-external-format* '(:utf-8 :newline :crlf))
69 (sb-ext:save-lisp-and-die "$tmpcore")
70 EOF
71 if [ $? -ne 0 ]; then
72 echo "failure saving core"
73 exit 1
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)"
80 # success
81 exit $EXIT_TEST_WIN