1.0.6.33: small CLOS cache improvements
[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 tmpcore="init-test-sh-$$.core"
17 rm -f $tmpcore
18
19 $SBCL <<EOF
20   (defun custom-userinit-pathname ()
21      "$SBCL_PWD/custom-userinit.lisp")
22   (defun custom-sysinit-pathname ()
23      "$SBCL_PWD/custom-sysinit.lisp")
24   (setf sb-impl::*userinit-pathname-function* 'custom-userinit-pathname
25         sb-impl::*sysinit-pathname-function* 'custom-sysinit-pathname)
26   (save-lisp-and-die "$tmpcore")
27 EOF
28 if [ $? != 0 ]; then
29     echo "failure saving core"
30     exit 1
31 fi
32 $SBCL_ALLOWING_CORE --core "$tmpcore" --disable-debugger <<EOF
33   (userinit-quit (sysinit-21))
34 EOF
35 if [ $? = 21 ]; then
36     echo "/Default userinit and sysinit loading worked, good"
37 else
38     echo "failure loading user/sysinit files: $?"
39     exit 1
40 fi
41
42 rm -f $tmpcore
43 echo "/returning success from init.test.sh"
44 exit 104