From 9e68e626a81fd7c1405f02d051db6937c6df82cd Mon Sep 17 00:00:00 2001 From: Douglas Katzman Date: Tue, 19 Mar 2019 15:47:35 -0400 Subject: [PATCH] Use more scratch files --- tests/compiler.impure.lisp | 4 +--- tests/kill-non-lisp-thread.impure.lisp | 12 +++++++----- tests/octets.pure.lisp | 1 + tests/stream.impure-cload.lisp | 2 +- tests/stream.pure.lisp | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/compiler.impure.lisp b/tests/compiler.impure.lisp index e77e8b220..5a3c13bc2 100644 --- a/tests/compiler.impure.lisp +++ b/tests/compiler.impure.lisp @@ -1782,20 +1782,18 @@ (coerce result 'string))))) ;;; Calling thru constant symbols -(require :sb-introspect) (declaim (inline target-fun)) (defun target-fun (arg0 arg1) (+ arg0 arg1)) (declaim (notinline target-fun)) -;; FIXME: should use compiler-test-util, not sb-introspect here. ;; That issue aside, neither sb-introspect nor ctu:find-named-callees ;; can examine an interpreted function for its callees, ;; so we can't actually use this function. (defun test-target-fun-called (fun res) (assert (member #'target-fun - (sb-introspect:find-function-callees #'caller-fun-1))) + (ctu:find-named-callees #'caller-fun-1))) (assert (equal (funcall fun) res))) (defun caller-fun-1 () diff --git a/tests/kill-non-lisp-thread.impure.lisp b/tests/kill-non-lisp-thread.impure.lisp index 405375e14..509b0179d 100644 --- a/tests/kill-non-lisp-thread.impure.lisp +++ b/tests/kill-non-lisp-thread.impure.lisp @@ -28,10 +28,12 @@ output)) output)) -(run "/bin/sh" "run-compiler.sh" "-sbcl-pic" "-sbcl-shared" - "-O3" "-I" "../src/runtime/" - "kill-non-lisp-thread.c" "-o" "kill-non-lisp-thread.so") - +(defvar *delete* nil) +(unless (probe-file "kill-non-lisp-thread.so") + (run "/bin/sh" "run-compiler.sh" "-sbcl-pic" "-sbcl-shared" + "-O3" "-I" "../src/runtime/" + "kill-non-lisp-thread.c" "-o" "kill-non-lisp-thread.so") + (setq *delete* t)) (load-shared-object (truename "kill-non-lisp-thread.so")) (define-alien-routine kill-non-lisp-thread void) @@ -52,4 +54,4 @@ (sleep 1) (assert receivedp))) -(delete-file "kill-non-lisp-thread.so") +(when *delete* (delete-file "kill-non-lisp-thread.so")) diff --git a/tests/octets.pure.lisp b/tests/octets.pure.lisp index cd71a4c78..ac8159891 100644 --- a/tests/octets.pure.lisp +++ b/tests/octets.pure.lisp @@ -410,6 +410,7 @@ (assert (string= (read-line f1) (read-line f2)))))) (flet ((compile-and-load (file encoding main-fun) (let ((fasl (compile-file file + :output-file (scratch-file-name "fasl") :external-format encoding :print nil :verbose nil))) (load fasl) diff --git a/tests/stream.impure-cload.lisp b/tests/stream.impure-cload.lisp index 35bf89611..d091bdce2 100644 --- a/tests/stream.impure-cload.lisp +++ b/tests/stream.impure-cload.lisp @@ -25,7 +25,7 @@ ;;; The code below tests only UNREAD-CHAR. It would be nice to test ;;; CLEAR-INPUT too, but I'm not sure how to do it cleanly and ;;; portably in a noninteractive test. -- WHN 2001-05-05 -(defparameter *scratch-file-name* "sbcl-wrapped-stream-test-data.tmp") +(defparameter *scratch-file-name* (scratch-file-name)) (defvar *scratch-file-stream*) (dolist (scratch-file-length '(1 ; everyone's favorite corner case 200123)) ; hopefully much bigger than buffer diff --git a/tests/stream.pure.lisp b/tests/stream.pure.lisp index 20adf9600..5ae18ae0e 100644 --- a/tests/stream.pure.lisp +++ b/tests/stream.pure.lisp @@ -360,7 +360,7 @@ ;;; buffer-fill routine is responsible for figuring out when we've ;;; reached EOF. (with-test (:name (stream :listen-vs-select) :fails-on :win32) - (let ((listen-testfile-name "stream.impure.lisp.testqfile") + (let ((listen-testfile-name (scratch-file-name)) ;; If non-NIL, size (in bytes) of the file that will exercise ;; the LISTEN problem. (bytes-per-buffer-sometime