]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
coverage: new test on parallel-tests TESTS runtime overriding
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 30 Jun 2011 14:37:19 +0000 (16:37 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 30 Jun 2011 23:05:38 +0000 (01:05 +0200)
* tests/parallel-tests-cmdline-override.test: New test, check that
we can use indirections when overriding TESTS and TEST_LOGS from
the command line.
* tests/Makefile.am (TESTS): Update.

ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/parallel-tests-cmdline-override.test [new file with mode: 0755]

index d3434ef8fafad1edda6ab0316577cbf15389f93b..5da2962c8ef3d1f9047a2360693e9fab535a37c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-30   Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       coverage: new test on parallel-tests TESTS runtime overriding
+       * tests/parallel-tests-cmdline-override.test: New test, check that
+       we can use indirections when overriding TESTS and TEST_LOGS from
+       the command line.
+       * tests/Makefile.am (TESTS): Update.
+
 2011-06-29   Stefano Lattarini  <stefano.lattarini@gmail.com>
 
        docs: explain why AM_TESTS_ENVIRONMENT must be semicolon-terminated
index 3883dc009d6962a63bd1227f9a009dd3c02f1d21..0409258f3f9df73f7267d059f1de8c87a1907776 100644 (file)
@@ -727,6 +727,7 @@ parallel-tests-harderror.test \
 parallel-tests-log-override-1.test \
 parallel-tests-log-override-2.test \
 parallel-tests-log-override-recheck.test \
+parallel-tests-cmdline-override.test \
 parse.test \
 percent.test \
 percent2.test \
index 74538637b67fb7d8b062ef5498f89f2a110b7a45..c5018197c04d0c2878f3dfa802bfee422b5fdfd9 100644 (file)
@@ -1000,6 +1000,7 @@ parallel-tests-harderror.test \
 parallel-tests-log-override-1.test \
 parallel-tests-log-override-2.test \
 parallel-tests-log-override-recheck.test \
+parallel-tests-cmdline-override.test \
 parse.test \
 percent.test \
 percent2.test \
diff --git a/tests/parallel-tests-cmdline-override.test b/tests/parallel-tests-cmdline-override.test
new file mode 100755 (executable)
index 0000000..fa47032
--- /dev/null
@@ -0,0 +1,84 @@
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Check that we can use indirections when overriding TESTS and
+# TEST_LOGS from the command line.
+
+parallel_tests=yes
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+TEST_EXTENSIONS = .test .t
+TEST_LOG_COMPILER = cat
+T_LOG_COMPILER = cat
+TESTS = bad.test
+var1 = b.test $(var2)
+var2 = c.test
+var3 = d.d
+var4 = e
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+rm -f config.log # Do not create false positives below.
+
+cat > exp-log <<'END'
+a.log
+b.log
+c.log
+d.log
+e.log
+test-suite.log
+END
+
+cat > exp-out <<'END'
+PASS: a.t
+PASS: b.test
+PASS: c.test
+PASS: d.t
+PASS: e.test
+END
+
+do_check ()
+{
+  env "$@" $MAKE -e check >stdout || { cat stdout; Exit 1; }
+  cat stdout
+  grep '^PASS:' stdout | LC_ALL=C sort > got-out
+  cat got-out
+  ls . | grep '\.log$' | LC_ALL=C sort > got-log
+  cat got-log
+  st=0
+  diff exp-out got-out || st=1
+  diff exp-log got-log || st=1
+  return $st
+}
+
+tests='a.t $(var1) $(var3:.d=.t) $(var4:=.test)'
+test_logs='a.log $(var1:.test=.log) $(var3:.d=.log) $(var4:=.log)'
+
+touch a.t b.test c.test d.t e.test
+
+do_check TESTS="$tests"
+do_check TEST_LOGS="$test_logs"
+
+: