tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / dejagnu-siteexp-append.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 # Check that the files in $(EXTRA_DEJAGNU_SITE_CONFIG) get appended to
18 # site.exp in the same order in which they're listed in that variable.
19
20 . test-init.sh
21
22 cat >> configure.ac << 'END'
23 AC_OUTPUT
24 END
25
26 cat > Makefile.am << 'END'
27 AUTOMAKE_OPTIONS = dejagnu
28 DEJATOOL = tool
29 END
30
31 $ACLOCAL
32 $AUTOCONF
33 $AUTOMAKE --add-missing
34
35 ./configure
36
37 $MAKE site.exp
38 sed '/^##.*##$/d' site.exp > expected
39
40 cat > foo.exp << 'END'
41 foo1
42 foo2
43 foo3
44 END
45
46 cat foo.exp - >> expected << 'END'
47 BAR 1
48 # foo
49 BAR 2
50 END
51
52 cat >> Makefile.am << 'END'
53 EXTRA_DEJAGNU_SITE_CONFIG = foo.exp bar.exp
54 bar.exp:
55         @(echo 'BAR 1' && echo '# foo' && echo 'BAR 2') > $@
56 END
57
58 $AUTOMAKE Makefile
59 ./config.status Makefile
60
61 rm -f site.exp
62 $MAKE site.exp
63 sed '/^##.*##$/d' site.exp > obtained
64
65 cat expected
66 cat site.exp
67
68 diff expected obtained
69
70 :