[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [PATCH 06/11] [ng] check: minor refactoring (prefer make t
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [PATCH 06/11] [ng] check: minor refactoring (prefer make time over recipe time) |
Date: |
Wed, 9 May 2012 11:30:11 +0200 |
No semantic change intended.
* lib/am/check2.am [%?FIRST%] (am__is_xfail_test): New internal helper
function.
(am__runtest): Use that, the $(if) built-in, and a minor reorganization
to shave off few lines of code, and to favor processing by make over
processing by the shell.
Signed-off-by: Stefano Lattarini <address@hidden>
---
lib/am/check2.am | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
diff --git a/lib/am/check2.am b/lib/am/check2.am
index b0f5b33..34fdd58 100644
--- a/lib/am/check2.am
+++ b/lib/am/check2.am
@@ -15,39 +15,32 @@
## along with this program. If not, see <http://www.gnu.org/licenses/>.
if %?FIRST%
+
+am__is_xfail_test = \
+ $(if $(filter-out $(am__xfail_test_bases), \
+ $(patsubst $(srcdir)/%,%,$(1))),no,yes)
am__runtest = \
$(am__sh_e_setup); \
$(am__tty_colors); \
srcdir=$(srcdir); export srcdir; \
## Creates the directory for the log if needed.
test x$(@D) = x. || test -d $(@D) || $(MKDIR_P) $(@D) || exit $$?; \
- f='$(patsubst $(srcdir)/%,%,$<)'; \
## We need to invoke the test in way that won't cause a PATH search.
## Quotes around '$<' are required to avoid extra errors when a circular
## dependency is detected (e.g., because $(TEST_SUITE_LOG) is in
## $(am__test_logs)), because in that case '$<' expands to empty and an
## unquote usage of it could cause syntax errors in the shell.
case '$<' in */*) tst='$<';; *) tst=./'$<';; esac; \
- if test -n '$(DISABLE_HARD_ERRORS)'; then \
- am__enable_hard_errors=no;
\
- else \
- am__enable_hard_errors=yes; \
- fi; \
- f2='$(patsubst $(srcdir)/%,%,$*)'; \
- case " $(am__xfail_test_bases) " in \
- *" $$f2 "*) am__expect_failure=yes;; \
- *) am__expect_failure=no;;
\
- esac; \
## Executes the developer-defined and user-defined test
## setups (if any), in that order.
$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) \
$($(1)LOG_DRIVER) \
- --test-name "$$f" \
+ --test-name '$(patsubst $(srcdir)/%,%,$<)' \
--log-file $*.log \
--trs-file $*.trs \
--color-tests "$$am__color_tests" \
- --enable-hard-errors "$$am__enable_hard_errors" \
- --expect-failure "$$am__expect_failure" \
+ --enable-hard-errors $(if $(DISABLE_HARD_ERRORS),no,yes) \
+ --expect-failure $(call am__is_xfail_test,$*)
\
$(AM_$(1)LOG_DRIVER_FLAGS) \
$($(1)LOG_DRIVER_FLAGS) \
-- \
@@ -56,6 +49,7 @@ am__runtest = \
$($(1)LOG_FLAGS) \
"$$tst" \
$(AM_TESTS_FD_REDIRECT)
+
endif %?FIRST%
## From a test file to a .log and .trs file.
--
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, 2012/05/09
- [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 <=
- [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
- Re: [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Akim Demaille, 2012/05/09
- Re: [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Stefano Lattarini, 2012/05/09
- Re: [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Akim Demaille, 2012/05/09
- Re: [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Stefano Lattarini, 2012/05/09
- Re: [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Bob Friesenhahn, 2012/05/09
- Re: [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Stefano Lattarini, 2012/05/10
- Re: [Automake-NG] [PATCH 00/11] Several changes to parallel-tests support, Bob Friesenhahn, 2012/05/10