X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Frun-tests.lisp;h=8cb583f67656bda3ccd317d03711769030b60b07;hb=0a15b6bbf9d5d3a64b5ac08bb96b6e5ec221d2ae;hp=80eaf385a4ff8b3bec53fa9a9a381e7bd790db76;hpb=b8a2248d3193902592fb58c5ea74209dc1124f08;p=sbcl.git diff --git a/tests/run-tests.lisp b/tests/run-tests.lisp index 80eaf38..8cb583f 100644 --- a/tests/run-tests.lisp +++ b/tests/run-tests.lisp @@ -78,32 +78,24 @@ (append-failures))) (defun run-in-child-sbcl (load-forms forms) - (declare (ignorable load-forms)) - #-win32 - (let ((pid (sb-posix:fork))) - (cond ((= pid 0) - (dolist (form forms) - (eval form))) - (t - (let ((status (make-array 1 :element-type '(signed-byte 32)))) - (sb-posix:waitpid pid 0 status) - (if (sb-posix:wifexited (aref status 0)) - (sb-posix:wexitstatus (aref status 0)) - 1))))) - #+win32 + ;; We used to fork() for POSIX platforms, and use this for Windows. + ;; However, it seems better to use the same solution everywhere. (process-exit-code - (sb-ext:run-program - (first *POSIX-ARGV*) - (append - (list "--core" SB-INT:*CORE-STRING* - "--noinform" - "--no-sysinit" - "--no-userinit") - (loop for form in (append load-forms forms) - collect "--eval" - collect (write-to-string form))) - :output sb-sys:*stdout* - :input sb-sys:*stdin*))) + (#-win32 with-open-file #-win32 (devnull "/dev/null") #+win32 progn + (sb-ext:run-program + (first *POSIX-ARGV*) + (append + (list "--core" SB-INT:*CORE-STRING* + "--noinform" + "--no-sysinit" + "--no-userinit" + "--noprint" + "--disable-debugger") + (loop for form in (append load-forms forms) + collect "--eval" + collect (write-to-string form))) + :output sb-sys:*stdout* + :input #-win32 devnull #+win32 sb-sys:*stdin*)))) (defun run-impure-in-child-sbcl (test-file test-code) (run-in-child-sbcl @@ -124,13 +116,14 @@ (restart-case (handler-bind ((error (lambda (condition) - (push (list :unhandled-error cl-user::file) test-util::*failures*) + (push (list :unhandled-error file) + test-util::*failures*) (cond (*break-on-error* (test-util:really-invoke-debugger condition)) (t (format *error-output* "~&Unhandled ~a: ~a~%" (type-of condition) condition) - (funcall (symbol-function (intern "BACKTRACE" :sb-debug))))) + (sb-debug:backtrace))) (invoke-restart 'skip-file)))) ,test-code) (skip-file () @@ -194,7 +187,8 @@ (defun sh-test (file) ;; What? No SB-POSIX:EXECV? `(let ((process (sb-ext:run-program "/bin/sh" - (list (namestring ,file)) + (list (native-namestring ,file)) + :environment (test-util::test-env) :output *error-output*))) (sb-ext:quit :unix-status (process-exit-code process))))