From 1b5e0246957acb4987e12b48d6ffbe9166cb8f82 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini 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(+) create mode 100755 tests/parallel-tests-cmdline-override.test diff --git a/ChangeLog b/ChangeLog index d3434ef8f..5da2962c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-06-30 Stefano Lattarini + + 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 docs: explain why AM_TESTS_ENVIRONMENT must be semicolon-terminated diff --git a/tests/Makefile.am b/tests/Makefile.am index 3883dc009..0409258f3 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 74538637b..c5018197c 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 000000000..fa4703298 --- /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 . + +# 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" + +: -- 2.47.2