Subject: bug#15933: make check not working

From: Andy Moreton <[email-masked]>
Date: Wed, 20 Nov 2013 12:55:09 +0000

Hi,

Running 'make check' does not work correctly for me with bzr r115157 on
Windows with mingw and and out of tree build directory:

--[make check]------------------------------------------------------
Compiling ../../../test/automated/package-x-test.el

In toplevel form:
../../../test/automated/package-x-test.el:38:30:Error: Cannot open load file: no such file or directory, package-test
make[2]: *** [../../../test/automated/package-x-test.elc] Error 1
--[make check]------------------------------------------------------

It seems that the recent changes for relative paths and msys
translations have not been added to tests/automated/Makefile.in. The
following patch copies the new behaviour from lisp/Makefile.in and
allowed the tests to build and run (one test aborts emacs, for other
reasons).

=== modified file 'test/automated/Makefile.in'
--- test/automated/Makefile.in	2013-11-06 17:56:48 +0000
+++ test/automated/Makefile.in	2013-11-20 11:49:09 +0000
@@ -20,8 +20,13 @@
 SHELL = @SHELL@
 
 srcdir = @srcdir@
+test_automated = $(srcdir)
 VPATH = $(srcdir)
 
+# Empty for all systems except MinGW, where xargs needs an explicit
+# limitation.
+XARGS_LIMIT = @XARGS_LIMIT@
+
 # 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.
@@ -66,20 +71,20 @@
 # Compile all the Elisp files that need it.  Beware: it approximates
 # `no-byte-compile', so watch out for false-positives!
 compile-main: compile-clean
-	@$(setwins); \
+	@(cd $(test_automated) && $(setwins); \
 	els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
 	for el in $$els; do \
 	  test -f $$el || continue; \
 	  test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
 	  echo "$${el}c"; \
-	done | xargs echo | \
+	done | xargs  $(XARGS_LIMIT) echo) | \
 	while read chunk; do \
 	  $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
 	done
 
 # Erase left-over .elc files that do not have a corresponding .el file.
 compile-clean:
-	@$(setwins); \
+	@cd $(test_automated) && $(setwins); \
 	elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \
 	for el in $$(echo $$elcs | sed -e 's/\.elc/\.el/g'); do \
 	  if test -f "$$el" -o \! -f "$${el}c"; then :; else \