summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-09-02 21:55:04 +0200
committerJim Meyering <meyering@redhat.com>2012-09-05 08:48:28 +0200
commit50dfe1f389ac2f1c8ae0327aa5a7b8df0a52c53e (patch)
treedb49242372d79bf8d4b58777e0a75de18c1951a9
parentcd97af8ee09282075d282ca101f04aa4530440f5 (diff)
downloadcoreutils-50dfe1f389ac2f1c8ae0327aa5a7b8df0a52c53e.tar.gz
maint: avoid parsing of Makefile.am from vc_exe_in_TESTS
* tests/Makefile.am (TESTS): Rename ... (all_tests): ... like this, so that we'll still be able to know the complete list of our tests even if the user overrides TESTS from the command line (which he's allowed to do by the test harness API). (root_tests): Rename ... (all_root_tests): ... like this, for similar reasons. (TESTS, root_tests): Redefine their defaults to to $(all_tests) and $(all_root_tests) respectively. (vc_exe_in_TESTS): It can now safely use $(all_tests) to get the complete list of test cases according to the Makefile, instead of having to resort to "parsing" of Makefile.am. (EXTRA_DIST): Use $(all_tests), not $(TESTS). (v_, w_): Delete, no longer needed.
-rw-r--r--tests/Makefile.am26
1 files changed, 13 insertions, 13 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 34e8c6c81..ce035a37d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,18 +15,18 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Ensure that all version-controlled executable files are listed in TESTS.
-# Collect test names from the line matching /^TESTS = \\$$/ to the following
-# one that does not end in '\'.
-_v = TESTS
-_w = root_tests
+# Indirections required so that we'll still be able to know the
+# complete list of our tests even if the user override TESTS from the
+# command line (which he's allowed to do by the test harness API).
+TESTS = $(all_tests)
+root_tests = $(all_root_tests)
+
+# Ensure that all version-controlled executable files are listed
+# in $(all_tests).
vc_exe_in_TESTS: Makefile
$(AM_V_GEN)if test -d $(top_srcdir)/.git && test $(srcdir) = .; then \
{ \
- for list in $(_v) $(_w); do \
- sed -n "/^$$list =[ ]*\\\\$$/,/[^\]$$/p" Makefile.am | \
- sed -n 's/^ *\([^$$ ]\{1,\}\).*/\1/p'; \
- done; \
+ for t in $(all_tests); do echo $$t; done; \
for f in `cd $(top_srcdir) && \
build-aux/vc-list-files $(subdir) | sed 's!^$(subdir)/!!'`; do \
test -f "$$f" && test -x "$$f" && echo "$$f"; \
@@ -128,7 +128,7 @@ EXTRA_DIST = \
sample-test \
$(pr_data)
-root_tests = \
+all_root_tests = \
chown/basic.sh \
cp/cp-a-selinux.sh \
cp/preserve-gid.sh \
@@ -170,7 +170,7 @@ root-hint:
@echo " See the 'Running tests as root' section in README."
@echo '***********************************************************'
-EXTRA_DIST += $(TESTS)
+EXTRA_DIST += $(all_tests)
# Do not choose a name that is a shell keyword like 'if', or a
# commonly-used utility like 'cat' or 'test', as the name of a test.
@@ -188,7 +188,7 @@ EXTRA_DIST += $(TESTS)
# they share time with tests that burn CPU, not with others that sleep.
# Put head-elide-tail early, because it's long-running.
-TESTS = \
+all_tests = \
misc/help-version.sh \
tail-2/inotify-race.sh \
misc/invalid-opt.pl \
@@ -656,7 +656,7 @@ TESTS = \
touch/read-only.sh \
touch/relative.sh \
touch/trailing-slash.sh \
- $(root_tests)
+ $(all_root_tests)
pr_data = \
pr/0F \