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
|
#! /bin/sh
# Copyright (C) 2011-2021 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 <https://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.sh' do a similar
# check for tests that are binary executables.
# See also the more generic test 'check-fd-redirect.sh'.
. test-init.sh
cat >> configure.ac << '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"
run_make -O -e IGNORE check
cat foo.log
cat bar.log
test $am_make_rc -eq 0
grep "^ foofoofoo$" stdout
grep "^ barbarbar$" stdout
$EGREP '(foofoofoo|barbarbar)' *.log && exit 1
:
|