]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] check: refactor 'am.test-suite.handle-suffix'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 27 Jul 2012 23:39:57 +0000 (01:39 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 28 Jul 2012 08:15:27 +0000 (10:15 +0200)
* 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 <stefano.lattarini@gmail.com>
lib/am/parallel-tests.am
t/parallel-tests-internals.sh [deleted file]

index 6c56f8554594b6a14d30e955e99c67e6806c53cb..defd88bce245ec8377ce9aece35b71d1b5f026e9 100644 (file)
@@ -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 (executable)
index f15852f..0000000
+++ /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 <http://www.gnu.org/licenses/>.
-
-# 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
-
-: