emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/merge-cedet-tests cebc72c 228/316: Make unit tests


From: Edward John Steere
Subject: [Emacs-diffs] scratch/merge-cedet-tests cebc72c 228/316: Make unit tests use randomized file names
Date: Sat, 28 Jan 2017 09:10:04 +0000 (UTC)

branch: scratch/merge-cedet-tests
commit cebc72c6615799da5b2a6dfe6aa89d723477b989
Author: David Engster <address@hidden>
Commit: Edward John Steere <address@hidden>

    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.
---
 test/manual/cedet/cedet/srecode/fields-utest.el |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/test/manual/cedet/cedet/srecode/fields-utest.el 
b/test/manual/cedet/cedet/srecode/fields-utest.el
index f883ae5..f46982f 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))
     ))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]