aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGlenn Morris2013-11-04 21:58:40 -0500
committerGlenn Morris2013-11-04 21:58:40 -0500
commit2d748773b27daf6a8462705f382aa48942e3c883 (patch)
treec12e47a047a46189eec9ee9c0f4f9b9cf85d4a95 /test
parentd511238048873be2947be33485072357ca3a7fe7 (diff)
downloademacs-2d748773b27daf6a8462705f382aa48942e3c883.tar.gz
emacs-2d748773b27daf6a8462705f382aa48942e3c883.zip
Get rid of --chdir usage in test/automated
* test/automated/Makefile.in (EMACSOPT): Move -L here. (emacs): Set EMACS_TEST_DIRECTORY in the environment. (setwins): Don't assume called from srcdir. Remove legacy stuff. (.el.elc): No more need to pass -L here. (compile-main): Get rid of sub-shell and cd. (compile-clean, check): Get rid of cd.
Diffstat (limited to 'test')
-rw-r--r--test/ChangeLog8
-rw-r--r--test/automated/Makefile.in22
2 files changed, 19 insertions, 11 deletions
diff --git a/test/ChangeLog b/test/ChangeLog
index 43ba409ae0e..53e1af20567 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,5 +1,13 @@
12013-11-05 Glenn Morris <rgm@gnu.org> 12013-11-05 Glenn Morris <rgm@gnu.org>
2 2
3 Get rid of --chdir usage.
4 * automated/Makefile.in (EMACSOPT): Move -L here.
5 (emacs): Set EMACS_TEST_DIRECTORY in the environment.
6 (setwins): Don't assume called from srcdir. Remove legacy stuff.
7 (.el.elc): No more need to pass -L here.
8 (compile-main): Get rid of sub-shell and cd.
9 (compile-clean, check): Get rid of cd.
10
3 Make it possible to run tests with a different working directory. 11 Make it possible to run tests with a different working directory.
4 * automated/flymake-tests.el (flymake-tests-data-directory): New. 12 * automated/flymake-tests.el (flymake-tests-data-directory): New.
5 (flymake-tests--current-face): Use flymake-tests-data-directory. 13 (flymake-tests--current-face): Use flymake-tests-data-directory.
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in
index e03ebbbf82d..63cffd9f828 100644
--- a/test/automated/Makefile.in
+++ b/test/automated/Makefile.in
@@ -28,19 +28,20 @@ VPATH = $(srcdir)
28EMACS = ../../src/emacs 28EMACS = ../../src/emacs
29 29
30# Command line flags for Emacs. 30# Command line flags for Emacs.
31EMACSOPT = -batch --no-site-file --no-site-lisp 31EMACSOPT = -batch --no-site-file --no-site-lisp -L :$(srcdir)
32 32
33# Extra flags to pass to the byte compiler. 33# Extra flags to pass to the byte compiler.
34BYTE_COMPILE_EXTRA_FLAGS = 34BYTE_COMPILE_EXTRA_FLAGS =
35 35
36# The actual Emacs command run in the targets below. 36# The actual Emacs command run in the targets below.
37# Prevent any setting of EMACSLOADPATH in user environment causing problems. 37# Prevent any setting of EMACSLOADPATH in user environment causing problems.
38emacs = unset EMACSLOADPATH; LC_ALL=C "$(EMACS)" $(EMACSOPT) 38emacs = unset EMACSLOADPATH; \
39 LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
39 40
40# Common command to find subdirectories 41# Common command to find subdirectories
41setwins=subdirs=`find . -type d -print`; \ 42setwins=subdirs=`find $(srcdir) -type d -print`; \
42 for file in $$subdirs; do \ 43 for file in $$subdirs; do \
43 case $$file in */.* | */.*/* | */=* | ./data* ) ;; \ 44 case $$file in */data* | */flymake* ) ;; \
44 *) wins="$$wins$${wins:+ }$$file" ;; \ 45 *) wins="$$wins$${wins:+ }$$file" ;; \
45 esac; \ 46 esac; \
46 done 47 done
@@ -55,7 +56,7 @@ all: check
55 56
56.el.elc: 57.el.elc:
57 @echo Compiling $< 58 @echo Compiling $<
58 @$(emacs) -L :$(srcdir) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $< 59 @$(emacs) $(BYTE_COMPILE_EXTRA_FLAGS) -f batch-byte-compile $<
59 60
60 61
61.PHONY: compile-targets compile-main compile-clean 62.PHONY: compile-targets compile-main compile-clean
@@ -66,20 +67,20 @@ compile-targets: $(TARGETS)
66# Compile all the Elisp files that need it. Beware: it approximates 67# Compile all the Elisp files that need it. Beware: it approximates
67# `no-byte-compile', so watch out for false-positives! 68# `no-byte-compile', so watch out for false-positives!
68compile-main: compile-clean 69compile-main: compile-clean
69 @(cd $(srcdir) && $(setwins); \ 70 @$(setwins); \
70 els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ 71 els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
71 for el in $$els; do \ 72 for el in $$els; do \
72 test -f $$el || continue; \ 73 test -f $$el || continue; \
73 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \ 74 test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
74 echo "$${el}c"; \ 75 echo "$${el}c"; \
75 done | xargs echo) | \ 76 done | xargs echo | \
76 while read chunk; do \ 77 while read chunk; do \
77 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \ 78 $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
78 done 79 done
79 80
80# Erase left-over .elc files that do not have a corresponding .el file. 81# Erase left-over .elc files that do not have a corresponding .el file.
81compile-clean: 82compile-clean:
82 @cd $(srcdir) && $(setwins); \ 83 @$(setwins); \
83 elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \ 84 elcs=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.elc |g'`; \
84 for el in $$(echo $$elcs | sed -e 's/\.elc/\.el/g'); do \ 85 for el in $$(echo $$elcs | sed -e 's/\.elc/\.el/g'); do \
85 if test -f "$$el" -o \! -f "$${el}c"; then :; else \ 86 if test -f "$$el" -o \! -f "$${el}c"; then :; else \
@@ -101,7 +102,7 @@ maintainer-clean: distclean bootstrap-clean
101 102
102 103
103check: compile-main 104check: compile-main
104 @thisdir=`pwd`; cd $(srcdir) && $(setwins); \ 105 @$(setwins); \
105 pattern=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \ 106 pattern=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
106 for el in $$pattern; do \ 107 for el in $$pattern; do \
107 test -f $$el || continue; \ 108 test -f $$el || continue; \
@@ -109,7 +110,6 @@ check: compile-main
109 els="$$els $$el"; \ 110 els="$$els $$el"; \
110 done; \ 111 done; \
111 echo Testing $$els; \ 112 echo Testing $$els; \
112 cd "$$thisdir"; \ 113 $(emacs) $$args -f ert-run-tests-batch-and-exit
113 $(emacs) --chdir $(srcdir) -L :. $$args -f ert-run-tests-batch-and-exit
114 114
115# Makefile ends here. 115# Makefile ends here.