]> 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/test.el

index 3b52d6e8d6933428b0d0f92da5dc9a7cdb6dc2aa..0461acef8e005f5a49f709d8ca879623313b931b 100644 (file)
@@ -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)