Hash :
7519d263
Author :
Date :
2012-07-14T13:56:34
self tests: avoid spurious failures on older bash Fixes automake bug#11909. * t/self-check-explicit-skips.sh: Remove or rework few checks for use cases that are no more relevant nor supported now that we've got rid of the need to use the 'Exit' function explicitly. Make the other existing checks stricter. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
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
#! /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/>.
# Sanity check for the automake testsuite.
# Check that our testsuite framework can be instructed not to consider
# an early exit due to some command exiting unexpectedly with status 77.
am_create_testdir=no
. ./defs || exit 1
set +e
unset am_explicit_skips stderr_fileno_
# FIXME: this can be simplified when we improve our runtime checks on the
# testsuite shell to ensure it supports "VAR=val shell_func" correctly.
run_dummy_test ()
{
env $2 $AM_TEST_RUNNER_SHELL -c "
am_create_testdir=no
. ./defs
$1
" dummy.sh
}
run_dummy_test 'exit 77'
test $? -eq 77 || exit 1
run_dummy_test 'sh -c "exit 77"' am_explicit_skips=no
test $? -eq 77 || exit 1
run_dummy_test '$PERL -e "exit 77"; true' am_explicit_skips=yes
test $? -eq 78 || exit 1
run_dummy_test 'sh -c "exit 77"; exit 0' am_explicit_skips=y
test $? -eq 78 || exit 1
run_dummy_test 'skip_ "foo"; :' am_explicit_skips=y
test $? -eq 77 || exit 1
: