From: Stefan Kangas Date: Sat, 24 Oct 2020 01:45:48 +0000 (+0200) Subject: Move faces.el test data to follow our conventions X-Git-Tag: emacs-28.0.90~5452 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=228d9d615d7067ca06a2b53205c29d78dbbfe725;p=emacs.git Move faces.el test data to follow our conventions * test/lisp/faces-tests.el (ert-x): Require. (faces--test-data-dir): Remove variable. (faces--test-extend-with-themes): Use ert-resource-directory. * test/lisp/faces-resources/*: Moved from test/data/themes/*. --- diff --git a/test/data/themes/faces-test-dark-theme.el b/test/data/themes/faces-test-dark-theme.el deleted file mode 100644 index a5e2ca43627..00000000000 --- a/test/data/themes/faces-test-dark-theme.el +++ /dev/null @@ -1,35 +0,0 @@ -;;; faces-test-dark-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- - -;; Copyright (C) 2019-2020 Free Software Foundation, Inc. - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;;; Code: - -(deftheme faces-test-dark - "") - -(custom-theme-set-faces - 'faces-test-dark - '(spiff-added ((t (:foreground "Green" :extend t)))) - '(spiff-changed-face ((t (:foreground "Khaki")))) - '(spiff-file-header-face ((t (:background "grey20" :foreground "ivory1"))))) - -(provide-theme 'faces-test-dark) - -;;; faces-test-dark-theme.el ends here diff --git a/test/data/themes/faces-test-light-theme.el b/test/data/themes/faces-test-light-theme.el deleted file mode 100644 index b2f7ec69742..00000000000 --- a/test/data/themes/faces-test-light-theme.el +++ /dev/null @@ -1,34 +0,0 @@ -;;; faces-test-light-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- - -;; Copyright (C) 2019-2020 Free Software Foundation, Inc. - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;;; Code: - -(deftheme faces-test-light - "") - -(custom-theme-set-faces - 'faces-test-light - '(spiff-added ((t (:inherit diff-changed :background "light green" :extend t)))) - '(spiff-changed ((t (:background "light steel blue"))))) - -(provide-theme 'faces-test-light) - -;;; faces-test-light-theme.el ends here diff --git a/test/lisp/faces-resources/faces-test-dark-theme.el b/test/lisp/faces-resources/faces-test-dark-theme.el new file mode 100644 index 00000000000..a5e2ca43627 --- /dev/null +++ b/test/lisp/faces-resources/faces-test-dark-theme.el @@ -0,0 +1,35 @@ +;;; faces-test-dark-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- + +;; Copyright (C) 2019-2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(deftheme faces-test-dark + "") + +(custom-theme-set-faces + 'faces-test-dark + '(spiff-added ((t (:foreground "Green" :extend t)))) + '(spiff-changed-face ((t (:foreground "Khaki")))) + '(spiff-file-header-face ((t (:background "grey20" :foreground "ivory1"))))) + +(provide-theme 'faces-test-dark) + +;;; faces-test-dark-theme.el ends here diff --git a/test/lisp/faces-resources/faces-test-light-theme.el b/test/lisp/faces-resources/faces-test-light-theme.el new file mode 100644 index 00000000000..b2f7ec69742 --- /dev/null +++ b/test/lisp/faces-resources/faces-test-light-theme.el @@ -0,0 +1,34 @@ +;;; faces-test-light-theme.el --- A dark theme from tests ;;; -*- lexical-binding: t; -*- + +;; Copyright (C) 2019-2020 Free Software Foundation, Inc. + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(deftheme faces-test-light + "") + +(custom-theme-set-faces + 'faces-test-light + '(spiff-added ((t (:inherit diff-changed :background "light green" :extend t)))) + '(spiff-changed ((t (:background "light steel blue"))))) + +(provide-theme 'faces-test-light) + +;;; faces-test-light-theme.el ends here diff --git a/test/lisp/faces-tests.el b/test/lisp/faces-tests.el index 32dc1eea856..b19cef5decd 100644 --- a/test/lisp/faces-tests.el +++ b/test/lisp/faces-tests.el @@ -23,13 +23,9 @@ ;;; Code: (require 'ert) +(require 'ert-x) (require 'faces) -(defvar faces--test-data-dir - (expand-file-name "../data/" - (file-name-directory (or load-file-name - buffer-file-name)))) - (defgroup faces--test nil "" :group 'faces--test) @@ -122,7 +118,7 @@ (should (equal (face-attribute 'spiff-changed-face :extend) t)) (should (equal (face-attribute 'spiff-added :extend) 'unspecified)) (should (equal (face-attribute 'spiff-file-header-face :extend) nil)) - (add-to-list 'custom-theme-load-path (concat faces--test-data-dir "themes")) + (add-to-list 'custom-theme-load-path (ert-resource-directory)) (load-theme 'faces-test-dark t t) (load-theme 'faces-test-light t t) (should (equal (face-attribute 'faces--test-inherit-extend :extend)