maint: Post-release administrivia
[automake.git] / t / self-check-explicit-skips.sh
blobfa7925fc91675015a3a1f8fcd9db07c9ec9ab05f
1 #! /bin/sh
2 # Copyright (C) 2011-2018 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Sanity check for the automake testsuite.
18 # Check that our testsuite framework can be instructed not to consider
19 # an early exit due to some command exiting unexpectedly with status 77.
21 am_create_testdir=no
22 . test-init.sh
24 set +e
26 unset am_explicit_skips stderr_fileno_
28 # FIXME: this can be simplified when we improve our runtime checks on the
29 # testsuite shell to ensure it supports "VAR=val shell_func" correctly.
30 run_dummy_test ()
32 env $2 $AM_TEST_RUNNER_SHELL -c "
33 am_create_testdir=no
34 . test-init.sh
36 " dummy.sh
39 run_dummy_test 'exit 77'
40 test $? -eq 77 || exit 1
42 run_dummy_test 'sh -c "exit 77"' am_explicit_skips=no
43 test $? -eq 77 || exit 1
45 run_dummy_test '$PERL -e "exit 77"; true' am_explicit_skips=yes
46 test $? -eq 78 || exit 1
48 run_dummy_test 'sh -c "exit 77"; exit 0' am_explicit_skips=y
49 test $? -eq 78 || exit 1
51 run_dummy_test 'skip_ "foo"; :' am_explicit_skips=y
52 test $? -eq 77 || exit 1