1.0.48.7: add FD-STREAM-FD-TYPE, use it to decide when to poll the fd
[sbcl.git] / tests / core.test.sh
index 4f80be8..978f230 100644 (file)
@@ -20,6 +20,12 @@ use_test_subdirectory
 tmpcore=$TEST_FILESTEM.core
 tmpoutput=$TEST_FILESTEM.txt
 
+run_sbcl <<EOF
+  (save-lisp-and-die "$tmpcore" :toplevel (lambda () 42))
+EOF
+run_sbcl_with_core "$tmpcore" --no-userinit --no-sysinit
+check_status_maybe_lose "SAVE-LISP-AND-DIE :TOPLEVEL" $? 0 "(saved core ran)"
+
 # In sbcl-0.7.7 SAVE-LISP-AND-DIE didn't work at all because of
 # flakiness caused by consing/GC/purify twice-and-at-least-twice
 # mismatch grot.
@@ -79,4 +85,23 @@ else
   exit 1
 fi
 
+# saving runtime options _from_ executable cores
+run_sbcl <<EOF
+  (save-lisp-and-die "$tmpcore" :executable t)
+EOF
+chmod u+x "$tmpcore"
+./"$tmpcore" --no-userinit <<EOF 
+  (save-lisp-and-die "$tmpcore" :executable t :save-runtime-options t)
+EOF
+chmod u+x "$tmpcore"
+./"$tmpcore" --no-userinit --version --eval '(quit)' <<EOF
+  (when (equal *posix-argv* '("./$tmpcore" "--version" "--eval" "(quit)"))
+    (quit :unix-status 42))
+EOF
+status=$?
+if [ $status != 42 ]; then
+    echo "saving runtime options from executable failed"
+    exit 1
+fi
+
 exit $EXIT_TEST_WIN