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=cebc72c6615799da5b2a6dfe6aa89d723477b989;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/fields-utest.el b/test/manual/cedet/cedet/srecode/fields-utest.el index f883ae578b8..f46982fe15d 100644 --- a/test/manual/cedet/cedet/srecode/fields-utest.el +++ b/test/manual/cedet/cedet/srecode/fields-utest.el @@ -35,6 +35,11 @@ It is filled with some text." "Text for tests.") +(defvar srecode-field-utest-filename + (expand-file-name + (concat (make-temp-name "srecode-field-test-") ".txt") + temporary-file-directory)) + ;;;###autoload (defun srecode-field-utest () "Test the srecode field manager." @@ -46,8 +51,7 @@ It is filled with some text." (defun srecode-field-utest-impl () "Implementation of the SRecode field utest." (save-excursion - (find-file "/tmp/srecode-field-test.txt") - + (find-file srecode-field-utest-filename) (erase-buffer) (goto-char (point-min)) (insert srecode-field-utest-text) @@ -241,6 +245,8 @@ It is filled with some text." (set-buffer-modified-p nil) (message " All field tests passed.") + (when (file-exists-p srecode-field-utest-filename) + (delete-file srecode-field-utest-filename)) ))