[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [PATCH 03/11] [ng] check: refactoring to reduce code dupli
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [PATCH 03/11] [ng] check: refactoring to reduce code duplication |
Date: |
Wed, 9 May 2012 11:30:08 +0200 |
* lib/am/check.am (am__strip_suffixes): New internal function, factoring
the code used to "normalize" a list of test scripts (i.e., removing any
registered test extension and any leading $(srcdir) component).
(am__TEST_BASES, am__xfail_test_bases): Redefine using that function.
(am__cooked_tests, am__cooked_xfail_tests): Remove as obsolete.
* t/parallel-tests-empty-tests.sh: Don't bother checking the contents
of $(am__cooked_tests) anymore.
Signed-off-by: Stefano Lattarini <address@hidden>
---
lib/am/check.am | 32 +++++++++++++++-----------------
t/parallel-tests-empty-tests.sh | 3 +--
2 files changed, 16 insertions(+), 19 deletions(-)
diff --git a/lib/am/check.am b/lib/am/check.am
index ae40c00..2eee953 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -57,14 +57,19 @@ if %?PARALLEL_TESTS%
## of more test metadata, and the use of custom test derivers and protocols
## (among them, TAP).
-# Required to support explicit use of $(srcdir) in TESTS entries.
-# That might actually be very useful in practice, for example in usages
-# like this:
+# The names of the given tests scripts with any possible registered
+# test extension removed, as well as any leading '$(srcdir)' component
+# (if any) stripped.
+# The stripping of $(srcdir) is required to support explicit use of
+# $(srcdir) in TESTS entries. That might actually be very useful in
+# practice, for example in usages like this:
# TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh)
-# Removing the '$(srcdir)' in there would cause the idiom to break in
-# VPATH builds.
-am__cooked_tests = $(patsubst $(srcdir)/%,%,$(strip $(TESTS)))
-am__cooked_xfail_tests = $(patsubst $(srcdir)/%,%,$(strip $(XFAIL_TESTS)))
+# where removing the $(srcdir) from the $(wildcard) invocation would
+# cause the idiom to break in VPATH builds.
+am__get_test_bases = $(patsubst $(srcdir)/%,%,$(strip \
+$(call am__strip_suffixes, $(TEST_EXTENSIONS), \
+?!HANDLE-EXEEXT? $(1))))
+?HANDLE-EXEEXT? $(patsubst %$(EXEEXT),%,$(1)))))
am__recheck_rx = ^[ ]*:recheck:[ ]*
am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
@@ -230,16 +235,9 @@ case " $(am__xfail_test_bases) " in
\
esac; \
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
-# The names of the tests scripts with any registered extension removed
-# This honors runtime overriding of TESTS, and takes into account
-# $(EXEEXT) appending.
-am__TEST_BASES = $(call am__strip_suffixes, $(TEST_EXTENSIONS), \
-?!HANDLE-EXEEXT?$(am__cooked_tests))
-?HANDLE-EXEEXT?$(patsubst %$(EXEEXT),%,$(am__cooked_tests)))
-# Likewise for the xfailing tests.
-am__xfail_test_bases = $(call am__strip_suffixes, $(TEST_EXTENSIONS), \
-?!HANDLE-EXEEXT?$(am__cooked_xfail_tests))
-?HANDLE-EXEEXT?$(patsubst %$(EXEEXT),%,$(am__cooked_xfail_tests)))
+# This supports runtime overriding of $(TESTS) and $(XFAIL_TESTS).
+am__TEST_BASES = $(call am__get_test_bases, $(TESTS))
+am__xfail_test_bases = $(call am__get_test_bases, $(XFAIL_TESTS))
# The $(strip) is to work around the GNU make 3.80 bug where trailing
# whitespace in "TESTS = foo.test $(empty)" causes $(TESTS_LOGS) to
diff --git a/t/parallel-tests-empty-tests.sh b/t/parallel-tests-empty-tests.sh
index 018cce0..163b72f 100755
--- a/t/parallel-tests-empty-tests.sh
+++ b/t/parallel-tests-empty-tests.sh
@@ -33,8 +33,7 @@ mkdir sub1 sub2
cat > sub1/Makefile.am << 'END'
TESTS =
check-local:
- echo $(am__cooked_tests) $(am__TEST_LOGS) \
- $(am__TEST_RESULTS) $(am__TEST_BASES) \
+ echo $(am__TEST_LOGS) $(am__TEST_RESULTS) $(am__TEST_BASES) \
| grep . && exit 1; exit 0
END
--
1.7.9.5
- [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 03/11] [ng] check: refactoring to reduce code duplication,
Stefano Lattarini <=
- [Automake-NG] [PATCH 04/11] [ng] check: refactor (better names for internal vars), Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 05/11] [ng] check: minor refactoring (reorder code), Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 02/11] [ng] refactor: get rid of am__EXEEXT (automake conditional and %transform), Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 01/11] [ng] check: big refactoring with semantic changes in parallel-tests support, Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 08/11] [ng] check: AM_LAZY_CHECK="yes", not RECHECK_TESTS="", for lazy re-runs, Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 07/11] [ng] check: refactor: split recipes for check-TESTS and recheck, Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 06/11] [ng] check: minor refactoring (prefer make time over recipe time), Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 11/11] [ng] check: per-suffix dependencies for test cases, Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 10/11] [ng] check: few minor simplifications, Stefano Lattarini, 2012/05/09
- [Automake-NG] [PATCH 09/11] [ng] tests: remove overly picky test cases (and fix few typos), Stefano Lattarini, 2012/05/09