diff options
| author | Stefan Kangas | 2023-08-27 15:33:53 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2023-08-27 15:34:57 +0200 |
| commit | 37dcdea7daf2eefc5ec37432fcc09d08910744d7 (patch) | |
| tree | b6592e71200217080837c6b36a2732479353e850 | |
| parent | b497b7b64b4aa6170c9f335058cc8e7db37ab8bf (diff) | |
| download | emacs-37dcdea7daf2eefc5ec37432fcc09d08910744d7.tar.gz emacs-37dcdea7daf2eefc5ec37432fcc09d08910744d7.zip | |
Fix manual image tests on macOS
* test/manual/image-tests.el (ert): Require.
(image-tests--images): Fix typo.
(image-tests-load-image/svg-too-big)
(image-tests-load-image/svg-invalid): Skip test unless built with
SVG support.
(image-tests-image-metadata/gif)
(image-tests-image-metadata/webp): Disable tests on macOS.
| -rw-r--r-- | test/manual/image-tests.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/manual/image-tests.el b/test/manual/image-tests.el index a359bb0f91f..eb5bf13e8b0 100644 --- a/test/manual/image-tests.el +++ b/test/manual/image-tests.el | |||
| @@ -31,6 +31,8 @@ | |||
| 31 | 31 | ||
| 32 | ;;; Code: | 32 | ;;; Code: |
| 33 | 33 | ||
| 34 | (require 'ert) | ||
| 35 | |||
| 34 | (defmacro image-skip-unless (format &rest condition) | 36 | (defmacro image-skip-unless (format &rest condition) |
| 35 | `(skip-unless (and (and (display-images-p) | 37 | `(skip-unless (and (and (display-images-p) |
| 36 | (image-type-available-p ,format)) | 38 | (image-type-available-p ,format)) |
| @@ -41,9 +43,9 @@ | |||
| 41 | source-directory)) | 43 | source-directory)) |
| 42 | (jpeg . ,(expand-file-name "test/data/image/black.jpg" | 44 | (jpeg . ,(expand-file-name "test/data/image/black.jpg" |
| 43 | source-directory)) | 45 | source-directory)) |
| 44 | (pbm . ,(find-image '((:file "splash.svg" :type svg)))) | 46 | (svg . ,(find-image '((:file "splash.svg" :type svg)))) |
| 45 | (png . ,(find-image '((:file "splash.png" :type png)))) | 47 | (png . ,(find-image '((:file "splash.png" :type png)))) |
| 46 | (svg . ,(find-image '((:file "splash.pbm" :type pbm)))) | 48 | (pbm . ,(find-image '((:file "splash.pbm" :type pbm)))) |
| 47 | (tiff . ,(expand-file-name | 49 | (tiff . ,(expand-file-name |
| 48 | "nextstep/GNUstep/Emacs.base/Resources/emacs.tiff" | 50 | "nextstep/GNUstep/Emacs.base/Resources/emacs.tiff" |
| 49 | source-directory)) | 51 | source-directory)) |
| @@ -80,6 +82,7 @@ | |||
| 80 | (image-tests-make-load-image-test 'xpm) | 82 | (image-tests-make-load-image-test 'xpm) |
| 81 | 83 | ||
| 82 | (ert-deftest image-tests-load-image/svg-too-big () | 84 | (ert-deftest image-tests-load-image/svg-too-big () |
| 85 | (image-skip-unless svg) | ||
| 83 | (with-temp-buffer | 86 | (with-temp-buffer |
| 84 | (let* ((max-image-size 0) | 87 | (let* ((max-image-size 0) |
| 85 | (messages-buffer-name (buffer-name (current-buffer))) | 88 | (messages-buffer-name (buffer-name (current-buffer))) |
| @@ -95,6 +98,7 @@ | |||
| 95 | (should-not (string-match-p "error parsing" (buffer-string)))))) | 98 | (should-not (string-match-p "error parsing" (buffer-string)))))) |
| 96 | 99 | ||
| 97 | (ert-deftest image-tests-load-image/svg-invalid () | 100 | (ert-deftest image-tests-load-image/svg-invalid () |
| 101 | (image-skip-unless svg) | ||
| 98 | (with-temp-buffer | 102 | (with-temp-buffer |
| 99 | (let ((messages-buffer-name (buffer-name (current-buffer)))) | 103 | (let ((messages-buffer-name (buffer-name (current-buffer)))) |
| 100 | (with-temp-buffer | 104 | (with-temp-buffer |
| @@ -240,6 +244,8 @@ | |||
| 240 | 244 | ||
| 241 | (ert-deftest image-tests-image-metadata/gif () | 245 | (ert-deftest image-tests-image-metadata/gif () |
| 242 | (image-skip-unless 'gif | 246 | (image-skip-unless 'gif |
| 247 | ;; FIXME: Why is this failing on macOS? | ||
| 248 | (not (eq system-type 'darwin)) | ||
| 243 | (not (bound-and-true-p w32-use-native-image-API))) | 249 | (not (bound-and-true-p w32-use-native-image-API))) |
| 244 | (should (memq 'delay | 250 | (should (memq 'delay |
| 245 | (image-metadata | 251 | (image-metadata |
| @@ -268,7 +274,9 @@ | |||
| 268 | (create-image (cdr (assq 'tiff image-tests--images)))))) | 274 | (create-image (cdr (assq 'tiff image-tests--images)))))) |
| 269 | 275 | ||
| 270 | (ert-deftest image-tests-image-metadata/webp () | 276 | (ert-deftest image-tests-image-metadata/webp () |
| 271 | (image-skip-unless 'webp) | 277 | (image-skip-unless 'webp |
| 278 | ;; FIXME: Why is this failing on macOS? | ||
| 279 | (not (eq system-type 'darwin))) | ||
| 272 | (should (memq 'delay | 280 | (should (memq 'delay |
| 273 | (image-metadata | 281 | (image-metadata |
| 274 | (create-image (cdr (assq 'webp image-tests--images))))))) | 282 | (create-image (cdr (assq 'webp image-tests--images))))))) |