Merge branch 'maint'
[platform/upstream/automake.git] / t / tap-global-log.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 # TAP support:
18 #  - which log files get copied in the global log?
19
20 am_parallel_tests=yes
21 . ./defs || Exit 1
22
23 . "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
24
25 cat > ok.test << 'END'
26 1..5
27 ok 1
28 ok 2
29 ok 3
30 not seen in global log
31 ok 4
32 ok 5
33 END
34
35 cat > top << 'END'
36 1..6
37 ok 1
38 ok 2
39 ok 3
40 END
41
42 cat > bot << 'END'
43 ok 5
44 ok 6
45 END
46
47 cat top - bot > skip.test << 'END'
48 ok # SKIP
49 ::skip::
50 END
51
52 cat top - bot > todo.test << 'END'
53 not ok # TODO
54 ::todo::
55 END
56
57 cat top - bot > fail.test << 'END'
58 not ok
59 ::fail::
60 END
61
62 cat top - bot > xpass.test << 'END'
63 ok # TODO
64 ::xpass::
65 END
66
67 cat top - bot > bail.test << 'END'
68 ::bail::
69 Bail out!
70 END
71
72 cat top - bot > error.test << 'END'
73 ::error::
74 1..7
75 END
76
77 # Created with "dd if=/dev/urandom count=1 | base64-encode"
78 cat > hodgepodge <<'END'
79 1+0 records in
80 1+0 records out
81 512 bytes (512 B) copied, 0.000241092 s, 2.1 MB/s
82 gdivnV4VhL4DOzhE3zULJuun3PwqqQqMdATVcZbIQkNgyRvNBoqqHMBQEs7QsjDbp2nK+Szz
83 EcelGyvXmHrW7yImaom6Yrg95k31VCmp/pGDRnTDwDrcOPJiv9jDReEmTAQkPuqLO+mFNly+
84 DDHM9fNbzGumstsQ3wq3DOXz1pCV3JXwhjeaHSboeEbmr55bX0XHLSKaecctA0rXDXEyZWZ/
85 ODlawSrAXzw0H7a+xBwjnNXZ3zYiwk3x+WQrPqNjb+qXiLLTxAKzx2/KnaFhxkPlte5jPRNB
86 FciDolL+H/10LsCdSzLOrGnY2zH6vL2JMZfxjnb73zWFcdWWE01LTD7wpN5O1MP3+N47lcVe
87 lWbkD04cJvhwxLElYSO24B743GG5EyGYt9SeZRE6xbgwq3fVOS8KqjwGxwi4adSBTtw0CV8W
88 S/6n8dck1vBvjA+qpk0zMSYSqc3+jzW9UiGTmTEIwfw80p/lGNsfjcNBJ86nFkWUnHmrsi8k
89 Dv57sK70mTg239g08f5Uvdga/5UreMBSgB0hUj5sbq57r7B1fsVr0Kag468la8zKy3ZEZ0gX
90 ++sbaJ9WGHhnKvjooeH+4Y6HwAFsdINde++FlCmp4EuNKKEEuXbSKLaOTy3+6pJ2DYdvRCL+
91 frZwxH4hcrw8qh+8IakB02viewZS/qT57v4=
92 END
93
94 exec 5>misc.test
95 echo 'ok # SKIP' >&5
96 cat hodgepodge >&5
97 echo 'not ok # TODO' >&5
98 echo 'ok' >&5
99 exec 5>&-
100
101 cat > skipall.test << 'END'
102 1..0 # SKIP all
103 END
104
105 # We don't care about the exit status of "make check" here.
106 TESTS="`echo *.test`" $MAKE -e check || :
107 cat test-suite.log
108
109 grep ':.*ok|not seen' test-suite.log && Exit 1
110
111 for s in skip todo fail xpass bail error; do
112   $FGREP "::$s::" test-suite.log
113 done
114
115 grep '^1\.\.0 # SKIP all$' test-suite.log
116
117 case `cat test-suite.log` in
118   *"`cat hodgepodge`"*) ;;
119   *) Exit 1;;
120 esac
121
122 :