summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2020-10-23 16:29:46 +0200
committerStefan Kangas <stefan@marxist.se>2020-10-23 16:29:46 +0200
commit49bc8586b7abc8e1e36027ca5eec0d0488a27474 (patch)
treedd3d9c8a4eb7e85205ee7565d01c91ca21ef79ec
parentd21cdb6c056453d4e4ef8a3a1f27d8bc203c09ea (diff)
downloademacs-49bc8586b7abc8e1e36027ca5eec0d0488a27474.tar.gz
Move some test data to follow our conventions
* test/data/emacs-module/mod-test.c: Move from here... * test/src/emacs-module-resources/mod-test.c: ...to here. * test/src/emacs-module-tests.el (ert-x): Require. (mod-test-file, module/describe-function-1): * test/Makefile.in (test_module_dir): Adjust for move. * test/data/files-bug18141.el.gz: Move from here... * test/lisp/files-resources/files-bug18141.el.gz: ... to here. * test/lisp/files-tests.el (ert-x): Require. (files-test-bug-18141-file): Use ert-resource-file. * test/data/mailcap/mime.types: Move from here... * test/lisp/net/mailcap-resources/mime.types: ...to here. * test/lisp/net/mailcap-tests.el (ert-x): Require. (mailcap-tests-path): Use ert-resource-file. * test/data/somelib.el: * test/data/somelib2.el: Move from here... * test/src/lread-resources/somelib.el: * test/src/lread-resources/somelib2.el: ...to here. * test/src/lread-tests.el (ert, ert-x): Require. (lread-test-bug26837): Use ert-resource-directory. * test/data/syntax-comments.txt: Move from here.... * test/src/syntax-resources/syntax-comments.txt: ...to here. * test/src/syntax-tests.el (ert-x): Require. (syntax-comments, syntax-br-comments, syntax-pps-comments): Use ert-resource-file. * test/data/xref/file1.txt: * test/data/xref/file2.txt: Move from here... * test/lisp/progmodes/xref-resources/file1.txt: * test/lisp/progmodes/xref-resources/file2.txt: ...to here. * test/lisp/progmodes/xref-tests.el (ert, ert-x): Require. (xref-tests-data-dir): Use ert-resource-directory.
-rw-r--r--test/Makefile.in2
-rw-r--r--test/lisp/files-resources/files-bug18141.el.gz (renamed from test/data/files-bug18141.el.gz)bin77 -> 77 bytes
-rw-r--r--test/lisp/files-tests.el3
-rw-r--r--test/lisp/net/mailcap-resources/mime.types (renamed from test/data/mailcap/mime.types)0
-rw-r--r--test/lisp/net/mailcap-tests.el7
-rw-r--r--test/lisp/progmodes/xref-resources/file1.txt (renamed from test/data/xref/file1.txt)0
-rw-r--r--test/lisp/progmodes/xref-resources/file2.txt (renamed from test/data/xref/file2.txt)0
-rw-r--r--test/lisp/progmodes/xref-tests.el7
-rw-r--r--test/src/emacs-module-resources/mod-test.c (renamed from test/data/emacs-module/mod-test.c)0
-rw-r--r--test/src/emacs-module-tests.el12
-rw-r--r--test/src/lread-resources/somelib.el (renamed from test/data/somelib.el)0
-rw-r--r--test/src/lread-resources/somelib2.el (renamed from test/data/somelib2.el)0
-rw-r--r--test/src/lread-tests.el8
-rw-r--r--test/src/syntax-resources/syntax-comments.txt (renamed from test/data/syntax-comments.txt)0
-rw-r--r--test/src/syntax-tests.el12
15 files changed, 23 insertions, 28 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 9974eb54b03..67d203df297 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -132,7 +132,7 @@ emacs = EMACSLOADPATH= \
# exists, or writing to ~/.bzr.log when running bzr commands).
TEST_HOME = /nonexistent
-test_module_dir := data/emacs-module
+test_module_dir := src/emacs-module-resources
.PHONY: all check
diff --git a/test/data/files-bug18141.el.gz b/test/lisp/files-resources/files-bug18141.el.gz
index 53d463e85b5..53d463e85b5 100644
--- a/test/data/files-bug18141.el.gz
+++ b/test/lisp/files-resources/files-bug18141.el.gz
Binary files differ
diff --git a/test/lisp/files-tests.el b/test/lisp/files-tests.el
index 1b964af6887..8818099a223 100644
--- a/test/lisp/files-tests.el
+++ b/test/lisp/files-tests.el
@@ -20,6 +20,7 @@
;;; Code:
(require 'ert)
+(require 'ert-x)
(require 'nadvice)
(eval-when-compile (require 'cl-lib))
(require 'bytecomp) ; `byte-compiler-base-file-name'.
@@ -151,7 +152,7 @@ form.")
(should (file-test--do-local-variables-test str subtest)))))))
(defvar files-test-bug-18141-file
- (expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY"))
+ (ert-resource-file "files-bug18141.el.gz")
"Test file for bug#18141.")
(ert-deftest files-tests-bug-18141 ()
diff --git a/test/data/mailcap/mime.types b/test/lisp/net/mailcap-resources/mime.types
index 4bedfaf9702..4bedfaf9702 100644
--- a/test/data/mailcap/mime.types
+++ b/test/lisp/net/mailcap-resources/mime.types
diff --git a/test/lisp/net/mailcap-tests.el b/test/lisp/net/mailcap-tests.el
index 8354d8e5e23..0ebbec61159 100644
--- a/test/lisp/net/mailcap-tests.el
+++ b/test/lisp/net/mailcap-tests.el
@@ -24,13 +24,10 @@
;;; Code:
(require 'ert)
+(require 'ert-x)
(require 'mailcap)
-(defconst mailcap-tests-data-dir
- (expand-file-name "test/data/mailcap" source-directory))
-
-(defconst mailcap-tests-path
- (expand-file-name "mime.types" mailcap-tests-data-dir)
+(defconst mailcap-tests-path (ert-resource-file "mime.types")
"String used as PATH argument of `mailcap-parse-mimetypes'.")
(defconst mailcap-tests-mime-extensions (copy-alist mailcap-mime-extensions))
diff --git a/test/data/xref/file1.txt b/test/lisp/progmodes/xref-resources/file1.txt
index 5d7cc544443..5d7cc544443 100644
--- a/test/data/xref/file1.txt
+++ b/test/lisp/progmodes/xref-resources/file1.txt
diff --git a/test/data/xref/file2.txt b/test/lisp/progmodes/xref-resources/file2.txt
index 9f075f26004..9f075f26004 100644
--- a/test/data/xref/file2.txt
+++ b/test/lisp/progmodes/xref-resources/file2.txt
diff --git a/test/lisp/progmodes/xref-tests.el b/test/lisp/progmodes/xref-tests.el
index a4980b2acb1..060c9cb5d1c 100644
--- a/test/lisp/progmodes/xref-tests.el
+++ b/test/lisp/progmodes/xref-tests.el
@@ -23,13 +23,12 @@
;;; Code:
+(require 'ert)
+(require 'ert-x)
(require 'xref)
(require 'cl-lib)
-(defvar xref-tests-data-dir
- (expand-file-name "../../../data/xref/"
- (or load-file-name
- buffer-file-name)))
+(defvar xref-tests-data-dir (ert-resource-directory))
(ert-deftest xref-matches-in-directory-finds-none-for-some-regexp ()
(should (null (xref-matches-in-directory "zzz" "*" xref-tests-data-dir nil))))
diff --git a/test/data/emacs-module/mod-test.c b/test/src/emacs-module-resources/mod-test.c
index 258a679b207..258a679b207 100644
--- a/test/data/emacs-module/mod-test.c
+++ b/test/src/emacs-module-resources/mod-test.c
diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el
index 621229c62aa..fb4ed4a6842 100644
--- a/test/src/emacs-module-tests.el
+++ b/test/src/emacs-module-tests.el
@@ -21,13 +21,14 @@
;; Unit tests for the dynamic module facility. See Info node `(elisp)
;; Writing Dynamic Modules'. These tests make use of a small test
-;; module in test/data/emacs-module.
+;; module in the "emacs-module-resources" directory.
;;; Code:
;;; Prelude
(require 'cl-lib)
(require 'ert)
+(require 'ert-x)
(require 'help-fns)
(defconst mod-test-emacs
@@ -35,8 +36,7 @@
"File name of the Emacs binary currently running.")
(eval-and-compile
- (defconst mod-test-file
- (expand-file-name "../test/data/emacs-module/mod-test" invocation-directory)
+ (defconst mod-test-file (ert-resource-file "mod-test")
"File name of the module test file."))
(require 'mod-test mod-test-file)
@@ -313,11 +313,11 @@ local reference."
(text-quoting-style 'grave))
(describe-function-1 #'mod-test-sum)
(goto-char (point-min))
- (while (re-search-forward "`[^']*/data/emacs-module/" nil t)
- (replace-match "`data/emacs-module/"))
+ (while (re-search-forward "`[^']*/src/emacs-module-resources/" nil t)
+ (replace-match "`src/emacs-module-resources/"))
(should (equal
(buffer-substring-no-properties 1 (point-max))
- (format "a module function in `data/emacs-module/mod-test%s'.
+ (format "a module function in `src/emacs-module-resources/mod-test%s'.
(mod-test-sum a b)
diff --git a/test/data/somelib.el b/test/src/lread-resources/somelib.el
index 7b8d4037396..7b8d4037396 100644
--- a/test/data/somelib.el
+++ b/test/src/lread-resources/somelib.el
diff --git a/test/data/somelib2.el b/test/src/lread-resources/somelib2.el
index 05156145a22..05156145a22 100644
--- a/test/data/somelib2.el
+++ b/test/src/lread-resources/somelib2.el
diff --git a/test/src/lread-tests.el b/test/src/lread-tests.el
index 26fd6aa22a1..825b74e6234 100644
--- a/test/src/lread-tests.el
+++ b/test/src/lread-tests.el
@@ -25,6 +25,9 @@
;;; Code:
+(require 'ert)
+(require 'ert-x)
+
(ert-deftest lread-char-number ()
(should (equal (read "?\\N{U+A817}") #xA817)))
@@ -146,10 +149,7 @@ literals (Bug#20852)."
(ert-deftest lread-test-bug26837 ()
"Test for https://debbugs.gnu.org/26837 ."
- (let ((load-path (cons
- (file-name-as-directory
- (expand-file-name "data" (getenv "EMACS_TEST_DIRECTORY")))
- load-path)))
+ (let ((load-path (cons (ert-resource-directory) load-path)))
(load "somelib" nil t)
(should (string-suffix-p "/somelib.el" (caar load-history)))
(load "somelib2" nil t)
diff --git a/test/data/syntax-comments.txt b/test/src/syntax-resources/syntax-comments.txt
index 6f595e4d8dc..6f595e4d8dc 100644
--- a/test/data/syntax-comments.txt
+++ b/test/src/syntax-resources/syntax-comments.txt
diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el
index 56e03380579..4b9c3f277aa 100644
--- a/test/src/syntax-tests.el
+++ b/test/src/syntax-tests.el
@@ -20,6 +20,7 @@
;;; Code:
(require 'ert)
+(require 'ert-x)
(ert-deftest parse-partial-sexp-continue-over-comment-marker ()
"Continue a parse that stopped in the middle of a comment marker."
@@ -91,7 +92,7 @@ also has open paren syntax (see Bug#24870)."
;; It is intended to enhance this bit to test nested comments
;; (2020-10-01).
-;; This bit uses the data file test/data/syntax-comments.txt.
+;; This bit uses the data file syntax-resources/syntax-comments.txt.
(defun syntax-comments-point (n forw)
"Return the buffer offset corresponding to the \"label\" N.
@@ -182,8 +183,7 @@ missing or nil, the value of START is assumed for it."
()
(with-current-buffer
(find-file
- ,(expand-file-name "data/syntax-comments.txt"
- (getenv "EMACS_TEST_DIRECTORY")))
+ ,(ert-resource-file "syntax-comments.txt"))
(,(intern (concat (symbol-name type) "-in")))
(goto-char (syntax-comments-point ,start ,forw))
(let ((stop (syntax-comments-point ,(or stop start) ,(not forw))))
@@ -230,8 +230,7 @@ missing or nil, the value of -START- is assumed for it."
()
(with-current-buffer
(find-file
- ,(expand-file-name "data/syntax-comments.txt"
- (getenv "EMACS_TEST_DIRECTORY")))
+ ,(ert-resource-file "syntax-comments.txt"))
(,(intern (concat (symbol-name type) "-in")))
(let ((start-pos (syntax-comments-point ,start ,forw))
,@(if res
@@ -285,8 +284,7 @@ the `parse-partial-sexp's are expected to stop. See
()
(with-current-buffer
(find-file
- ,(expand-file-name "data/syntax-comments.txt"
- (getenv "EMACS_TEST_DIRECTORY")))
+ ,(ert-resource-file "syntax-comments.txt"))
(,(intern (concat (symbol-name type) "-in")))
(let ((start-pos (syntax-comments-point ,start t))
(open-pos (syntax-comments-midpoint ,open))