From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry OReilly Newsgroups: gmane.emacs.devel Subject: [PATCH] Re: running each test file independently in test/automated Date: Sun, 15 Sep 2013 16:04:45 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c353ac5dd5c804e6719994 X-Trace: ger.gmane.org 1379275493 29314 80.91.229.3 (15 Sep 2013 20:04:53 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Sep 2013 20:04:53 +0000 (UTC) To: handa@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Sep 15 22:04:58 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VLIYy-0001Sf-E0 for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2013 22:04:56 +0200 Original-Received: from localhost ([::1]:57838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLIYx-000248-LJ for ged-emacs-devel@m.gmane.org; Sun, 15 Sep 2013 16:04:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLIYt-00020D-Aa for emacs-devel@gnu.org; Sun, 15 Sep 2013 16:04:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VLIYr-0001xQ-St for emacs-devel@gnu.org; Sun, 15 Sep 2013 16:04:51 -0400 Original-Received: from mail-wi0-x22b.google.com ([2a00:1450:400c:c05::22b]:47203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VLIYp-0001wK-B8; Sun, 15 Sep 2013 16:04:47 -0400 Original-Received: by mail-wi0-f171.google.com with SMTP id hm2so2626563wib.10 for ; Sun, 15 Sep 2013 13:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=f+sAUpcwDDUR3hsMRFXyQChj1awJDlRADRCZHZPX/0w=; b=XEIux7eTpRGnxHINOHXmyXurqGWIps2btcMmO/lC/MUdIlfKnqUoA29DR9PuDJR54C tv0nWGHKj2lmbzTJ+Ucoe/29af2ts/d4RqTzFMZrE1Mu0BdL1dNcBzvVQkFSXt/RiIvH 5sY8pWoI4+j06ftDo+apQpYQFemHjwFpA+wptUCdGp1zsqAr7cO72I6x3i9sEF+WNuXz NLr3UaR1tpPmGtfNZ8AwDITrhjWy2O7MDI8sdXNFSPx3Lzb7Y5JT+c6btAlrVzygj5iF xWT6c0mLUK2KWTcG1z+wJHonInJd3TKnUB+Z/y9IW30i/PCFvobYws0okhYfr6DiHYK9 Ll4g== X-Received: by 10.180.183.108 with SMTP id el12mr10336020wic.55.1379275485597; Sun, 15 Sep 2013 13:04:45 -0700 (PDT) Original-Received: by 10.194.234.234 with HTTP; Sun, 15 Sep 2013 13:04:45 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163362 Archived-At: --001a11c353ac5dd5c804e6719994 Content-Type: text/plain; charset=ISO-8859-1 >>> 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"; \ --001a11c353ac5dd5c804e6719994 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
>>> 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/m= sg00339.html
>>
>> is supposed to allow this. I don't know if it is w= aiting on
>> something.

> Yes indeed, it provides a way = to run individual tests:
>
>=A0=A0 $ rm cl-lib.log ; make cl-li= b.log
>=A0=A0 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 per= taining to the .log make targets.

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

I'll plan to rename the Makefile to GNUm= akefile 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-old= xmenu
=A0src/stamp-h.in
=A0src/tema= cs
=A0test/indent/*.new
+test/automated/**/*.log
=A0+*
=A0src/globals= .h
=A0src/gl-stamp
diff --git a/test/automated/Makefile.in b/test/aut= omated/Makefile.in
index bf8e62f..3005d5e 100644
--- a/test/automated= /Makefile.in
+++ b/test/automated/Makefile.in
@@ -49,12 +49,16 @@ BYTE_COMPILE_EXTRA_= FLAGS =3D
=A0emacs =3D EMACSLOADPATH=3D$(lispsrc):$(test) LC_ALL=3DC $(E= MACS) $(EMACSOPT)
=A0
=A0# Common command to find subdirectories
-= setwins=3Dsubdirs=3D`find . -type d -print`; \
+getwins=3Dsubdirs=3D`find . -type d -print`; \
=A0=A0=A0 =A0for file in= $$subdirs; do \
=A0=A0=A0 =A0=A0=A0 case $$file in */.* | */.*/* | */= =3D* | ./data* ) ;; \
=A0=A0=A0 =A0=A0=A0 =A0*) wins=3D"$$wins$${wi= ns:+ }$$file" ;; \
=A0=A0=A0 =A0=A0=A0 esac; \
-=A0=A0=A0=A0=A0=A0=A0 done
+=A0=A0=A0=A0=A0=A0=A0 done; \
+=A0=A0 = =A0echo "$$wins" | sed -e 's|/\./|/|g' -e 's|/\. | |g= '
+
+TEST_EL_FILES=3D$(wildcard $(patsubst %,%/*.el,$(shell $(get= wins))))
+TEST_ELC_FILES=3D$(wildcard $(patsubst %,%/*.elc,$(shell $(get= wins))))
=A0
=A0all: check
=A0
@@ -68,7 +72,7 @@ doit:
=A0# subdirectori= es, to make sure require's and load's in the files being
=A0# co= mpiled find the right files.
=A0
-.SUFFIXES: .elc .el
+.SUFFIXES: = .elc .el .log
=A0
=A0# An old-fashioned suffix rule, which, according to the GNU Make = manual,
=A0# cannot have prerequisites.
@@ -98,9 +102,8 @@ compile-ta= rgets: $(TARGETS)
=A0# Compile all the Elisp files that need it.=A0 Bewa= re: it approximates
=A0# `no-byte-compile', so watch out for false-positives!
=A0compile= -main: compile-clean lisp-compile
-=A0=A0 =A0@(cd $(test); $(setwins); \=
-=A0=A0 =A0els=3D`echo "$$wins " | sed -e 's|/\./|/|g'= ; -e 's|/\. | |g' -e 's| |/*.el |g'`; \
-=A0=A0 =A0for el in $$els; do \
+=A0=A0 =A0@(cd $(test); \
+=A0=A0 = =A0for el in $(TEST_EL_FILES); do \
=A0=A0=A0 =A0=A0 test -f $$el || con= tinue; \
=A0=A0=A0 =A0=A0 test ! -f $${el}c && GREP_OPTIONS=3D g= rep '^;.*no-byte-compile: t' $$el > /dev/null && continu= e; \
=A0=A0=A0 =A0=A0 echo "$${el}c"; \
@@ -112,9 +115,8 @@ compile= -main: compile-clean lisp-compile
=A0.PHONY: compile-clean
=A0# Erase= left-over .elc files that do not have a corresponding .el file.
=A0comp= ile-clean:
-=A0=A0 =A0@cd $(test); $(setwins); \
-=A0=A0 =A0elcs=3D`echo "$$wi= ns " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| = |/*.elc |g'`; \
-=A0=A0 =A0for el in $$(echo $$elcs | sed -e 's/= \.elc/\.el/g'); do \
+=A0=A0 =A0@cd $(test); \
+=A0=A0 =A0for el in $(patsubst %.elc,%.el,$(T= EST_ELC_FILES)); do \
=A0=A0=A0 =A0=A0 if test -f "$$el" -o \!= -f "$${el}c"; then :; else \
=A0=A0=A0 =A0=A0=A0=A0 echo rm &= quot;$${el}c"; \
=A0=A0=A0 =A0=A0=A0=A0 rm "$${el}c"; \ @@ -145,10 +147,18 @@ distclean:
=A0
=A0maintainer-clean: distclean b= ootstrap-clean
=A0
+TEST_LOGS=3D$(patsubst %.el,%.log,$(TEST_EL_FILES= ))
+$(TEST_LOGS): lisp-compile
+$(TEST_LOGS): %.log : %.elc
+=A0= =A0 =A0@(cd $(test); \
+=A0=A0 =A0el=3D$(patsubst %.log,%.el,$@) ;\
+=A0=A0 =A0test -f $$el || = continue; \
+=A0=A0 =A0echo Testing $$el; \
+=A0=A0 =A0$(emacs) -l $$= el -f ert-run-tests-batch-and-exit 2>&1 | tee $@)
+
=A0check: = compile-main
-=A0=A0 =A0@(cd $(test); $(setwins); \
-=A0=A0 =A0pattern=3D`echo "$$wins " | sed -e 's|/\./|/|g'= ; -e 's|/\. | |g' -e 's| |/*.el |g'`; \
-=A0=A0 =A0for e= l in $$pattern; do \
+=A0=A0 =A0@(cd $(test); \
+=A0=A0 =A0for el in = $(TEST_EL_FILES); do \
=A0=A0=A0 =A0=A0 test -f $$el || continue; \
=A0=A0=A0 =A0=A0 args=3D&qu= ot;$$args -l $$el"; \
=A0=A0=A0 =A0=A0 els=3D"$$els $$el"= ; \

--001a11c353ac5dd5c804e6719994--