Hash :
53339f86
Author :
Date :
2012-01-10T20:27:08
tests: work around MinGW/MSYS issue in fd redirections Some checks on $(AM_TESTS_FD_REDIRECT) were failing on MSYS, likely because system calls like "write(9, ...)" simply doesn't work for MinGW-compiled programs. Similar usages work for the shell scripts though, since /bin/sh is an MSYS program and thus is a lot more POSIX-ish than most MinGW-compiled programs. The best fix for this issue is to separate the checks using shell scripts as dummy test cases from the checks using compiled programs for the same purpose, and skip these latter checks on MinGW. This change fixes automake bug#10466. Report by Peter Rosin. * tests/parallel-tests-fd-redirect.test: Move checks using compiled C programs as test cases to ... * tests/parallel-tests-fd-redirect-exeext.test: ... this new test. * tests/list-of-tests.mk: Update.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#! /bin/sh
# Copyright (C) 2011, 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/>.
# parallel-tests support: redirection of file descriptors with
# AM_TESTS_FD_REDIRECT, even when using tests without suffix.
# The sister `parallel-tests-fd-redirect-exeext.test' do a similar
# check for tests that are binary executables.
# See also the more generic test 'check-fd-redirect.test'.
am_parallel_tests=yes
. ./defs || Exit 1
cat >> configure.in << 'END'
AC_OUTPUT
END
cat > Makefile.am << 'END'
AM_TESTS_FD_REDIRECT = 9>&1
TEST_EXTENSIONS = .test .sh
TESTS = foo.sh bar
END
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
cat > foo.sh <<'END'
#!/bin/sh
echo " foofoofoo" >&9
END
chmod a+x foo.sh
cat > bar <<'END'
#!/bin/sh
echo " barbarbar" >&9
END
chmod a+x foo.sh bar
./configure
# Sanity checks.
st=0
grep '^bar\.log:.*bar' Makefile || st=1
grep '^foo\.log:' Makefile && st=1
test $st -eq 0 || fatal_ "doesn't cover expected code paths"
st=0; $MAKE check >stdout || st=1
cat stdout
cat foo.log
cat bar.log
test $st -eq 0
grep "^ foofoofoo$" stdout
grep "^ barbarbar$" stdout
$EGREP '(foofoofoo|barbarbar)' *.log && Exit 1
: