sbcl.sbcl/tests/undefined-classoid-bug.test.sh
Nikodemus Siivola f0da2f63aa redesign exiting SBCL
Deprecate QUIT. It occupies an uncomfortable niche between processes
 and threads, and doesn't actually do what it says on the tin unless
 you call it from the main thread.

 SIGTERM now uses EXIT, and doesn't depend on sessions.

 WITH-DEADLINE (:SECONDS NIL :OVERRIDE T) can now be used to ignore
 deadlines.

 JOIN-THREAD on the main thread now blocks indefinitely instead of
 claiming the thread did not exit normally.

 New functions:

  * SB-EXT:EXIT. Always exits the process. Takes keywords :CODE,
    :ABORT, and :TIMEOUT. Code is the exit status. Abort controls if
    the exit is clean (unwind, exit-hooks, terminate other threads) or
    dirty. Timeout controls how long to wait for other threads to
    finish.

  * SB-THREAD:RETURN-FROM-THREAD. Normal termination for current
    thread -- equivalent to return from the thread function with the
    specified values. Takes keyword :ALLOW-EXIT, which determines if
    returning from the main thread is an error, or equivalent to
    calling EXIT :CODE 0.

  * SB-THREAD:ABORT-THREAD. Abnormal termination for current thread --
    equivalent to invoking the initial ABORT restart estabilished by
    MAKE-THREAD (previously known as TERMINATE-THREAD, but ANSI
    recommends there to always be an ABORT restart.) Takes keyword
    :ALLOW-EXIT, which determines if aborting the main thread is an
    error, or equivalent to calling EXIT :CODE 1.

  * SB-THREAD:MAIN-THREAD-P. Let's you determine if a given thread is
    the main thread of the process. This is important for some
    functions on some operating systems -- and RETURN-FROM-THREAD and
    ABORT-THREAD also need it.

  * SB-THREAD:MAIN-THREAD. Returns the main thread object. Convenient
    for when you need to eg. load a foreign library in the main
    thread.
2012-04-29 21:18:53 +03:00

29 lines
618 B
Bash

# This file run a regression test for a bug in loading
# forward-referenced layouts.
. ./subr.sh
use_test_subdirectory
FILES='"undefined-classoid-bug-1.lisp" "undefined-classoid-bug-2.lisp"'
FASLS='"undefined-classoid-bug-1.fasl" "undefined-classoid-bug-2.fasl"'
for f in $FILES; do
(cd "$SBCL_PWD"; cp `eval "echo $f"` "$TEST_DIRECTORY");
done
run_sbcl <<EOF
(let ((files (list $FILES)))
(mapc #'load files)
(mapc #'compile-file files))
(exit :code 52)
EOF
run_sbcl <<EOF
(mapc #'load (list $FASLS))
(exit :code $EXIT_LISP_WIN)
EOF
check_status_maybe_lose undefined-classoid-bug $?
exit $EXIT_TEST_WIN