1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-07 15:21:46 +00:00

Tweak previous bytecomp-tests.el change

* test/automated/bytecomp-tests.el (test-byte-comp-compile-and-load):
Fix handling of temporary elc files.
This commit is contained in:
Glenn Morris 2014-05-21 19:33:07 -07:00
parent f23423f322
commit ff965efb03
2 changed files with 4 additions and 3 deletions

View File

@ -1,7 +1,7 @@
2014-05-22 Glenn Morris <rgm@gnu.org>
* automated/bytecomp-tests.el (test-byte-comp-compile-and-load):
Avoid leaving empty .elc tempfiles behind.
Fix handling of temporary elc files.
* automated/fns-tests.el (fns-tests-nreverse):
Update for changed string behavior.

View File

@ -312,13 +312,14 @@ Subtests signal errors if something goes wrong."
(progn
(setf elfile (make-temp-file "test-bytecomp" nil ".el"))
(when compile
(setf elcfile (concat elfile "c")))
(setf elcfile (make-temp-file "test-bytecomp" nil ".elc")))
(with-temp-buffer
(dolist (form forms)
(print form (current-buffer)))
(write-region (point-min) (point-max) elfile))
(if compile
(let ((byte-compile-dest-file elcfile))
(let ((byte-compile-dest-file-function
(lambda (e) elcfile)))
(byte-compile-file elfile t))
(load elfile)))
(when elfile (delete-file elfile))