tests: Don't breed lots of run-tests-nnn directories.

In load.impure.lisp(bug-332), just use a static file.
As to creating .fasl in the same directory, lots of tests do that, so
running them concurrently from the same source tree is already a bad
idea.
This commit is contained in:
Stas Boukarev 2014-08-03 19:49:32 +04:00
parent 8841138417
commit 2a84bc5fed
2 changed files with 8 additions and 15 deletions

2
tests/bug-332.lisp Normal file
View file

@ -0,0 +1,2 @@
(defstruct bug-332 foo)
(defstruct bug-332 foo bar)

View file

@ -275,21 +275,12 @@
(with-test (:name :bug-332)
(flet ((stimulate-sbcl ()
(let ((filename
(format nil "~A/~A.lisp"
(or (posix-getenv "TEST_DIRECTORY")
(posix-getenv "TMPDIR")
"/tmp")
(gensym))))
(ensure-directories-exist filename)
;; create a file which redefines a structure incompatibly
(with-open-file (f filename :direction :output :if-exists :supersede)
(print '(defstruct bug-332 foo) f)
(print '(defstruct bug-332 foo bar) f))
;; compile and load the file, then invoke the continue restart on
;; the structure redefinition error
(handler-bind ((error (lambda (c) (continue c))))
(load (compile-file filename))))))
;; compile and load the file, then invoke the continue restart on
;; the structure redefinition error
(handler-bind ((error (lambda (c) (continue c))))
(let ((fasl (compile-file "bug-332.lisp")))
(load fasl)
(ignore-errors (delete-file fasl))))))
(stimulate-sbcl)
(stimulate-sbcl)
(stimulate-sbcl)))