From c209a0f82825dacd7edeef34b31f458499307eef Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Tue, 16 Mar 2021 18:40:24 +0100 Subject: [PATCH] Fix problem of image-tests.el on emba * test/README: Mention $EMACS_TEST_DIRECTORY. * test/lisp/image-tests.el (image-tests--emacs-images-directory): Use `data-directory', for runs w/o of make. (image-type/from-filename): Check for `image-load-path'. --- test/README | 6 +++++- test/lisp/image-tests.el | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/README b/test/README index 1e0e43a8aca..a348074aba7 100644 --- a/test/README +++ b/test/README @@ -22,7 +22,10 @@ following tags are recognized: * :unstable The test is under development. It shall run on demand only. -The Makefile in this directory supports the following targets: +The Makefile sets the environment variable $EMACS_TEST_DIRECTORY, +which points to this directory. This environment variable does not +exist when the tests are run outside make. The Makefile supports the +following targets: * make check Run all tests as defined in the directory. Expensive and unstable @@ -113,6 +116,7 @@ Some optional tests require packages from GNU ELPA. By default out somewhere else, use make GNU_ELPA_DIRECTORY=/path/to/elpa ... + There are also continuous integration tests on (see diff --git a/test/lisp/image-tests.el b/test/lisp/image-tests.el index bb42ffae18e..2f7afa2f38e 100644 --- a/test/lisp/image-tests.el +++ b/test/lisp/image-tests.el @@ -25,7 +25,7 @@ (require 'cl-lib)) (defconst image-tests--emacs-images-directory - (expand-file-name "../etc/images" (getenv "EMACS_TEST_DIRECTORY")) + (expand-file-name "images" data-directory) "Directory containing Emacs images.") (ert-deftest image--set-property () @@ -57,6 +57,8 @@ (should (eq (image-type-from-file-name "foo.png") 'png))) (ert-deftest image-type/from-filename () + ;; On emba, `image-load-path' does not exist. + (skip-unless (bound-and-true-p image-load-path)) (should (eq (image-type "foo.jpg") 'jpeg))) (ert-deftest image-type-from-file-header-test () -- 2.39.5