add SB-UNIX:UNIX-EXIT back, use the deprecation framwork for it and SB-EXT:QUIT
[sbcl.git] / tests / script.test.sh
index db270df..33483ba 100644 (file)
@@ -21,9 +21,9 @@ tmpscript=$TEST_FILESTEM.lisp-script
 tmpout=$TEST_FILESTEM.lisp-out
 tmperr=$TEST_FILESTEM.lisp-err
 
-echo '(quit :unix-status 7)' > $tmpscript
+echo '(exit :code 7)' > $tmpscript
 run_sbcl --script $tmpscript
-check_status_maybe_lose "--script exit status from QUIT" $? 7 "(quit status good)"
+check_status_maybe_lose "--script exit status from EXIT" $? 7 "(status good)"
 
 echo '(error "oops")' > $tmpscript
 run_sbcl --script $tmpscript 1> $tmpout 2> $tmperr
@@ -38,18 +38,32 @@ run_sbcl --script $tmpscript
 check_status_maybe_lose "--script exit status from normal exit" $? 0 "(everything ok)"
 
 cat > $tmpscript <<EOF
-#+(or darwin netbsd openbsd)
-(progn
-  (format t "silently skipping known failure in script.test.sh~%")
-  (sb-ext:quit :unix-status 3))
-(setf *standard-output* (open "/dev/stdout"))
+(setf *standard-output* (make-broadcast-stream))
 (close *standard-output*)
+(sb-ext:exit :code 3)
+EOF
+run_sbcl --script $tmpscript >/dev/null
+check_status_maybe_lose "--script exit status from QUIT when standard-output closed" $? 3 "(as given)"
+run_sbcl --load $tmpscript >/dev/null
+check_status_maybe_lose "--load exit status from QUIT when standard-output closed" $? 3 "(as given)"
+
+cat > $tmpscript <<EOF
+(close *standard-output*)
+(sb-ext:quit :unix-status 3)
+EOF
+run_sbcl --script $tmpscript >/dev/null
+check_status_maybe_lose "--script exit status from QUIT when original standard-output closed" $? 3 "(as given)"
+run_sbcl --load $tmpscript >/dev/null
+check_status_maybe_lose "--load exit status from QUIT when original standard-output closed" $? 3 "(as given)"
+
+cat > $tmpscript <<EOF
+(close sb-sys:*stdout*)
 (sb-ext:quit :unix-status 3)
 EOF
 run_sbcl --script $tmpscript >/dev/null
-check_status_maybe_lose "--script exit status from QUIT when stdout closed" $? 3 "(as given)"
+check_status_maybe_lose "--script exit status from EXIT when stdout closed" $? 3 "(as given)"
 run_sbcl --load $tmpscript >/dev/null
-check_status_maybe_lose "--load exit status from QUIT when stdout closed" $? 3 "(as given)"
+check_status_maybe_lose "--load exit status from EXIT when stdout closed" $? 3 "(as given)"
 
 cat > $tmpscript <<EOF
 (loop (write-line (read-line)))