]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix file-tests.el on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Sun, 3 Nov 2019 16:13:38 +0000 (18:13 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 3 Nov 2019 16:13:38 +0000 (18:13 +0200)
* test/lisp/files-tests.el
(files-tests-file-name-non-special-start-file-process): On
MS-Windows, wait till the process dies before returning from
the files-tests--with-temp-non-special macro, to ensure the
temporary directory is successfully deleted.

test/lisp/files-tests.el

index 60387e1ab2e75d045f18659825bf83d51950d61e..d73c6a784216a63ee2ffa188875537bd4a2e3cea 100644 (file)
@@ -1052,7 +1052,13 @@ unquoted file names."
           (should (search-forward emacs-version nil t))
           ;; Don't stop the test run with a query, as the subprocess
           ;; may or may not be dead by the time we reach here.
-          (set-process-query-on-exit-flag proc nil)))))
+          (set-process-query-on-exit-flag proc nil)
+          ;; On MS-Windows, wait for the process to die, since the OS
+          ;; will not let us delete a directory that is the cwd of a
+          ;; running process.
+          (when (eq system-type 'windows-nt)
+            (while (process-live-p proc)
+              (sleep-for 0.1)))))))
   (files-tests--with-temp-non-special-and-file-name-handler
       (tmpdir nospecial-dir t)
     (with-temp-buffer