automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 18/17] [ng] coverage: parallel-tests and dynamic $(


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 18/17] [ng] coverage: parallel-tests and dynamic $(TEST_EXTENSIONS) content
Date: Tue, 22 May 2012 23:22:45 +0200

The recent changes to the parallel-tests implementation should allow us
to define or override TEST_EXTENSIONS with more dynamic contents; in
particular, something like:

    TEST_EXTENSIONS = $(suffix $(TESTS))

should now work smoothly.

* t/test-extensions-dynamic.sh: New test.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 t/test-extensions-dynamic.sh |   94 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 94 insertions(+)
 create mode 100755 t/test-extensions-dynamic.sh

diff --git a/t/test-extensions-dynamic.sh b/t/test-extensions-dynamic.sh
new file mode 100755
index 0000000..a762ad8
--- /dev/null
+++ b/t/test-extensions-dynamic.sh
@@ -0,0 +1,94 @@
+#! /bin/sh
+# Copyright (C) 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/>.
+
+# TEST_EXTENSIONS with contents dynamically determined at make time
+
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_SUBST([suf], [.tap])
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+mkdir sub
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+TESTS = foo.sh bar.test baz.t1 mu.t1.t2 zardoz.tap
+TEST_EXTENSIONS = .test @suf@ $(foreach i,1 2,t$(i))
+TEST_EXTENSIONS += $(subst &,.,$(call am__tolower,&SH))
+END
+
+cat > sub/Makefile.am << 'END'
+TESTS = 1.sh 2.bar 3
+TEST_EXTENSIONS = $(suffix $(TESTS))
+END
+
+cat > foo.sh << 'END'
+#!/bin/sh
+exit 0
+END
+chmod a+x foo.sh
+
+cp foo.sh bar.test
+cp foo.sh baz.t1
+cp foo.sh mu.t1.t2
+cp foo.sh zardoz.tap
+cp foo.sh sub/1.sh
+cp foo.sh sub/2.bar
+cp foo.sh sub/3
+
+do_setup ()
+{
+  $MAKE check ${1+"$@"}
+  ls -l . sub
+}
+
+do_clean ()
+{
+  $MAKE clean
+  test "$(find . -name '*.log')" = ./config.log
+}
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+./configure
+
+do_setup
+test -f foo.log
+test -f bar.log
+test -f baz.log
+test -f mu.t1.log
+test -f zardoz.log
+test -f sub/1.log
+test -f sub/2.log
+test -f sub/3.log
+
+do_clean
+
+do_setup TEST_EXTENSIONS='.sh t2 test ${suf}'
+test -f foo.log
+test -f bar.log
+test -f baz.t1.log
+test -f mu.t1.log
+test -f zardoz.log
+test -f sub/1.log
+test -f sub/2.bar.log
+test -f sub/3.log
+
+:
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]