From b96f441139e09d48880e1f20ad4237400529ac5f Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 19 Oct 2022 16:15:02 +0200 Subject: [PATCH] ; Delete file after wallpaper test * test/lisp/image/wallpaper-tests.el (wallpaper-set/calls-init-action): Don't leave temp file behind. --- test/lisp/image/wallpaper-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/lisp/image/wallpaper-tests.el b/test/lisp/image/wallpaper-tests.el index cb6818f8c1b..ab980a11bb6 100644 --- a/test/lisp/image/wallpaper-tests.el +++ b/test/lisp/image/wallpaper-tests.el @@ -99,9 +99,16 @@ ("touch" "touch" fil :init-action (lambda () (setq called t))))) (wallpaper-command (wallpaper--find-command)) - (wallpaper-command-args (wallpaper--find-command-args))) + (wallpaper-command-args (wallpaper--find-command-args)) + (start (time-convert nil 'integer)) + (timeout 3) process) (should (functionp (wallpaper-setter-init-action wallpaper--current-setter))) - (wallpaper-set fil-jpg) + (setq process (wallpaper-set fil-jpg)) + ;; Wait for "touch" process to exit so temp file is removed. + (while (and (< (- (time-convert nil 'integer) start) + timeout) + (process-live-p process)) + (sit-for 0.01)) (should called))))) (ert-deftest wallpaper-set/calls-wallpaper-set-function () -- 2.39.2