From 67fb4e6a86456acb7fd6564bc0f70d8bf6d7704d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 2 Nov 2013 13:54:08 -0700 Subject: [PATCH] test/automated: Use relative filename for emacs executable * Makefile.in (check): Depend on all. * test/automated/Makefile.in (abs_top_builddir): Remove variable. (EMACS): Use a relative file name. (lisp-compile): Remove (assume it's up-to-date). (compile-main): Do not run lisp-compile. (check): Use --chdir. --- ChangeLog | 4 ++++ Makefile.in | 2 +- test/ChangeLog | 7 +++++-- test/automated/Makefile.in | 24 +++++++++--------------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 142cacbc9f..eee806f6b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-02 Glenn Morris + + * Makefile.in (check): Depend on all. + 2013-10-31 Glenn Morris * configure.ac: Use [!...] rather than [^...], for ksh. (Bug#15769) diff --git a/Makefile.in b/Makefile.in index 5cf2cb1200..8915eb3d9f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -936,7 +936,7 @@ extraclean: TAGS tags: lib lib-src src cd src; $(MAKE) $(MFLAGS) tags -check: +check: all @if test ! -d test/automated; then \ echo "You do not seem to have the test/ directory."; \ echo "Maybe you are using a release tarfile, rather than a repository checkout."; \ diff --git a/test/ChangeLog b/test/ChangeLog index 260a5bb72f..6d00a61aee 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,12 +1,15 @@ 2013-11-02 Glenn Morris * automated/Makefile.in (top_builddir, abs_test, abs_lispsrc, lisp) - (test, abs_top_srcdir): Remove variables. + (test, abs_top_srcdir, abs_top_builddir): Remove variables. (abs_srcdir): New, set by configure. + (EMACS): Use a relative file name. (emacs): Use abs_srcdir rather than abs_lispsrc, abs_test. - (lisp-compile): Use ../../lisp rather than $lisp. + (lisp-compile): Remove (assume it's up-to-date). + (compile-main): Do not run lisp-compile. (compile-main, compile-clean, compile-always, bootstrap-clean) (check): Use srcdir rather than $test. Check cd return value. + Use --chdir. (doit, compile, compile-always): Remove stuff copied from lisp/. (all, check, bootstrap-clean, distclean, maintainer-clean): PHONY. diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in index a84d8a7b34..7ddade8dad 100644 --- a/test/automated/Makefile.in +++ b/test/automated/Makefile.in @@ -21,16 +21,12 @@ SHELL = @SHELL@ srcdir = @srcdir@ abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ VPATH = $(srcdir) -# You can specify a different executable on the make command line, -# e.g. "make EMACS=../src/emacs ...". - -# We sometimes change directory before running Emacs (typically when -# building out-of-tree, we chdir to the source directory), so we need -# to use an absolute file name. -EMACS = ${abs_top_builddir}/src/emacs +# 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 # Command line flags for Emacs. EMACSOPT = -batch --no-site-file --no-site-lisp @@ -62,17 +58,14 @@ all: check @$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $< -.PHONY: lisp-compile compile-targets compile-main compile-clean - -lisp-compile: - cd ../../lisp && $(MAKE) $(MFLAGS) compile EMACS="$(EMACS)" +.PHONY: compile-targets compile-main compile-clean # TARGETS is set dynamically in the recursive call from `compile-main'. compile-targets: $(TARGETS) # Compile all the Elisp files that need it. Beware: it approximates # `no-byte-compile', so watch out for false-positives! -compile-main: compile-clean lisp-compile +compile-main: compile-clean @(cd $(srcdir) && $(setwins); \ els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ for el in $$els; do \ @@ -108,7 +101,7 @@ maintainer-clean: distclean bootstrap-clean check: compile-main - @(cd $(srcdir) && $(setwins); \ + @thisdir=`pwd`; cd $(srcdir) && $(setwins); \ pattern=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ for el in $$pattern; do \ test -f $$el || continue; \ @@ -116,6 +109,7 @@ check: compile-main els="$$els $$el"; \ done; \ echo Testing $$els; \ - $(emacs) $$args -f ert-run-tests-batch-and-exit) + cd "$$thisdir"; \ + $(emacs) --chdir $(srcdir) $$args -f ert-run-tests-batch-and-exit # Makefile ends here. -- 2.20.1