From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#31744: 26.1; Improvements to make tags and make -C test Date: Wed, 06 Jun 2018 21:49:47 -0400 Message-ID: <87muw72wn8.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1528336147 22220 195.159.176.226 (7 Jun 2018 01:49:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 7 Jun 2018 01:49:07 +0000 (UTC) To: 31744@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 07 03:49:03 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQk2w-0005fq-5p for geb-bug-gnu-emacs@m.gmane.org; Thu, 07 Jun 2018 03:49:02 +0200 Original-Received: from localhost ([::1]:55319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQk53-0002Wf-6R for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Jun 2018 21:51:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46229) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQk4v-0002SK-R1 for bug-gnu-emacs@gnu.org; Wed, 06 Jun 2018 21:51:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQk4s-0007yB-KY for bug-gnu-emacs@gnu.org; Wed, 06 Jun 2018 21:51:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:57612) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQk4s-0007xv-Eq for bug-gnu-emacs@gnu.org; Wed, 06 Jun 2018 21:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fQk4s-0003Is-96 for bug-gnu-emacs@gnu.org; Wed, 06 Jun 2018 21:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jun 2018 01:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 31744 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.152833620512632 (code B ref -1); Thu, 07 Jun 2018 01:51:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jun 2018 01:50:05 +0000 Original-Received: from localhost ([127.0.0.1]:37276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQk3w-0003Hf-U7 for submit@debbugs.gnu.org; Wed, 06 Jun 2018 21:50:05 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fQk3v-0003H8-5I for submit@debbugs.gnu.org; Wed, 06 Jun 2018 21:50:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQk3o-00072W-6z for submit@debbugs.gnu.org; Wed, 06 Jun 2018 21:49:58 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:40748) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fQk3o-00071q-1f for submit@debbugs.gnu.org; Wed, 06 Jun 2018 21:49:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQk3m-0001jd-6z for bug-gnu-emacs@gnu.org; Wed, 06 Jun 2018 21:49:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQk3j-0006xq-1p for bug-gnu-emacs@gnu.org; Wed, 06 Jun 2018 21:49:54 -0400 Original-Received: from mail-io0-x22d.google.com ([2607:f8b0:4001:c06::22d]:37957) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQk3i-0006xQ-N7 for bug-gnu-emacs@gnu.org; Wed, 06 Jun 2018 21:49:50 -0400 Original-Received: by mail-io0-x22d.google.com with SMTP id l19-v6so9949761ioj.5 for ; Wed, 06 Jun 2018 18:49:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=Apky4rRGocB8rpWj0Hn0J0YQl6NftdvaH8ZI7T8ymPk=; b=l9eXa1GZmQppL53rH28o4dPv3kLk4u4RIL1hGGYTAiUOTwXVC+qToJjXBRkEOAM1Zw QzXQ0+xlirHHNpUQBpx6CJjRyxsN4xb7giOIG2TBWn6XRJk5UM6qD+XTZykmyCBBRvEf xP1P9x6E4m/rZxGxVOA/WIvYhRYWe6THYb4mFXw4T5Tqs936F3PiT3RCrVweO2Mw80n6 sg3BGrbmHv+RhqhgCaHd9R4IxoM6FRvtIpRZGBnigvGcFmTYYmEdrO6sXxWzl52og2Kx KweMTz2d5JjBV2hY7pxMEE40fW8l74qu6TQn9qpqiua1BK5gzXjFysFGMdckH7+Cl943 MlrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=Apky4rRGocB8rpWj0Hn0J0YQl6NftdvaH8ZI7T8ymPk=; b=oiwi8VHyvHM2hu0F+lVQCp/nP35SYuIE5nuxB7IWLcj6mYRcEGemZMn4s9jr0eses/ H2Viq/v6ovJErxPNJE3lQjkr6WXcEhr/ESj9j+RSBgwwh3BwXu02Cl/zySOKAz3AmriH 8hqvXPTvgcHe2d9X5BRAsb8FZxyh21Egv0OIEnIRDYgzGxpJZuIissyhPo7+mUaKYYsL RdYq2CqgzTZ1tw+aHx4ytvxuoXnGG3BDtDfjhrtT5m7CbwdykPO3uVekMBW4bZBC+b/r gfS9SSaVVBwy+QCZHuXRN1YN8rpkZwTNFmHLNkGD0h5QLYCAXjcmYBo9yAFeSQ7IJGcR 9dUQ== X-Gm-Message-State: APt69E3VFGZ70DbakNa+yK2r4FO/TeYH1rf6evOJeBsRiGnMLrvuLICe AxUquCDsTvjVRwxeWItAPntbDA== X-Google-Smtp-Source: ADUXVKKD5SpbSALUeTu+vqZ6v1Xri2YRQnsFvHzl2T3AFuYyJ6NqaG9+11Ec/f3MIy8BRdTIY6kG8w== X-Received: by 2002:a6b:9dc3:: with SMTP id g186-v6mr5033132ioe.205.1528336189700; Wed, 06 Jun 2018 18:49:49 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id k139-v6sm242914itk.27.2018.06.06.18.49.48 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Jun 2018 18:49:48 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:147118 Archived-At: --=-=-= Content-Type: text/plain Severity: wishlist Tags: patch Some quality-of-life improvements in make targets. I hope these can go to emacs-26; although the test/Makefile.in changes aren't bug fixes, that file isn't distributed in the tarball. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Make-tags-targets-quieter-in-with-silent-rules-modes.patch Content-Description: patch >From 511a31788d63bdc7ee6dc877e1690dd79ad89c6d Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 7 Dec 2017 04:31:47 -0500 Subject: [PATCH 1/4] Make 'tags' targets quieter in --with-silent-rules modes * lisp/Makefile.in (TAGS): * src/Makefile.in (TAGS): Use AM_V_GEN and AM_V_at. --- lisp/Makefile.in | 6 +++--- src/Makefile.in | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/Makefile.in b/lisp/Makefile.in index d4709bd79d..05fca9579f 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -259,9 +259,9 @@ ${ETAGS}: ## compile-main. But maybe this is not even necessary any more now ## that this uses relative filenames. TAGS: ${ETAGS} ${tagsfiles} - rm -f $@ - touch $@ - ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@ + $(AM_V_at)rm -f $@ + $(AM_V_at)touch $@ + $(AM_V_GEN)ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@ # The src/Makefile.in has its own set of dependencies and when they decide diff --git a/src/Makefile.in b/src/Makefile.in index 15ca1667d6..d914dfebbd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -680,7 +680,7 @@ ctagsfiles2 = ## because etags "--include" only includes a pointer to the file, ## rather than the file contents. TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2) - ${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \ + $(AM_V_GEN)${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \ --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \ --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \ $(ctagsfiles1) \ -- 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0002-Make-TAGS-file-in-the-srcdir-for-out-of-tree-builds.patch Content-Description: patch >From 83bc64364d21712865913ca5b4627c3ea8ec0071 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 13 Dec 2017 21:12:21 -0500 Subject: [PATCH 2/4] Make TAGS file in the srcdir for out-of-tree builds * Makefile.in: * lisp/Makefile.in: * lwlib/Makefile.in: * src/Makefile.in: Create TAGS files in ${srcdir}, not build dir. --- Makefile.in | 2 +- lisp/Makefile.in | 2 +- lwlib/Makefile.in | 6 +++--- src/Makefile.in | 18 ++++++++++-------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Makefile.in b/Makefile.in index 238df40ded..8a0a505320 100644 --- a/Makefile.in +++ b/Makefile.in @@ -929,7 +929,7 @@ extraclean: $(extraclean_dirs: # The src subdir knows how to do the right thing # even when the build directory and source dir are different. .PHONY: TAGS tags -TAGS tags: lib lib-src src +${srcdir}/TAGS tags: lib lib-src src $(MAKE) -C src tags .PHONY: have-tests diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 05fca9579f..373ce60d12 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -258,7 +258,7 @@ ${ETAGS}: ## etags. It might be better to use find in a similar way to ## compile-main. But maybe this is not even necessary any more now ## that this uses relative filenames. -TAGS: ${ETAGS} ${tagsfiles} +${srcdir}/TAGS: ${ETAGS} ${tagsfiles} $(AM_V_at)rm -f $@ $(AM_V_at)touch $@ $(AM_V_GEN)ls ${tagsfiles} | xargs $(XARGS_LIMIT) "${ETAGS}" -a -o $@ diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index 32d7a91f9b..1cb35337c9 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in @@ -129,8 +129,8 @@ ctagsfiles= FORCE: .PHONY: tags FORCE -tags: TAGS -TAGS: ${ETAGS} $(ctagsfiles) - ${ETAGS} $(ctagsfiles) +tags: ${srcdir}/TAGS +${srcdir}/TAGS: ${ETAGS} $(ctagsfiles) + $(AM_V_GEN)${ETAGS} -o $@ $(ctagsfiles) ### Makefile.in ends here diff --git a/src/Makefile.in b/src/Makefile.in index d914dfebbd..cb4f8ae6c6 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -674,13 +674,15 @@ ${ETAGS}: ctagsfiles1 = $(wildcard ${srcdir}/*.[hc]) ctagsfiles2 = $(wildcard ${srcdir}/*.m) -## FIXME? In out-of-tree builds, should TAGS be generated in srcdir? +## In out-of-tree builds, TAGS should be generated in srcdir. ## This does not need to depend on ../lisp and ../lwlib TAGS files, ## because etags "--include" only includes a pointer to the file, -## rather than the file contents. -TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2) - $(AM_V_GEN)${ETAGS} --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \ +## rather than the file contents. The "--include" reference is +## relative to the location of the generated TAGS file, so it doesn't +## need to use ${srcdir}. +${srcdir}/TAGS: ${ETAGS} $(ctagsfiles1) $(ctagsfiles2) + $(AM_V_GEN)${ETAGS} -o $@ --include=../lisp/TAGS --include=$(lwlibdir)/TAGS \ --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/\1/' \ --regex='{c}/[ ]*DEFVAR_[A-Z_ (]+"[^"]+",[ ]\([A-Za-z0-9_]+\)/\1/' \ $(ctagsfiles1) \ @@ -690,13 +692,13 @@ TAGS: ## Arrange to make tags tables for ../lisp and ../lwlib, ## which the above TAGS file for the C files includes by reference. -../lisp/TAGS: FORCE - $(MAKE) -C ../lisp TAGS ETAGS="$(ETAGS)" +${srcdir}/../lisp/TAGS: FORCE + $(MAKE) -C ../lisp ${top_srcdir}/lisp/TAGS ETAGS="$(ETAGS)" -$(lwlibdir)/TAGS: FORCE +${srcdir}/$(lwlibdir)/TAGS: FORCE $(MAKE) -C $(lwlibdir) TAGS ETAGS="$(ETAGS)" -tags: TAGS ../lisp/TAGS $(lwlibdir)/TAGS +tags: ${srcdir}/TAGS ${srcdir}/../lisp/TAGS ${srcdir}/$(lwlibdir)/TAGS .PHONY: tags -- 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0003-test-Makefile.in-Add-TEST_INTERACTIVE-option.patch Content-Description: patch >From 02d9d15d5ead3a4f6e1451e3f2cc2d6e49cafa24 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sat, 16 Dec 2017 20:06:11 -0500 Subject: [PATCH 3/4] ; test/Makefile.in: Add TEST_INTERACTIVE option. --- test/Makefile.in | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index e6b3f77523..8c5c3a38d0 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -81,7 +81,7 @@ EMACS_EXTRAOPT= # Command line flags for Emacs. # Apparently MSYS bash would convert "-L :" to "-L ;" anyway, # but we might as well be explicit. -EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT) +EMACSOPT = --no-init-file --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)" $(EMACS_EXTRAOPT) # Prevent any settings in the user environment causing problems. unexport EMACSDATA EMACSDOC EMACSPATH GREP_OPTIONS @@ -94,6 +94,15 @@ GDB = # supported everywhere. TEST_LOCALE = C +# Set this to 'yes' to run the tests in an interactive instance. +TEST_INTERACTIVE ?= no + +ifeq ($(TEST_INTERACTIVE),yes) +TEST_RUN_ERT = --eval "(ert ${SELECTOR_ACTUAL})" +else +TEST_RUN_ERT = --batch --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG} +endif + # Whether to run tests from .el files in preference to .elc, we do # this by default since it gives nicer stacktraces. TEST_LOAD_EL ?= yes @@ -128,7 +137,7 @@ all: SELECTOR_DEFAULT = (quote (not (or (tag :expensive-test) (tag :unstable)))) SELECTOR_EXPENSIVE = (quote (not (tag :unstable))) -SELECTOR_ALL = nil +SELECTOR_ALL = t ifdef SELECTOR SELECTOR_ACTUAL=$(SELECTOR) else ifndef MAKECMDGOALS @@ -145,7 +154,7 @@ SELECTOR_ACTUAL= ## Byte-compile all test files to test for errors. %.elc: %.el - $(AM_V_ELC)$(emacs) -f batch-byte-compile $< + $(AM_V_ELC)$(emacs) --batch -f batch-byte-compile $< ## Save logs, and show logs for failed tests. WRITE_LOG = > $@ 2>&1 || { STAT=$$?; cat $@; exit $$STAT; } @@ -160,7 +169,7 @@ testloadfile = $(AM_V_at)${MKDIR_P} $(dir $@) $(AM_V_GEN)HOME=/nonexistent $(emacs) \ -l ert ${ert_opts} -l $(testloadfile) \ - --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG} + $(TEST_RUN_ERT) ifeq (@HAVE_MODULES@, yes) maybe_exclude_module_tests := @@ -260,8 +269,15 @@ .PHONY: ## We can't put LOGFILES as prerequisites, because that would stop the ## summarizing step from running when there is an error. check-doit: +ifeq ($(TEST_INTERACTIVE), yes) + HOME=/nonexistent $(emacs) \ + -l ert ${ert_opts} \ + $(patsubst %,-l %,$(if $(findstring $(TEST_LOAD_EL),yes),$ELFILES,$(ELFILES:.el=))) \ + $(TEST_RUN_ERT) +else -@${MAKE} -k ${LOGFILES} - @$(emacs) -l ert -f ert-summarize-tests-batch-and-exit ${LOGFILES} + @$(emacs) --batch -l ert -f ert-summarize-tests-batch-and-exit ${LOGFILES} +endif .PHONY: mostlyclean clean bootstrap-clean distclean maintainer-clean -- 2.11.0 --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0004-Reduce-amount-of-quoting-for-SELECTOR-arg-in-make-C-.patch Content-Description: patch >From 9f84e96771d755f06c5e1c6dc0eb5dc85272991d Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Wed, 6 Jun 2018 21:25:52 -0400 Subject: [PATCH 4/4] ; Reduce amount of quoting for SELECTOR arg in 'make -C test' Before: make -C test SELECTOR='\"foo\"' make -C test SELECTOR='(quote (tag :some-tag))' After: make -C test SELECTOR='"foo"' make -C test SELECTOR='(tag :some-tag)' * test/Makefile.in: Use single quotes around the command line call to ert, this means the user doesn't have to backslash escape double quotes when writing lisp strings for the selector. Also wrap the SELECTOR value in (quote ...) so the user won't have to type it in (and not get tempted to use the '... form which would now fail to work due to using single quotes around the whole shell arg). --- test/Makefile.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Makefile.in b/test/Makefile.in index 8c5c3a38d0..bc4140879d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -98,9 +98,9 @@ TEST_LOCALE = TEST_INTERACTIVE ?= no ifeq ($(TEST_INTERACTIVE),yes) -TEST_RUN_ERT = --eval "(ert ${SELECTOR_ACTUAL})" +TEST_RUN_ERT = --eval '(ert (quote ${SELECTOR_ACTUAL}))' else -TEST_RUN_ERT = --batch --eval "(ert-run-tests-batch-and-exit ${SELECTOR_ACTUAL})" ${WRITE_LOG} +TEST_RUN_ERT = --batch --eval '(ert-run-tests-batch-and-exit (quote ${SELECTOR_ACTUAL}))' ${WRITE_LOG} endif # Whether to run tests from .el files in preference to .elc, we do @@ -135,8 +135,8 @@ .PHONY: all: check -SELECTOR_DEFAULT = (quote (not (or (tag :expensive-test) (tag :unstable)))) -SELECTOR_EXPENSIVE = (quote (not (tag :unstable))) +SELECTOR_DEFAULT = (not (or (tag :expensive-test) (tag :unstable))) +SELECTOR_EXPENSIVE = (not (tag :unstable)) SELECTOR_ALL = t ifdef SELECTOR SELECTOR_ACTUAL=$(SELECTOR) -- 2.11.0 --=-=-=--