tests: work around strangeness in MSYS
[automake.git] / tests / test-driver-is-distributed.test
blob054c6d92d0532885e800290900541fe465ec21df
1 #! /bin/sh
2 # Copyright (C) 2011 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 <http://www.gnu.org/licenses/>.
17 # Check regression of parallel-tests:
18 # - `test-driver' script not correctly distributed when TESTS is
19 # defined in a subdir Makefile
21 am_parallel_tests=yes
22 . ./defs || Exit 1
24 cat >> configure.in << 'END'
25 AC_CONFIG_FILES([tests/Makefile])
26 AC_OUTPUT
27 END
29 rm -f depcomp # It's unneeded.
31 mkdir tests
33 cat > Makefile.am << 'END'
34 SUBDIRS = tests
35 check-local: test-top
36 test-top: distdir
37 ls -l $(distdir) $(distdir)/* ;: For debugging.
38 test -f $(distdir)/test-driver
39 .PHONY: test-top
40 END
42 cat > tests/Makefile.am << 'END'
43 check-local: test-sub
44 test-sub:
45 echo ' ' $(DIST_COMMON) ' ' | grep '[ /]test-driver '
46 TESTS = foo.test
47 EXTRA_DIST = $(TESTS)
48 END
50 cat > tests/foo.test << 'END'
51 #!/bin/sh
52 exit 0
53 END
54 chmod a+x tests/foo.test
56 $ACLOCAL
57 $AUTOCONF
58 $AUTOMAKE -a
59 ./configure
60 $MAKE test-top
61 cd tests; $MAKE test-sub; cd ..;
62 $MAKE distcheck
64 # Try again, with a `config_auxdir' != `.' this time.
66 $MAKE distclean
68 mkdir build-aux
69 mv missing install-sh test-driver build-aux
71 for d in . tests; do
72 sed 's|test-driver|build-aux/test-driver|' $d/Makefile.am > $d/t
73 mv -f $d/t $d/Makefile.am
74 cat $d/Makefile.am # For debugging.
75 done
77 # Extra newline possibly required by OpenBSD 3.9 sed, see the autoconf
78 # manual for details.
79 sed '/^AC_INIT/i\
80 AC_CONFIG_AUX_DIR([build-aux])
81 ' configure.in > t
82 mv -f t configure.in
83 cat configure.in # For debugging.
85 touch aclocal.m4 # To avoid useless remakes.
86 $AUTOCONF
87 $AUTOMAKE
88 ./configure
89 $MAKE test-top
90 cd tests; $MAKE test-sub; cd ..;
91 $MAKE distcheck