abd4a5c42c410decf75eae29286d76ba8981c126
[platform/upstream/automake.git] / t / parallel-tests-suffix-prog.sh
1 #! /bin/sh
2 # Copyright (C) 2009-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 parallel-tests features:
18 # - suffix rules, with PROGRAMS involved
19 # See also sister test 'parallel-tests-suffix.test'.
20
21 am_parallel_tests=yes
22 required='cc native'
23 . ./defs || Exit 1
24
25 cat >> configure.ac << 'END'
26 AC_PROG_CC
27 AC_OUTPUT
28 END
29
30 cat > Makefile.am << 'END'
31 ## Note that automake should not match the '/test' part of 'sub/test' as
32 ## '.test' suffix, nor the '/chk' part of 'sub/chk' as '.chk' suffix.
33 TESTS = $(dist_TESTS) $(check_PROGRAMS)
34 dist_TESTS = foo.chk bar.test sub/test
35 check_PROGRAMS = baz bla.test bli.suff sub/chk
36 TEST_EXTENSIONS = .chk .test
37 EXTRA_DIST = $(dist_TESTS)
38 END
39
40 mkdir sub
41
42 cat >foo.chk << 'END'
43 #! /bin/sh
44 exit 0
45 END
46 chmod a+x foo.chk
47 cp foo.chk bar.test
48 cp foo.chk sub/test
49
50 cat >baz.c << 'END'
51 int main (void)
52 {
53   return 0;
54 }
55 END
56 cp baz.c bla.c
57 cp baz.c bli.c
58 cp baz.c sub/chk.c
59
60 $ACLOCAL
61 $AUTOCONF
62 $AUTOMAKE -a
63
64 ./configure
65 $MAKE check
66 ls -l . sub
67 test -f foo.log
68 test -f bar.log
69 test -f baz.log
70 test -f bla.log
71 test -f bli.suff.log
72 test -f sub/chk.log
73 test -f sub/test.log
74
75 $MAKE distcheck
76
77 :