From: Stefano Lattarini Date: Fri, 27 Jul 2012 23:39:57 +0000 (+0200) Subject: [ng] check: refactor 'am.test-suite.handle-suffix' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e72e0312428321571c7041b33b5cdc31f844650;p=thirdparty%2Fautomake.git [ng] check: refactor 'am.test-suite.handle-suffix' * lib/am/parallel-tests.am (am.test-suite.handle-suffix.helper): New, extracted from ... (am.test-suite.handle-suffix): ... this, which now uses it. (am__tpfx): Remove, inlined into 'am.test-suite.handle-suffix'. * t/parallel-tests-internals.sh: Remove as obsolete. Signed-off-by: Stefano Lattarini --- diff --git a/lib/am/parallel-tests.am b/lib/am/parallel-tests.am index 6c56f8554..defd88bce 100644 --- a/lib/am/parallel-tests.am +++ b/lib/am/parallel-tests.am @@ -60,27 +60,23 @@ am.test-suite.runtest = \ "$$tst" \ $(AM_TESTS_FD_REDIRECT) -# Turn e.g., ".test" in "_TEST", and return the empty string unchanged. -am__tpfx = \ - $(if $1,$(call am.util.toupper,$(patsubst .%,%_,$1))) - -define am.test-suite.handle-suffix - -ifeq ($$(call am.vars.is-undef,$$(call am__tpfx,$1)LOG_DRIVER),yes) -$$(call am__tpfx,$1)LOG_DRIVER = $(SHELL) $(am.conf.aux-dir)/test-driver +define am.test-suite.handle-suffix.helper +ifeq ($$(call am.vars.is-undef,$(2)LOG_DRIVER),yes) +$(2)LOG_DRIVER = $(SHELL) $(am.conf.aux-dir)/test-driver endif - -%.log %.trs: %$1 $$($$(call am__tpfx,$1)LOG_DEPENDENCIES) - @$$(call am.test-suite.runtest,$$(call am__tpfx,$1)) - +%.log %.trs: %$1 $$($(2)LOG_DEPENDENCIES) + @$$(call am.test-suite.runtest,$2) ifeq ($(am.conf.handle-exeext),yes) ifdef EXEEXT -%.log %.trs: %$1$(EXEEXT) $$($$(call am__tpfx,$1)LOG_DEPENDENCIES) - @$$(call am.test-suite.runtest,$$(call am__tpfx,$1)) +%.log %.trs: %$1$(EXEEXT) $$($(2)LOG_DEPENDENCIES) + @$$(call am.test-suite.runtest,$2) endif # defined EXEEXT endif # am.conf.handle-exeext = yes +endef -endef # am.test-suite.handle-suffix +define am.test-suite.handle-suffix +$(call $0.helper,$1,$(if $1,$(call am.util.toupper,$(patsubst .%,%_,$1)))) +endef ifeq ($(call am.vars.is-undef,TEST_EXTENSIONS),yes) TEST_EXTENSIONS := .test diff --git a/t/parallel-tests-internals.sh b/t/parallel-tests-internals.sh deleted file mode 100755 index f15852f66..000000000 --- a/t/parallel-tests-internals.sh +++ /dev/null @@ -1,44 +0,0 @@ -#! /bin/sh -# Copyright (C) 2009-2012 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# Some internals of the parallel testsuite harness implementation. - -. ./defs || exit 1 - -cat >> configure.ac << 'END' -AC_OUTPUT -END - -cat > Makefile.am << 'END' -TESTS = -.PHONY: test -test: - test x'$(call am__tpfx,)' = x - test x'$(call am__tpfx,.test)' = x'TEST_' - test x'$(call am__tpfx,.sh5)' = x'SH5_' - test x'$(call am__tpfx,.x_y)' = x'X_Y_' - test x'$(call am__tpfx, )' = x - test x'$(call am__tpfx, .t )' = x'T_' -END - -$ACLOCAL -$AUTOCONF -$AUTOMAKE -a - -./configure -$MAKE test - -: