tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / t / serial-tests.sh
1 #! /bin/sh
2 # Copyright (C) 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 # Option 'serial-tests'.
18
19 # To avoid useless generation of a sibling test.
20 am_parallel_tests=yes
21 am_create_testdir=empty
22 . ./defs || Exit 1
23
24 hasnt_parallel_tests ()
25 {
26   $EGREP 'TEST_SUITE_LOG|TEST_LOGS|\.log.*:' $1 && Exit 1
27   grep 'recheck.*:' $1 && Exit 1
28   grep '^check-TESTS: \$(TESTS)$' $1
29 }
30
31 has_parallel_tests ()
32 {
33   $EGREP '(^| )check-TESTS.*:' $1
34   $EGREP '(^| )recheck.*:' $1
35   grep '^\$(TEST_SUITE_LOG): \$(TEST_LOGS)$' $1
36   grep '^\.test\.log:$' $1
37 }
38
39 mkdir one two
40
41 cat >> one/configure.ac <<END
42 AC_INIT([$me], [1.0])
43 AM_INIT_AUTOMAKE([serial-tests])
44 AC_CONFIG_FILES([Makefile])
45 END
46
47 echo 'TESTS = foo.test bar.test' > one/Makefile.am
48
49 cat >> two/configure.ac <<END
50 AC_INIT([$me], [2.0])
51 AC_CONFIG_AUX_DIR([config])
52 AM_INIT_AUTOMAKE([parallel-tests])
53 AC_CONFIG_FILES([aMakefile bMakefile])
54 END
55
56 cp one/Makefile.am two/aMakefile.am
57 cat - one/Makefile.am > two/bMakefile.am <<END
58 AUTOMAKE_OPTIONS = serial-tests
59 END
60
61 cd one
62 touch missing install-sh
63 $ACLOCAL
64 $AUTOMAKE
65 grep TEST Makefile.in # For debugging.
66 hasnt_parallel_tests Makefile.in
67 test ! -r test-driver
68 cd ..
69
70 cd two
71 mkdir config
72 $ACLOCAL
73 $AUTOMAKE --add-missing
74 grep TEST [ab]Makefile.in # For debugging.
75 has_parallel_tests aMakefile.in
76 hasnt_parallel_tests bMakefile.in
77 mv aMakefile.in aMakefile.sav
78 mv bMakefile.in bMakefile.sav
79 test ! -r test-driver
80 test -f config/test-driver
81 $AUTOMAKE
82 diff aMakefile.sav aMakefile.in
83 diff bMakefile.sav bMakefile.in
84 cd ..
85
86 :