1.0.13.1: Various cleanups and touchups in tests/
[sbcl.git] / tests / init.test.sh
1 #!/bin/sh
2
3 # tests related to loading init files
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 tmpcore="init-test.core"
21
22 run_sbcl <<EOF
23   (defun custom-userinit-pathname ()
24      "$SBCL_PWD/custom-userinit.lisp")
25   (defun custom-sysinit-pathname ()
26      "$SBCL_PWD/custom-sysinit.lisp")
27   (setf sb-impl::*userinit-pathname-function* 'custom-userinit-pathname
28         sb-impl::*sysinit-pathname-function* 'custom-sysinit-pathname)
29   (save-lisp-and-die "$tmpcore")
30 EOF
31 if [ $? != 0 ]; then
32     echo "failure saving core"
33     exit 1
34 fi
35 run_sbcl_with_core "$tmpcore" --disable-debugger <<EOF
36   (userinit-quit (sysinit-21))
37 EOF
38 check_status_maybe_lose "userinit and sysinit loading" $? 21 "(loading worked)"
39
40 exit $EXIT_TEST_WIN