From 6232932f4bb0630ef4656ed2f8e977fd7fb59952 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 24 May 2022 17:24:20 +0200 Subject: [PATCH] Fix issue with nativecomp tests leaving files behind in /tmp * test/src/comp-tests.el (comp-deftest): Ensure that no files are left behind (bug#55611). --- test/src/comp-tests.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 212d9e999f2..e7b534d00ec 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -51,7 +51,14 @@ (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)))) -- 2.39.2