tests: work around strangeness in MSYS
[automake.git] / tests / parallel-tests-driver-install.test
blob4fa6dfde8fa321b975bd493014a4eaa4ef4eafe4
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 that auxiliary script 'test-driver' gets automatically installed
18 # in the correct directory by 'parallel-tests' option.
20 am_parallel_tests=yes
21 . ./defs || Exit 1
23 : Try first with parallel-tests defined in AM_INIT_AUTOMAKE.
25 mkdir am-init-automake
26 cd am-init-automake
28 cat > configure.in <<END
29 AC_INIT([$me], [1.0])
30 AC_CONFIG_AUX_DIR([my_aux_dir])
31 AM_INIT_AUTOMAKE([parallel-tests])
32 AC_CONFIG_FILES([Makefile sub/Makefile])
33 AC_OUTPUT
34 END
36 mkdir sub my_aux_dir
38 cat > Makefile.am <<END
39 SUBDIRS = sub
40 TESTS = foo.test
41 END
43 cat > sub/Makefile.am <<END
44 TESTS = bar.test
45 END
47 $ACLOCAL
48 $AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
49 cat stderr >&2
51 ls -l . sub my_aux_dir # For debugging.
52 test -f my_aux_dir/test-driver
53 test ! -r test-driver
54 test ! -r sub/test-driver
56 grep '^configure\.in:3:.*installing.*my_aux_dir/test-driver' stderr
58 cd ..
60 : Now try with parallel-tests defined in AUTOMAKE_OPTIONS.
62 mkdir automake-options
63 cd automake-options
65 cat > configure.in <<END
66 AC_INIT([$me], [1.0])
67 AC_CONFIG_AUX_DIR([build-aux])
68 AM_INIT_AUTOMAKE
69 AC_CONFIG_FILES([dir/GNUmakefile])
70 AC_OUTPUT
71 END
73 mkdir build-aux dir
75 cat > dir/GNUmakefile.am <<END
76 TESTS = foo.test
77 AUTOMAKE_OPTIONS = parallel-tests
78 TESTS += bar.test
79 END
81 $ACLOCAL
82 $AUTOMAKE --add-missing --copy dir/GNUmakefile 2>stderr \
83 || { cat stderr >&2; Exit 1; }
84 cat stderr >&2
86 ls -l . dir build-aux # For debugging.
87 test -f build-aux/test-driver
88 test ! -r test-driver
89 test ! -r dir/test-driver
91 grep '^dir/GNUmakefile\.am:2:.*installing.*build-aux/test-driver' stderr