aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-05-06 10:09:13 -0700
committerPaul Eggert2016-05-06 10:09:53 -0700
commit81204b276f849b577a0ccd0b6175353dfa9e2a07 (patch)
tree0b3c205165739eafbaa5f315caf9f16fe03800aa
parent89ce83b20249dfb4e45f09dfdddf4c4b66d82968 (diff)
downloademacs-81204b276f849b577a0ccd0b6175353dfa9e2a07.tar.gz
emacs-81204b276f849b577a0ccd0b6175353dfa9e2a07.zip
Port xref-tests to master branch
Also, add a test to make this problem less likely in the future. * test/Makefile.in (check-no-automated-subdir): New rule. (check, check-expensive, check-maybe): Depend on it. * test/automated/data/xref/file1.txt: Rename to ... * test/data/xref/file1.txt: ... here. * test/automated/data/xref/file2.txt: Rename to ... * test/data/xref/file2.txt: ... here. * test/automated/xref-tests.el: Rename to ... * test/lisp/progmodes/xref-tests.el: ... here. (xref-tests-data-dir): Use EMACS_TEST_DIRECTORY.
-rw-r--r--test/Makefile.in13
-rw-r--r--test/data/xref/file1.txt (renamed from test/automated/data/xref/file1.txt)0
-rw-r--r--test/data/xref/file2.txt (renamed from test/automated/data/xref/file2.txt)0
-rw-r--r--test/lisp/progmodes/xref-tests.el (renamed from test/automated/xref-tests.el)2
4 files changed, 11 insertions, 4 deletions
diff --git a/test/Makefile.in b/test/Makefile.in
index 26d7e591c7a..7ebc0ded4e7 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -148,18 +148,25 @@ endef
148 148
149$(foreach test,${TESTS},$(eval $(call test_template,${test}))) 149$(foreach test,${TESTS},$(eval $(call test_template,${test})))
150 150
151## Check that there is no 'automated' subdirectory, which would
152## indicate an incomplete merge from an older version of Emacs where
153## the tests were arranged differently.
154.PHONY: check-no-automated-subdir
155check-no-automated-subdir:
156 test ! -d $(srcdir)/automated
157
151## Include dependencies between test files and the files they test. 158## Include dependencies between test files and the files they test.
152## We could do this without the file and eval directly, but then we 159## We could do this without the file and eval directly, but then we
153## would have to run Emacs for every make invocation, and it might not 160## would have to run Emacs for every make invocation, and it might not
154## be available during clean. 161## be available during clean.
155-include make-test-deps.mk 162-include make-test-deps.mk
156## Rerun all default tests. 163## Rerun all default tests.
157check: mostlyclean 164check: mostlyclean check-no-automated-subdir
158 @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}" 165 @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}"
159 166
160## Rerun all default and expensive tests. 167## Rerun all default and expensive tests.
161.PHONY: check-expensive 168.PHONY: check-expensive
162check-expensive: mostlyclean 169check-expensive: mostlyclean check-no-automated-subdir
163 @${MAKE} check-doit SELECTOR="${SELECTOR_EXPENSIVE}" 170 @${MAKE} check-doit SELECTOR="${SELECTOR_EXPENSIVE}"
164 171
165## Re-run all tests which are outdated. A test is outdated if its 172## Re-run all tests which are outdated. A test is outdated if its
@@ -168,7 +175,7 @@ check-expensive: mostlyclean
168## determined by a heuristic and does not identify the full dependency 175## determined by a heuristic and does not identify the full dependency
169## graph. See make-test-deps.emacs-lisp for details. 176## graph. See make-test-deps.emacs-lisp for details.
170.PHONY: check-maybe 177.PHONY: check-maybe
171check-maybe: 178check-maybe: check-no-automated-subdir
172 @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}" 179 @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}"
173 180
174## Run the tests. 181## Run the tests.
diff --git a/test/automated/data/xref/file1.txt b/test/data/xref/file1.txt
index 5d7cc544443..5d7cc544443 100644
--- a/test/automated/data/xref/file1.txt
+++ b/test/data/xref/file1.txt
diff --git a/test/automated/data/xref/file2.txt b/test/data/xref/file2.txt
index 9f075f26004..9f075f26004 100644
--- a/test/automated/data/xref/file2.txt
+++ b/test/data/xref/file2.txt
diff --git a/test/automated/xref-tests.el b/test/lisp/progmodes/xref-tests.el
index 079b196aa8b..2b745816c62 100644
--- a/test/automated/xref-tests.el
+++ b/test/lisp/progmodes/xref-tests.el
@@ -28,7 +28,7 @@
28 28
29(defvar xref-tests-data-dir 29(defvar xref-tests-data-dir
30 (expand-file-name "data/xref/" 30 (expand-file-name "data/xref/"
31 (file-name-directory (or load-file-name (buffer-file-name))))) 31 (getenv "EMACS_TEST_DIRECTORY")))
32 32
33(ert-deftest xref-collect-matches-finds-none-for-some-regexp () 33(ert-deftest xref-collect-matches-finds-none-for-some-regexp ()
34 (should (null (xref-collect-matches "zzz" "*" xref-tests-data-dir nil)))) 34 (should (null (xref-collect-matches "zzz" "*" xref-tests-data-dir nil))))