]> git.eshelyaron.com Git - emacs.git/commitdiff
Make unit tests use randomized file names
authorDavid Engster <dengste@eml.cc>
Mon, 4 Nov 2013 22:15:03 +0000 (23:15 +0100)
committerEdward John Steere <edward.steere@gmail.com>
Wed, 25 Jan 2017 17:28:21 +0000 (19:28 +0200)
* 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.

test/manual/cedet/cedet/srecode/fields-utest.el

index f883ae578b8e650b35b7331b659a2c88abab3369..f46982fe15db3a2917fe8c45e89fd380deadca10 100644 (file)
 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))
     ))