]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix wallpaper-tests on MS-Windows
authorEli Zaretskii <eliz@gnu.org>
Tue, 11 Apr 2023 07:33:32 +0000 (10:33 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 11 Apr 2023 07:33:32 +0000 (10:33 +0300)
* 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.

test/lisp/image/wallpaper-tests.el

index 94b4d8b2dbb89b2dba7ec34a592943f329396472..2e4e36030d4f98b093a347d854f070efdcda30f7 100644 (file)
@@ -24,7 +24,8 @@
 (require 'wallpaper)
 
 (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
         (wallpaper--default-setters
          (wallpaper--default-methods-create
@@ -32,7 +33,8 @@
     (should (wallpaper--find-setter))))
 
 (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
           (wallpaper--default-setters
            (wallpaper--default-methods-create
@@ -43,7 +45,8 @@
     (should called)))
 
 (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
         (wallpaper--default-setters
          (wallpaper--default-methods-create
@@ -52,7 +55,8 @@
     (should wallpaper--current-setter)))
 
 (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
     :suffix ".jpg"
     (ert-with-temp-file fil
@@ -70,7 +74,8 @@
           (should (file-exists-p fil)))))))
 
 (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
     :suffix ".jpg"
     (ert-with-temp-file fil
@@ -89,7 +94,8 @@
         (should (file-exists-p fil))))))
 
 (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
     :suffix ".jpg"
     (ert-with-temp-file fil
         (should called)))))
 
 (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
     :suffix ".jpg"
     (let* ( wallpaper--current-setter called