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