tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / t / test-extensions.sh
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 # Make sure that Automake diagnose invalid entries in TEST_EXTENSIONS,
18 # and do not diagnose valid (albeit more unusual) ones.
19 # See automake bug#9400.
20
21 am_parallel_tests=yes
22 . ./defs || Exit 1
23
24 cat >> configure.ac <<'END'
25 AC_OUTPUT
26 END
27
28 $ACLOCAL
29 $AUTOCONF
30
31 valid_extensions='sh T t1 _foo BAR x_Y_z _'
32
33 echo TESTS = > Makefile.am
34 echo " $valid_extensions" \
35   | sed -e 's/ / ./g' -e 's/^/TEST_EXTENSIONS =/' >> Makefile.am
36 cat Makefile.am # For debugging.
37
38 $AUTOMAKE -a
39
40 grep -i 'log' Makefile.in # For debugging.
41
42 for lc in $valid_extensions; do
43   uc=`echo $lc | tr '[a-z]' '[A-Z]'`
44   $FGREP "\$(${uc}_LOG_COMPILER)" Makefile.in
45   grep "^${uc}_LOG_COMPILE =" Makefile.in
46   grep "^\.${lc}\.log:" Makefile.in
47 done
48
49 # The produced Makefile is not broken.
50 ./configure
51 $MAKE all check
52
53 cat > Makefile.am << 'END'
54 TESTS = foo.test bar.sh
55 TEST_EXTENSIONS  = .test mu .x-y a-b .t.1 .sh .6c .0 .11 .= @suf@ .@ext@
56 TEST_EXTENSIONS += .= .t33 .a@b _&_
57 END
58
59 AUTOMAKE_fails
60 for suf in mu .x-y a-b .t.1 .6c .0 .11  @suf@ .@ext@ '.=' '_&_'; do
61   suf2=`printf '%s\n' "$suf" | sed -e 's/\./\\./'`
62   $EGREP "^Makefile\.am:2:.*invalid test extension.* $suf2( |$)" stderr
63 done
64
65 # Verify that we accept valid suffixes, even if intermixed with
66 # invalid ones.
67 $EGREP '\.(sh|test|t33)' stderr && Exit 1
68
69 # Verify that we don't try to handle invalid suffixes.
70 $EGREP '(LOG_COMPILER|non-POSIX var|bad character)' stderr && Exit 1
71
72 :