tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / self-check-explicit-skips.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
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.
20
21 am_create_testdir=no
22 . test-init.sh
23
24 set +e
25
26 unset am_explicit_skips stderr_fileno_
27
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 ()
31 {
32   env $2 $AM_TEST_RUNNER_SHELL -c "
33     am_create_testdir=no
34    . test-init.sh
35     $1
36   " dummy.sh
37 }
38
39 run_dummy_test 'exit 77'
40 test $? -eq 77 || exit 1
41
42 run_dummy_test 'sh -c "exit 77"' am_explicit_skips=no
43 test $? -eq 77 || exit 1
44
45 run_dummy_test '$PERL -e "exit 77"; true' am_explicit_skips=yes
46 test $? -eq 78 || exit 1
47
48 run_dummy_test 'sh -c "exit 77"; exit 0' am_explicit_skips=y
49 test $? -eq 78 || exit 1
50
51 run_dummy_test 'skip_ "foo"; :' am_explicit_skips=y
52 test $? -eq 77 || exit 1
53
54 :