all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] Re: running each test file independently in test/automated
@ 2013-09-15 20:04 Barry OReilly
  2013-09-16 12:26 ` Kenichi Handa
  0 siblings, 1 reply; 7+ messages in thread
From: Barry OReilly @ 2013-09-15 20:04 UTC (permalink / raw)
  To: handa, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 3993 bytes --]

>>> Hi, I've found I want to run only one or a few of the tests at a
>>> time rather than the whole suite.

>> http://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00339.html
>>
>> is supposed to allow this. I don't know if it is waiting on
>> something.

> Yes indeed, it provides a way to run individual tests:
>
>   $ rm cl-lib.log ; make cl-lib.log
>   Running tests in cl-lib.el... passed all 8 tests
>
> Some comments on the patch follow.

I haven't heard from Kenichi, so I prepared a patch to implement the
subset of what he submitted pertaining to the .log make targets.

I also factored out some duplication in the compile-main,
compile-clean, and check targets.

I'll plan to rename the Makefile to GNUmakefile as Stefan requested in
the same commit, once the patch below is approved for install.

diff --git a/.bzrignore b/.bzrignore
index cd64f3f..be86add 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -174,6 +174,7 @@ src/stamp-oldxmenu
 src/stamp-h.in
 src/temacs
 test/indent/*.new
+test/automated/**/*.log
 +*
 src/globals.h
 src/gl-stamp
diff --git a/test/automated/Makefile.in b/test/automated/Makefile.in
index bf8e62f..3005d5e 100644
--- a/test/automated/Makefile.in
+++ b/test/automated/Makefile.in
@@ -49,12 +49,16 @@ BYTE_COMPILE_EXTRA_FLAGS =
 emacs = EMACSLOADPATH=$(lispsrc):$(test) LC_ALL=C $(EMACS) $(EMACSOPT)

 # Common command to find subdirectories
-setwins=subdirs=`find . -type d -print`; \
+getwins=subdirs=`find . -type d -print`; \
     for file in $$subdirs; do \
        case $$file in */.* | */.*/* | */=* | ./data* ) ;; \
         *) wins="$$wins$${wins:+ }$$file" ;; \
        esac; \
-        done
+        done; \
+    echo "$$wins" | sed -e 's|/\./|/|g' -e 's|/\. | |g'
+
+TEST_EL_FILES=$(wildcard $(patsubst %,%/*.el,$(shell $(getwins))))
+TEST_ELC_FILES=$(wildcard $(patsubst %,%/*.elc,$(shell $(getwins))))

 all: check

@@ -68,7 +72,7 @@ doit:
 # subdirectories, to make sure require's and load's in the files being
 # compiled find the right files.

-.SUFFIXES: .elc .el
+.SUFFIXES: .elc .el .log

 # An old-fashioned suffix rule, which, according to the GNU Make manual,
 # cannot have prerequisites.
@@ -98,9 +102,8 @@ 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
-    @(cd $(test); $(setwins); \
-    els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's|
|/*.el |g'`; \
-    for el in $$els; do \
+    @(cd $(test); \
+    for el in $(TEST_EL_FILES); do \
       test -f $$el || continue; \
       test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t'
$$el > /dev/null && continue; \
       echo "$${el}c"; \
@@ -112,9 +115,8 @@ compile-main: compile-clean lisp-compile
 .PHONY: compile-clean
 # Erase left-over .elc files that do not have a corresponding .el file.
 compile-clean:
-    @cd $(test); $(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 \
+    @cd $(test); \
+    for el in $(patsubst %.elc,%.el,$(TEST_ELC_FILES)); do \
       if test -f "$$el" -o \! -f "$${el}c"; then :; else \
         echo rm "$${el}c"; \
         rm "$${el}c"; \
@@ -145,10 +147,18 @@ distclean:

 maintainer-clean: distclean bootstrap-clean

+TEST_LOGS=$(patsubst %.el,%.log,$(TEST_EL_FILES))
+$(TEST_LOGS): lisp-compile
+$(TEST_LOGS): %.log : %.elc
+    @(cd $(test); \
+    el=$(patsubst %.log,%.el,$@) ;\
+    test -f $$el || continue; \
+    echo Testing $$el; \
+    $(emacs) -l $$el -f ert-run-tests-batch-and-exit 2>&1 | tee $@)
+
 check: compile-main
-    @(cd $(test); $(setwins); \
-    pattern=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's|
|/*.el |g'`; \
-    for el in $$pattern; do \
+    @(cd $(test); \
+    for el in $(TEST_EL_FILES); do \
       test -f $$el || continue; \
       args="$$args -l $$el"; \
       els="$$els $$el"; \

[-- Attachment #2: Type: text/html, Size: 4859 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-09-19 21:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-15 20:04 [PATCH] Re: running each test file independently in test/automated Barry OReilly
2013-09-16 12:26 ` Kenichi Handa
2013-09-16 15:54   ` Barry OReilly
2013-09-17 13:00     ` Kenichi Handa
2013-09-17 13:47       ` Barry OReilly
2013-09-19 14:57         ` Kenichi Handa
2013-09-19 21:18   ` Glenn Morris

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.