doc: typos in test file.
[automake.git] / t / tap-deps.sh
blob605a2bd030f480e599e8a70619f88381a4251546
1 #! /bin/sh
2 # Copyright (C) 2011-2024 Free Software Foundation, Inc.
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.
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.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Basic TAP test protocol support:
18 # - dependencies between test scripts
20 . test-init.sh
22 cat > Makefile.am << 'END'
23 # The tests are *deliberately* listed in inversed order here.
24 TESTS = c.test b.test a.test
25 b.log: a.log
26 c.log: b.log
27 END
29 . tap-setup.sh
31 cat > a.test << 'END'
32 #!/bin/sh
33 echo 1..2
34 echo ok 1
35 # Creative quoting below to please maintainer-check.
36 sleep '3'
37 echo ok 2
38 : > a.run
39 END
41 cat > b.test << 'END'
42 #!/bin/sh
43 echo 1..2
44 if test -f a.run; then
45 echo ok 1
46 else
47 echo not ok 1
49 # Creative quoting below to please maintainer-check.
50 sleep '3'
51 echo ok 2
52 : > b.run
53 END
55 cat > c.test << 'END'
56 #!/bin/sh
57 echo 1..1
58 test -f b.run || { echo 'Bail out!'; exit 1; }
59 echo ok 1
60 rm -f a.run b.run
61 END
63 chmod a+x *.test
65 run_make -O check
66 count_test_results total=5 pass=5 fail=0 xpass=0 xfail=0 skip=0 error=0
68 cat > exp << 'END'
69 PASS: a.test 1
70 PASS: a.test 2
71 PASS: b.test 1
72 PASS: b.test 2
73 PASS: c.test 1
74 END
76 grep ': [abc]\.test' stdout > got
78 cat exp
79 cat got
80 diff exp got
82 # TODO: it would be nice to also redo the checks forcing parallel make...