Delete trailing spaces
[sbcl.git] / tests / init.test.sh
blob0e86b2d90944d2dfc13c9bbc5663763757729220
1 #!/bin/sh
3 # tests related to loading init files
5 # This software is part of the SBCL system. See the README file for
6 # more information.
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.
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.
16 . ./subr.sh
18 use_test_subdirectory
20 tmpcore="init-test.core"
22 run_sbcl <<EOF
23 (require :sb-introspect)
24 (defun custom-userinit-pathname ()
25 "$SBCL_PWD/custom-userinit.lisp")
26 (defun custom-sysinit-pathname ()
27 "$SBCL_PWD/custom-sysinit.lisp")
28 (setf sb-impl::*userinit-pathname-function* 'custom-userinit-pathname
29 sb-impl::*sysinit-pathname-function* 'custom-sysinit-pathname)
30 (save-lisp-and-die "$tmpcore")
31 EOF
32 if [ $? != 0 ]; then
33 echo "failure saving core"
34 exit 1
36 run_sbcl_with_core "$tmpcore" --disable-debugger \
37 --eval "(setf sb-ext:*evaluator-mode* :${TEST_SBCL_EVALUATOR_MODE:-compile})" \
38 <<EOF
39 (assert (string= (custom-sysinit-pathname)
40 (namestring
41 (sb-introspect:definition-source-pathname
42 (car (sb-introspect:find-definition-sources-by-name
43 'sysinit-21 :function))))))
44 (userinit-quit (sysinit-21))
45 EOF
46 check_status_maybe_lose "userinit and sysinit loading" $? 21 "(loading worked)"
48 exit $EXIT_TEST_WIN