tests: fix some botched/outdated comments
[platform/upstream/automake.git] / t / parallel-tests-recheck-depends-on-all.sh
1 #! /bin/sh
2 # Copyright (C) 2012-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 # The parallel-tests 'recheck' target must depend on the 'all' target.
18 # See automake bug#11252.
19
20 required='cc native'
21 . test-init.sh
22
23 cat >> configure.ac << 'END'
24 AC_PROG_CC
25 AC_OUTPUT
26 END
27
28 cat > Makefile.am << 'END'
29 all-local:
30         test ! -f status || echo okokok > status
31 bin_PROGRAMS = foo
32 TESTS = a.test b.test c.test
33 END
34
35 cat > foo.c << 'END'
36 #include <stdio.h>
37 int main (void)
38 {
39   printf ("failure :-(" "\n");
40   return 1;
41 }
42 END
43
44 cat > a.test << 'END'
45 #!/bin/sh
46 exit 0
47 END
48
49 cat > b.test << 'END'
50 #!/bin/sh
51 grep okokok status
52 END
53
54 cat > c.test << 'END'
55 #!/bin/sh
56 ./foo
57 END
58
59 chmod a+x *.test
60
61 $ACLOCAL
62 $AUTOCONF
63 $AUTOMAKE -a
64 ./configure
65
66 $MAKE check >stdout && { cat stdout; exit 1; }
67 cat stdout
68 count_test_results total=3 pass=1 fail=2 skip=0 xfail=0 xpass=0 error=0
69 test ! -e status
70
71 $sleep
72 : > status
73 cat > foo.c << 'END'
74 #include <stdio.h>
75 int main (void)
76 {
77   printf ("success :-)" "\n");
78   return 0;
79 }
80 END
81
82 $MAKE recheck >stdout || { cat stdout; exit 1; }
83 cat stdout
84 count_test_results total=2 pass=2 fail=0 skip=0 xfail=0 xpass=0 error=0
85 grep '^PASS: b\.test$' stdout
86 grep '^PASS: c\.test$' stdout
87
88 $MAKE recheck >stdout || { cat stdout; exit 1; }
89 cat stdout
90 count_test_results total=0 pass=0 fail=0 skip=0 xfail=0 xpass=0 error=0
91
92 :