File: init.test.sh

package info (click to toggle)
sbcl 2%3A2.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 52,008 kB
  • sloc: lisp: 535,135; ansic: 42,629; sh: 5,737; asm: 2,406; pascal: 717; makefile: 432; python: 56; cpp: 27
file content (48 lines) | stat: -rw-r--r-- 1,492 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh

# tests related to loading init files

# This software is part of the SBCL system. See the README file for
# more information.
#
# While most of SBCL is derived from the CMU CL system, the test
# files (like this one) were written from scratch after the fork
# from CMU CL.
#
# This software is in the public domain and is provided with
# absolutely no warranty. See the COPYING and CREDITS files for
# more information.

. ./subr.sh

use_test_subdirectory

tmpcore="init-test.core"

run_sbcl <<EOF
  (require :sb-introspect)
  (defun custom-userinit-pathname ()
     "$SBCL_PWD/custom-userinit.lisp")
  (defun custom-sysinit-pathname ()
     "$SBCL_PWD/custom-sysinit.lisp")
  (setf sb-impl::*userinit-pathname-function* 'custom-userinit-pathname
        sb-impl::*sysinit-pathname-function* 'custom-sysinit-pathname)
  (save-lisp-and-die "$tmpcore")
EOF
if [ $? -ne 0 ]; then
    echo "failure saving core"
    exit 1
fi
run_sbcl_with_core "$tmpcore" --noinform --disable-debugger \
    --eval "(setf sb-ext:*evaluator-mode* :${TEST_SBCL_EVALUATOR_MODE:-compile})" \
    <<EOF
  (assert (string= (custom-sysinit-pathname)
                   (namestring
                    (sb-introspect:definition-source-pathname
                     (car (sb-introspect:find-definition-sources-by-name
                           'sysinit-21 :function))))))
  (userinit-quit (sysinit-21))
EOF
check_status_maybe_lose "userinit and sysinit loading" $? 21 "(loading worked)"

exit $EXIT_TEST_WIN