[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 5bdc344 3/3: ; Reduce quoting for SELECTOR in 'ma
From: |
Noam Postavsky |
Subject: |
[Emacs-diffs] emacs-26 5bdc344 3/3: ; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744) |
Date: |
Tue, 12 Jun 2018 07:47:40 -0400 (EDT) |
branch: emacs-26
commit 5bdc344780faabbc91b7e55306b2071dffb44fa2
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>
; Reduce quoting for SELECTOR in 'make -C test' (Bug#31744)
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 '... reader syntax form which would
now fail to work due to using single quotes around the whole shell
arg).
* test/README: Update instructions accordingly.
---
test/Makefile.in | 8 ++++----
test/README | 5 ++++-
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/test/Makefile.in b/test/Makefile.in
index 451513a..597ef91 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -98,9 +98,9 @@ TEST_LOCALE = C
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
@@ -140,8 +140,8 @@ test_module_dir := $(srcdir)/data/emacs-module
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)
diff --git a/test/README b/test/README
index c1dde2e..e473248 100644
--- a/test/README
+++ b/test/README
@@ -42,7 +42,10 @@ except the tests tagged as expensive.
If your test file contains the tests "test-foo", "test2-foo" and
"test-foo-remote", and you want to run only the former two tests, you
-could use a selector regexp: "make <filename> SELECTOR='\"foo$$\"'".
+could use a selector regexp (note that the "$" needs to be doubled to
+protect against "make" variable expansion):
+
+ make <filename> SELECTOR='"foo$$"'
Note that although the test files are always compiled (unless they set
no-byte-compile), the source files will be run by default, to give