3a2c695dfe5ded502741a63b2b3f8da82a264e31
[platform/upstream/automake.git] / tests / check7.test
1 #! /bin/sh
2 # Copyright (C) 2007  Free Software Foundation, Inc.
3 #
4 # This file is part of GNU Automake.
5 #
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
9 # any later version.
10 #
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING.  If not, write to
18 # the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 # Boston, MA 02110-1301, USA.
20
21 # Check EXEEXT extension for XFAIL_TESTS.
22
23 . ./defs || exit 1
24
25 set -e
26
27 cat >> configure.in << 'END'
28 AC_PROG_CC
29 AC_OUTPUT
30 END
31
32 cat > Makefile.am << 'END'
33 TESTS = $(XFAIL_TESTS)
34 XFAIL_TESTS = a b c d
35 check_PROGRAMS = a c d
36 check_SCRIPTS = b
37
38 print-xfail-tests:
39         @echo BEG: $(XFAIL_TESTS) :END
40 END
41
42 cat >>b <<'END'
43 #! /bin/sh
44 exit 1
45 END
46 chmod a+x b
47
48 cat >>a.c <<'END'
49 #include <stdlib.h>
50 int main() { return EXIT_FAILURE; }
51 END
52
53 cp a.c c.c
54 cp a.c d.c
55
56 $ACLOCAL
57 $AUTOCONF
58 $AUTOMAKE -a
59
60 ./configure
61 $MAKE check
62 EXEEXT=.bin $MAKE -e print-xfail-tests >foo
63 cat foo
64 grep 'BEG: a.bin b c.bin d.bin :END' foo
65
66 $MAKE distclean
67 mkdir build
68 cd build
69 ../configure
70 $MAKE check