tests: remove recipes that run tests with 'prove'
[platform/upstream/automake.git] / tests / tap-deps.test
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 # Basic TAP test protocol support:
18 #  - dependencies between test scripts
19
20 am_parallel_tests=yes
21 . ./defs || Exit 1
22
23 cat > Makefile.am << 'END'
24 # The tests are *deliberately* listed in inversed order here.
25 TESTS = c.test b.test a.test
26 b.log: a.log
27 c.log: b.log
28 END
29
30 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
31
32 cat > a.test << 'END'
33 #!/bin/sh
34 echo 1..2
35 echo ok 1
36 # Creative quoting below to please maintainer-check.
37 sleep '3'
38 echo ok 2
39 : > a.run
40 END
41
42 cat > b.test << 'END'
43 #!/bin/sh
44 echo 1..2
45 if test -f a.run; then
46   echo ok 1
47 else
48   echo not ok 1
49 fi
50 # Creative quoting below to please maintainer-check.
51 sleep '3'
52 echo ok 2
53 : > b.run
54 END
55
56 cat > c.test << 'END'
57 #!/bin/sh
58 echo 1..1
59 test -f b.run || { echo 'Bail out!'; exit 1; }
60 echo ok 1
61 rm -f a.run b.run
62 END
63
64 chmod a+x *.test
65
66 $MAKE check >stdout || { cat stdout; Exit 1; }
67 cat stdout
68
69 count_test_results total=5 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=0
70
71 cat > exp << 'END'
72 PASS: a.test 1
73 PASS: a.test 2
74 PASS: b.test 1
75 PASS: b.test 2
76 PASS: c.test 1
77 END
78
79 grep ': [abc]\.test' stdout > got
80
81 cat exp
82 cat got
83 diff exp got
84
85 # TODO: it would be nice to also redo the checks forcing parallel make...
86
87 :