From 7975c811d32b6c08b4eab9e8faee615ab69c9e34 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 3 Sep 2023 21:04:02 +0200 Subject: Use new ERT `skip-when` macro in tests * test/lisp/autorevert-tests.el (auto-revert-test02-auto-revert-deleted-file): * test/lisp/emacs-lisp/benchmark-tests.el (benchmark-tests): * test/lisp/emacs-lisp/find-func-tests.el (find-func-tests--library-completion): * test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill-pipeline): * test/lisp/filenotify-tests.el (file-notify-test11-symlinks): * test/lisp/ibuffer-tests.el (ibuffer-0autoload): * test/lisp/international/ucs-normalize-tests.el (ucs-normalize-part1): * test/lisp/net/network-stream-tests.el (echo-server-nowait) (connect-to-tls-ipv4-nowait, connect-to-tls-ipv6-nowait) (open-network-stream-tls-wait, open-network-stream-tls-nowait) (open-network-stream-tls, open-network-stream-tls-nocert) (open-gnutls-stream-new-api-nowait) (open-gnutls-stream-old-api-nowait): * test/lisp/progmodes/cperl-mode-tests.el (cperl-test-bug-10483) (cperl-test-hyperactive-electric-else): * test/lisp/progmodes/elisp-mode-tests.el (eval-last-sexp-print-format-sym-echo) (eval-last-sexp-print-format-small-int-echo) (eval-last-sexp-print-format-large-int-echo) (eval-defun-prints-edebug-when-instrumented): * test/lisp/progmodes/python-tests.el (python-ffap-module-path-1): * test/lisp/shadowfile-tests.el (shadow-test00-clusters) (shadow-test01-sites, shadow-test02-files) (shadow-test03-expand-cluster-in-file-name) (shadow-test04-contract-file-name, shadow-test05-file-match) (shadow-test06-literal-groups, shadow-test07-regexp-groups) (shadow-test08-shadow-todo, shadow-test09-shadow-copy-files): * test/lisp/simple-tests.el (eval-expression-print-format-sym-echo) (eval-expression-print-format-small-int-echo) (eval-expression-print-format-large-int-echo): * test/lisp/term-tests.el (term-simple-lines) (term-carriage-return, term-line-wrap, term-colors) (term-colors-bold-is-bright, term-cursor-movement) (term-scrolling-region, term-set-directory) (term-line-wrapping-then-motion, term-to-margin): * test/lisp/thread-tests.el (thread-tests-list-threads-error-when-not-configured): * test/lisp/vc/vc-tests.el (backend): * test/manual/scroll-tests.el (scroll-tests-scroll-margin-0) (scroll-tests-scroll-margin-negative) (scroll-tests-scroll-margin-max) (scroll-tests-scroll-margin-over-max) (scroll-tests-scroll-margin-whole-window): * test/misc/test-custom-libs.el (test-custom-libs): * test/src/emacs-module-tests.el (module/async-pipe): * test/src/fileio-tests.el (fileio-tests--odd-symlink-chars): * test/src/filelock-tests.el (filelock-tests-lock-spoiled) (filelock-tests-file-locked-p-spoiled) (filelock-tests-unlock-spoiled) (filelock-tests-kill-buffer-spoiled) (filelock-tests-detect-external-change): * test/src/image-tests.el (image-tests-image-size/error-on-nongraphical-display) (image-tests-image-mask-p/error-on-nongraphical-display) (image-tests-image-metadata/error-on-nongraphical-display): * test/src/process-tests.el (make-process/mix-stderr) (process-tests/fd-setsize-no-crash/make-network-process) (process-tests/fd-setsize-no-crash/make-serial-process): Use ERT `skip-when` macro in tests. --- test/src/emacs-module-tests.el | 2 +- test/src/fileio-tests.el | 2 +- test/src/filelock-tests.el | 10 +++++----- test/src/image-tests.el | 6 +++--- test/src/process-tests.el | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) (limited to 'test/src') diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index ac88011b543..59af5d9a4a8 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -457,7 +457,7 @@ See Bug#36226." (ert-deftest module/async-pipe () "Check that writing data from another thread works." - (skip-unless (not (eq system-type 'windows-nt))) ; FIXME! + (skip-when (eq system-type 'windows-nt)) ; FIXME! (with-temp-buffer (let ((process (make-pipe-process :name "module/async-pipe" :buffer (current-buffer) diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index 50642420ce9..62a9be546f9 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el @@ -50,7 +50,7 @@ Also check that an encoding error can appear in a symlink." ;; Some Windows versions don't support symlinks, and those which do ;; will pop up UAC elevation prompts, so we disable this test on ;; MS-Windows. - (skip-unless (not (eq system-type 'windows-nt))) + (skip-when (eq system-type 'windows-nt)) (should (equal nil (fileio-tests--symlink-failure)))) (ert-deftest fileio-tests--directory-file-name () diff --git a/test/src/filelock-tests.el b/test/src/filelock-tests.el index c5e77f70bb2..f4376b2a5b0 100644 --- a/test/src/filelock-tests.el +++ b/test/src/filelock-tests.el @@ -109,7 +109,7 @@ the case)." (ert-deftest filelock-tests-lock-spoiled () "Check `lock-buffer'." - (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support + (skip-when (eq system-type 'ms-dos)) ; no filelock support (filelock-tests--fixture (filelock-tests--spoil-lock-file buffer-file-truename) ;; FIXME: errors when locking a file are ignored; should they be? @@ -119,7 +119,7 @@ the case)." (ert-deftest filelock-tests-file-locked-p-spoiled () "Check that `file-locked-p' fails if the lockfile is \"spoiled\"." - (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support + (skip-when (eq system-type 'ms-dos)) ; no filelock support (filelock-tests--fixture (filelock-tests--spoil-lock-file buffer-file-truename) (let ((err (should-error (file-locked-p (buffer-file-name))))) @@ -130,7 +130,7 @@ the case)." (ert-deftest filelock-tests-unlock-spoiled () "Check that `unlock-buffer' fails if the lockfile is \"spoiled\"." - (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support + (skip-when (eq system-type 'ms-dos)) ; no filelock support (filelock-tests--fixture ;; Set the buffer modified with file locking temporarily disabled. (let ((create-lockfiles nil)) @@ -150,7 +150,7 @@ the case)." (ert-deftest filelock-tests-kill-buffer-spoiled () "Check that `kill-buffer' fails if a lockfile is \"spoiled\"." - (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support + (skip-when (eq system-type 'ms-dos)) ; no filelock support (filelock-tests--fixture ;; Set the buffer modified with file locking temporarily disabled. (let ((create-lockfiles nil)) @@ -176,7 +176,7 @@ the case)." (ert-deftest filelock-tests-detect-external-change () "Check that an external file modification is reported." - (skip-unless (not (eq system-type 'ms-dos))) ; no filelock support + (skip-when (eq system-type 'ms-dos)) ; no filelock support (skip-unless (executable-find "touch")) (skip-unless (executable-find "echo")) (dolist (cl '(t nil)) diff --git a/test/src/image-tests.el b/test/src/image-tests.el index 317f4d3aab6..3eec2bb4c60 100644 --- a/test/src/image-tests.el +++ b/test/src/image-tests.el @@ -44,15 +44,15 @@ (xpm . ,(find-image '((:file "splash.xpm" :type xpm)))))) (ert-deftest image-tests-image-size/error-on-nongraphical-display () - (skip-unless (not (display-images-p))) + (skip-when (display-images-p)) (should-error (image-size 'invalid-spec))) (ert-deftest image-tests-image-mask-p/error-on-nongraphical-display () - (skip-unless (not (display-images-p))) + (skip-when (display-images-p)) (should-error (image-mask-p (cdr (assq 'xpm image-tests--images))))) (ert-deftest image-tests-image-metadata/error-on-nongraphical-display () - (skip-unless (not (display-images-p))) + (skip-when (display-images-p)) (should-error (image-metadata (cdr (assq 'xpm image-tests--images))))) (ert-deftest image-tests-imagemagick-types () diff --git a/test/src/process-tests.el b/test/src/process-tests.el index e17e1c0d833..711a27f1cfb 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el @@ -231,7 +231,7 @@ process to complete." (with-timeout (60 (ert-fail "Test timed out")) ;; Frequent random (?) failures on hydra.nixos.org, with no process output. ;; Maybe this test should be tagged unstable? See bug#31214. - (skip-unless (not (getenv "EMACS_HYDRA_CI"))) + (skip-when (getenv "EMACS_HYDRA_CI")) (with-temp-buffer (let ((process (make-process :name "mix-stderr" @@ -723,7 +723,7 @@ FD_SETSIZE file descriptors (Bug#24325)." (skip-unless (featurep 'make-network-process '(:server t))) (skip-unless (featurep 'make-network-process '(:family local))) ;; Avoid hang due to connect/accept handshake on Cygwin (bug#49496). - (skip-unless (not (eq system-type 'cygwin))) + (skip-when (eq system-type 'cygwin)) (with-timeout (60 (ert-fail "Test timed out")) (ert-with-temp-directory directory (process-tests--with-processes processes @@ -763,7 +763,7 @@ FD_SETSIZE file descriptors (Bug#24325)." "Check that Emacs doesn't crash when trying to use more than FD_SETSIZE file descriptors (Bug#24325)." ;; This test cannot be run if PTYs aren't supported. - (skip-unless (not (eq system-type 'windows-nt))) + (skip-when (eq system-type 'windows-nt)) (with-timeout (60 (ert-fail "Test timed out")) (process-tests--with-processes processes ;; In order to use `make-serial-process', we need to create some -- cgit v1.2.1