]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix issue with nativecomp tests leaving files behind in /tmp
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 24 May 2022 15:24:20 +0000 (17:24 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 24 May 2022 15:24:40 +0000 (17:24 +0200)
* test/src/comp-tests.el (comp-deftest): Ensure that no files are left
behind (bug#55611).

test/src/comp-tests.el

index 212d9e999f2c50576e8eb8b259bfd9725e3264d2..e7b534d00ec0ebe9a4f75df984c251f345a2d94a 100644 (file)
            (doc-string 3))
   `(ert-deftest ,(intern (concat "comp-tests-" (symbol-name name))) ,args
      :tags '(:nativecomp)
-     ,@docstring-and-body))
+     ,@(and (stringp (car docstring-and-body))
+            (list (pop docstring-and-body)))
+     ;; Some of the tests leave spill files behind -- so create a
+     ;; sub-dir where native-comp can do its work, and then delete it
+     ;; at the end.
+     (ert-with-temp-directory dir
+       (let ((temporary-file-directory dir))
+         ,@docstring-and-body))))
 
 \f