b538799e01a6368c785776f4215853fab5605cd8
[platform/upstream/automake.git] / tests / parallel-tests-driver-install.test
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 # Check that auxiliary script 'test-driver' gets automatically installed
18 # in the correct directory by 'parallel-tests' option.
19
20 am_parallel_tests=yes
21 . ./defs || Exit 1
22
23 : Try first with parallel-tests defined in AM_INIT_AUTOMAKE.
24
25 mkdir am-init-automake
26 cd am-init-automake
27
28 cat > configure.ac <<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
35
36 mkdir sub my_aux_dir
37
38 cat > Makefile.am <<END
39 SUBDIRS = sub
40 TESTS = foo.test
41 END
42
43 cat > sub/Makefile.am <<END
44 TESTS = bar.test
45 END
46
47 $ACLOCAL
48 $AUTOMAKE -a 2>stderr || { cat stderr >&2; Exit 1; }
49 cat stderr >&2
50
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
55
56 grep '^configure\.ac:3:.*installing.*my_aux_dir/test-driver' stderr
57
58 cd ..
59
60 : Now try with parallel-tests defined in AUTOMAKE_OPTIONS.
61
62 mkdir automake-options
63 cd automake-options
64
65 cat > configure.ac <<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
72
73 mkdir build-aux dir
74
75 cat > dir/GNUmakefile.am <<END
76 TESTS = foo.test
77 AUTOMAKE_OPTIONS = parallel-tests
78 TESTS += bar.test
79 END
80
81 $ACLOCAL
82 $AUTOMAKE --add-missing --copy dir/GNUmakefile 2>stderr \
83   || { cat stderr >&2; Exit 1; }
84 cat stderr >&2
85
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
90
91 grep '^dir/GNUmakefile\.am:2:.*installing.*build-aux/test-driver' stderr
92
93 :