]> git.eshelyaron.com Git - emacs.git/commitdiff
Test infrastructure: updates after directory move
authorPhillip Lord <phillip.lord@russet.org.uk>
Mon, 23 Nov 2015 22:08:52 +0000 (22:08 +0000)
committerPhillip Lord <phillip.lord@russet.org.uk>
Tue, 24 Nov 2015 17:10:12 +0000 (17:10 +0000)
 * (test/Makefile.in): Support directories several levels deep.
 * (test/data/flymake): Rename to test/lisp/progmodes/flymake-resources.
 * (test/lisp/progmodes/flymake-tests.el): Support renamed resource directory.

test/Makefile.in
test/data/flymake/test.c [deleted file]
test/data/flymake/test.pl [deleted file]
test/lisp/progmodes/flymake-resources/test.c [new file with mode: 0644]
test/lisp/progmodes/flymake-resources/test.pl [new file with mode: 0644]
test/lisp/progmodes/flymake-tests.el

index 41f54f8aa69a061b4f32bbfc593d90c4d9cd825a..3343f729bf6ff184e4e4f353cc1420e58bc22155 100644 (file)
@@ -37,7 +37,7 @@ SEPCHAR = @SEPCHAR@
 # We never change directory before running Emacs, so a relative file
 # name is fine, and makes life easier.  If we need to change
 # directory, we can use emacs --chdir.
-EMACS = ../../src/emacs
+EMACS = ../src/emacs
 
 EMACS_EXTRAOPT=
 
@@ -99,9 +99,10 @@ WRITE_LOG = > $@ 2>&1 || { stat=ERROR; cat $@; }; echo $$stat: $@
        $(emacs) -l ert -l $$loadfile \
          -f ert-run-tests-batch-and-exit ${WRITE_LOG}
 
-ELFILES = $(sort $(wildcard ${srcdir}/*.el))
-LOGFILES = $(patsubst %.el,%.log,$(notdir ${ELFILES}))
-TESTS = ${LOGFILES:.log=}
+ELFILES = $(sort $(wildcard ${srcdir}/*.el) $(wildcard ${srcdir}/*/*.el) \
+       $(wildcard ${srcdir}/*/*/*.el) $(wildcard ${srcdir}/*/*/*/*.el))
+LOGFILES = $(patsubst %.el,%.log,${ELFILES})
+TESTS = $(subst ${srcdir}/,,$(LOGFILES:.log=))
 
 ## If we have to interrupt a hanging test, preserve the log so we can
 ## see what the problem was.
@@ -112,8 +113,8 @@ TESTS = ${LOGFILES:.log=}
 ## The short aliases that always re-run the tests, with no logging.
 define test_template
 $(1):
-       @test ! -f $(1).log || mv $(1).log $(1).log~
-       @${MAKE} $(1).log WRITE_LOG=
+       @test ! -f ${srcdir}/$(1).log || mv ${srcdir}/$(1).log ${srcdir}/$(1).log~
+       @${MAKE} ${srcdir}/$(1).log WRITE_LOG=
 endef
 
 $(foreach test,${TESTS},$(eval $(call test_template,${test})))
@@ -132,10 +133,12 @@ check-maybe: ${LOGFILES}
 .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean
 
 clean mostlyclean:
-       -rm -f *.log *.log~
+       -rm -f ${srcdir}/*.log ${srcdir}/*.log~ ${srcdir}/*/*.log \
+               ${srcdir}/*/*.log~ ${srcdir}/*/*/*.log \
+               ${srcdir}/*/*/*.log~
 
 bootstrap-clean: clean
-       -rm -f ${srcdir}/*.elc
+       -rm -f ${srcdir}/*.elc ${srcdir}/*/*.elc ${srcdir}/*/*/*.elc
 
 distclean: clean
        rm -f Makefile
diff --git a/test/data/flymake/test.c b/test/data/flymake/test.c
deleted file mode 100644 (file)
index 3a39261..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-int main()
-{
-  char c = 1000;
-  return c;
-}
diff --git a/test/data/flymake/test.pl b/test/data/flymake/test.pl
deleted file mode 100644 (file)
index d5abcb4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-@arr = [1,2,3,4];
-my $b = @arr[1];
diff --git a/test/lisp/progmodes/flymake-resources/test.c b/test/lisp/progmodes/flymake-resources/test.c
new file mode 100644 (file)
index 0000000..3a39261
--- /dev/null
@@ -0,0 +1,5 @@
+int main()
+{
+  char c = 1000;
+  return c;
+}
diff --git a/test/lisp/progmodes/flymake-resources/test.pl b/test/lisp/progmodes/flymake-resources/test.pl
new file mode 100644 (file)
index 0000000..d5abcb4
--- /dev/null
@@ -0,0 +1,2 @@
+@arr = [1,2,3,4];
+my $b = @arr[1];
index 11231bc3f7a2e03e80f55ecf73de0da56bbfeb83..1d8c12c065501e862bcb2f93dfd7e6ca7096f8bc 100644 (file)
@@ -26,7 +26,7 @@
 (require 'flymake)
 
 (defvar flymake-tests-data-directory
-  (expand-file-name "data/flymake" (getenv "EMACS_TEST_DIRECTORY"))
+  (expand-file-name "lisp/progmodes/flymake-resources" (getenv "EMACS_TEST_DIRECTORY"))
   "Directory containing flymake test data.")
 
 \f