I'd like to add this new test case to master. OK? I'll push in 72 hours if there is no review by then.
Regards, Stefano
From b1531a90bf07d3343dda5111f4789e3b6066e480 Mon Sep 17 00:00:00 2001 Message-Id: <b1531a90bf07d3343dda5111f4789e3b6066e480.1309444834.git.stefano.lattar...@gmail.com> From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Thu, 30 Jun 2011 16:37:19 +0200 Subject: [PATCH] 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. --- ChangeLog | 8 +++ tests/Makefile.am | 1 + tests/Makefile.in | 1 + tests/parallel-tests-cmdline-override.test | 84 ++++++++++++++++++++++++++++ 4 files changed, 94 insertions(+), 0 deletions(-) create mode 100755 tests/parallel-tests-cmdline-override.test diff --git a/ChangeLog b/ChangeLog index 1436482..345d41f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-06-30 Stefano Lattarini <stefano.lattar...@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.lattar...@gmail.com> docs: explain why AM_TESTS_ENVIRONMENT must be semicolon-terminated diff --git a/tests/Makefile.am b/tests/Makefile.am index 3883dc0..0409258 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 7453863..c501819 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 index 0000000..cd8f82f --- /dev/null +++ b/tests/parallel-tests-cmdline-override.test @@ -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 # Not to create false psotives below. + +LC_ALL=C sort > exp-log <<'END' +a.log +b.log +c.log +d.log +e.log +test-suite.log +END + +LC_ALL=C sort > 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" + +: -- 1.7.2.3