1.0.45.35: revert 1.0.45.30 due to regression (lp#677779)
[sbcl.git] / tests / script.test.sh
1 #!/bin/sh
2
3 # tests related to --script
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 . ./subr.sh
17
18 use_test_subdirectory
19
20 tmpscript=$TEST_FILESTEM.lisp-script
21
22 echo '(quit :unix-status 7)' > $tmpscript
23 run_sbcl --script $tmpscript
24 check_status_maybe_lose "--script exit status from QUIT" $? 7 "(quit status good)"
25
26 echo '(error "oops")' > $tmpscript
27 run_sbcl --script $tmpscript
28 check_status_maybe_lose "--script exit status from ERROR" $? 1 "(error implies 1)"
29
30 echo 'nil'> $tmpscript
31 run_sbcl --script $tmpscript
32 check_status_maybe_lose "--script exit status from normal exit" $? 0 "(everything ok)"
33
34 rm -f $tmpscript
35
36 exit $EXIT_TEST_WIN