1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

Fix wallpaper-tests on MS-Windows

* test/lisp/image/wallpaper-tests.el (wallpaper--find-setter)
(wallpaper--find-setter/call-predicate)
(wallpaper--find-setter/set-current-setter)
(wallpaper-set/calls-init-action)
(wallpaper-set/calls-wallpaper-set-function)
(wallpaper-set/runs-command, wallpaper-set/runs-command/detach):
Skip these tests if native functions are used for changing
wallpaper.  These tests are irrelevant in that case.
This commit is contained in:
Eli Zaretskii 2023-04-11 10:33:32 +03:00
parent f2d212c696
commit c62afb10cf

View File

@ -24,7 +24,8 @@
(require 'wallpaper) (require 'wallpaper)
(ert-deftest wallpaper--find-setter () (ert-deftest wallpaper--find-setter ()
(skip-unless (executable-find "touch")) (skip-unless (and (executable-find "touch")
(wallpaper--use-default-set-function-p)))
(let (wallpaper--current-setter (let (wallpaper--current-setter
(wallpaper--default-setters (wallpaper--default-setters
(wallpaper--default-methods-create (wallpaper--default-methods-create
@ -32,7 +33,8 @@
(should (wallpaper--find-setter)))) (should (wallpaper--find-setter))))
(ert-deftest wallpaper--find-setter/call-predicate () (ert-deftest wallpaper--find-setter/call-predicate ()
(skip-unless (executable-find "touch")) (skip-unless (and (executable-find "touch")
(wallpaper--use-default-set-function-p)))
(let* ( wallpaper--current-setter called (let* ( wallpaper--current-setter called
(wallpaper--default-setters (wallpaper--default-setters
(wallpaper--default-methods-create (wallpaper--default-methods-create
@ -43,7 +45,8 @@
(should called))) (should called)))
(ert-deftest wallpaper--find-setter/set-current-setter () (ert-deftest wallpaper--find-setter/set-current-setter ()
(skip-unless (executable-find "touch")) (skip-unless (and (executable-find "touch")
(wallpaper--use-default-set-function-p)))
(let (wallpaper--current-setter (let (wallpaper--current-setter
(wallpaper--default-setters (wallpaper--default-setters
(wallpaper--default-methods-create (wallpaper--default-methods-create
@ -52,7 +55,8 @@
(should wallpaper--current-setter))) (should wallpaper--current-setter)))
(ert-deftest wallpaper-set/runs-command () (ert-deftest wallpaper-set/runs-command ()
(skip-unless (executable-find "touch")) (skip-unless (and (executable-find "touch")
(wallpaper--use-default-set-function-p)))
(ert-with-temp-file fil-jpg (ert-with-temp-file fil-jpg
:suffix ".jpg" :suffix ".jpg"
(ert-with-temp-file fil (ert-with-temp-file fil
@ -70,7 +74,8 @@
(should (file-exists-p fil))))))) (should (file-exists-p fil)))))))
(ert-deftest wallpaper-set/runs-command/detach () (ert-deftest wallpaper-set/runs-command/detach ()
(skip-unless (executable-find "touch")) (skip-unless (and (executable-find "touch")
(wallpaper--use-default-set-function-p)))
(ert-with-temp-file fil-jpg (ert-with-temp-file fil-jpg
:suffix ".jpg" :suffix ".jpg"
(ert-with-temp-file fil (ert-with-temp-file fil
@ -89,7 +94,8 @@
(should (file-exists-p fil)))))) (should (file-exists-p fil))))))
(ert-deftest wallpaper-set/calls-init-action () (ert-deftest wallpaper-set/calls-init-action ()
(skip-unless (executable-find "touch")) (skip-unless (and (executable-find "touch")
(wallpaper--use-default-set-function-p)))
(ert-with-temp-file fil-jpg (ert-with-temp-file fil-jpg
:suffix ".jpg" :suffix ".jpg"
(ert-with-temp-file fil (ert-with-temp-file fil
@ -108,7 +114,8 @@
(should called))))) (should called)))))
(ert-deftest wallpaper-set/calls-wallpaper-set-function () (ert-deftest wallpaper-set/calls-wallpaper-set-function ()
(skip-unless (executable-find "touch")) (skip-unless (and (executable-find "touch")
(wallpaper--use-default-set-function-p)))
(ert-with-temp-file fil-jpg (ert-with-temp-file fil-jpg
:suffix ".jpg" :suffix ".jpg"
(let* ( wallpaper--current-setter called (let* ( wallpaper--current-setter called