From 81204b276f849b577a0ccd0b6175353dfa9e2a07 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Fri, 6 May 2016 10:09:13 -0700 Subject: [PATCH] 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. --- test/Makefile.in | 13 ++++++++++--- test/{automated => }/data/xref/file1.txt | 0 test/{automated => }/data/xref/file2.txt | 0 test/{automated => lisp/progmodes}/xref-tests.el | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) rename test/{automated => }/data/xref/file1.txt (100%) rename test/{automated => }/data/xref/file2.txt (100%) rename test/{automated => lisp/progmodes}/xref-tests.el (97%) 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 $(foreach test,${TESTS},$(eval $(call test_template,${test}))) +## Check that there is no 'automated' subdirectory, which would +## indicate an incomplete merge from an older version of Emacs where +## the tests were arranged differently. +.PHONY: check-no-automated-subdir +check-no-automated-subdir: + test ! -d $(srcdir)/automated + ## Include dependencies between test files and the files they test. ## We could do this without the file and eval directly, but then we ## would have to run Emacs for every make invocation, and it might not ## be available during clean. -include make-test-deps.mk ## Rerun all default tests. -check: mostlyclean +check: mostlyclean check-no-automated-subdir @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}" ## Rerun all default and expensive tests. .PHONY: check-expensive -check-expensive: mostlyclean +check-expensive: mostlyclean check-no-automated-subdir @${MAKE} check-doit SELECTOR="${SELECTOR_EXPENSIVE}" ## Re-run all tests which are outdated. A test is outdated if its @@ -168,7 +175,7 @@ check-expensive: mostlyclean ## determined by a heuristic and does not identify the full dependency ## graph. See make-test-deps.emacs-lisp for details. .PHONY: check-maybe -check-maybe: +check-maybe: check-no-automated-subdir @${MAKE} check-doit SELECTOR="${SELECTOR_ACTUAL}" ## Run the tests. diff --git a/test/automated/data/xref/file1.txt b/test/data/xref/file1.txt similarity index 100% rename from test/automated/data/xref/file1.txt rename to test/data/xref/file1.txt diff --git a/test/automated/data/xref/file2.txt b/test/data/xref/file2.txt similarity index 100% rename from test/automated/data/xref/file2.txt rename to test/data/xref/file2.txt diff --git a/test/automated/xref-tests.el b/test/lisp/progmodes/xref-tests.el similarity index 97% rename from test/automated/xref-tests.el rename to 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 @@ (defvar xref-tests-data-dir (expand-file-name "data/xref/" - (file-name-directory (or load-file-name (buffer-file-name))))) + (getenv "EMACS_TEST_DIRECTORY"))) (ert-deftest xref-collect-matches-finds-none-for-some-regexp () (should (null (xref-collect-matches "zzz" "*" xref-tests-data-dir nil))))