]> 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 18:14:12 +0000 (20:14 +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/semantic/utest-parse.el

index 04cf977b220be195e7311a361c444f7b483c837f..aa52e5e0b9e5173f41bc5c41f62eaedbb49075f9 100644 (file)
@@ -30,9 +30,8 @@
 
 (require 'semantic)
 
-(defvar semantic-utest-temp-directory (if (fboundp 'temp-directory)
-                                         (temp-directory)
-                                       temporary-file-directory)
+(defvar semantic-utest-temp-directory
+  (expand-file-name (make-temp-name "CEDET-UTEST-") temporary-file-directory)
   "Temporary directory to use when creating files.")
 
 (defun semantic-utest-fname (name)
@@ -868,6 +867,7 @@ INSERTME is the text to be inserted after the deletion."
 (defun semantic-utest-main()
   (interactive)
   "call all utests"
+  (make-directory semantic-utest-temp-directory)
   (cedet-utest-log-start "multi-lang parsing")
   (cedet-utest-log " * C tests...")
   (semantic-utest-C)
@@ -887,7 +887,7 @@ INSERTME is the text to be inserted after the deletion."
   (semantic-utest-PHP)
   (cedet-utest-log " * Csharp tests...")
   (semantic-utest-Csharp)
-
+  (delete-directory semantic-utest-temp-directory)
   (cedet-utest-log-shutdown "multi-lang parsing")
   )