From: David Engster Date: Mon, 4 Nov 2013 22:15:03 +0000 (+0100) Subject: Make unit tests use randomized file names X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=784b5c87f25ef5c0460ddcd7f355a3ed35e63a0b;p=emacs.git Make unit tests use randomized file names * tests/cedet/semantic/stltest.el: * tests/cedet/semantic/utest-parse.el: * tests/cedet/srecode/fields-utest.el: * tests/cedet/srecode/test-getset.el: * tests/cedet/srecode/test.el: * tests/eieio/eieio-test-persist.el: Make all those tests use `make-temp-name' for their test files, so that tests can run in parallel. --- diff --git a/test/manual/cedet/cedet/srecode/test.el b/test/manual/cedet/cedet/srecode/test.el index 3b52d6e8d69..0461acef8e0 100644 --- a/test/manual/cedet/cedet/srecode/test.el +++ b/test/manual/cedet/cedet/srecode/test.el @@ -291,7 +291,8 @@ INSIDE SECTION: ARG HANDLER ONE") ;;; Master Harness ;; -(defvar srecode-utest-testfile "/tmp/srecode-utest.srt" +(defvar srecode-utest-testfile + (expand-file-name (concat (make-temp-name "srecode-utest-") ".srt") temporary-file-directory) "File used to do testing.") ;;;###autoload @@ -323,7 +324,9 @@ INSIDE SECTION: ARG HANDLER ONE") "SRECODE Templates" nil ; How to detect a problem? ) - ))) + )) + (when (file-exists-p srecode-utest-testfile) + (delete-file srecode-utest-testfile))) ;;; Project test ;; @@ -370,7 +373,9 @@ INSIDE SECTION: ARG HANDLER ONE") (error "Project template found when not in project"))) ;; - ))) + )) + (when (file-exists-p srecode-utest-testfile) + (delete-file srecode-utest-testfile))) (provide 'cedet/srecode/test)