cosmetics: remove trailing whitespace in some files
[platform/upstream/automake.git] / t / self-check-explicit-skips.sh
1 #! /bin/sh
2 # Copyright (C) 2011-2012 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 . ./defs || Exit 1
23
24 set +e
25
26 unset am_explicit_skips stderr_fileno_
27 AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
28
29 # FIXME: this can be simplified when we improve our runtime checks on the
30 # testsuite shell to ensure it supports "VAR=val shell_func" correctly.
31 run_dummy_test ()
32 {
33   env $2 $AM_TEST_RUNNER_SHELL -c "am_create_testdir=no; . ./defs; $1" \
34                                   dummy.sh
35 }
36
37 run_dummy_test '(exit 77); exit 77'
38 test $? -eq 77 || Exit 1
39
40 run_dummy_test 'sh -c "exit 77"' am_explicit_skips=no
41 test $? -eq 77 || Exit 1
42
43 run_dummy_test '(exit 77); exit 77' am_explicit_skips=yes
44 test $? -eq 78 || Exit 1
45
46 run_dummy_test 'sh -c "exit 77"' am_explicit_skips=y
47 test $? -eq 78 || Exit 1
48
49 run_dummy_test 'Exit 77' am_explicit_skips=yes
50 test $? -eq 77 || Exit 1
51
52 run_dummy_test 'skip_ "foo"' am_explicit_skips=y
53 test $? -eq 77 || Exit 1
54
55 :