summaryrefslogtreecommitdiff
path: root/t/tap-global-log.sh
blob: b9d2d84179a003cc9fc8efb1b852796c15051d0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#! /bin/sh
# Copyright (C) 2011-2014 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# TAP support:
#  - which log files get copied in the global log?

. test-init.sh

. tap-setup.sh

cat > ok.test << 'END'
1..5
ok 1
ok 2
ok 3
not seen in global log
ok 4
ok 5
END

cat > top << 'END'
1..6
ok 1
ok 2
ok 3
END

cat > bot << 'END'
ok 5
ok 6
END

cat top - bot > skip.test << 'END'
ok # SKIP
::skip::
END

cat top - bot > todo.test << 'END'
not ok # TODO
::todo::
END

cat top - bot > fail.test << 'END'
not ok
::fail::
END

cat top - bot > xpass.test << 'END'
ok # TODO
::xpass::
END

cat top - bot > bail.test << 'END'
::bail::
Bail out!
END

cat top - bot > error.test << 'END'
::error::
1..7
END

# Created with "dd if=/dev/urandom count=1 | base64-encode"
cat > hodgepodge <<'END'
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000241092 s, 2.1 MB/s
gdivnV4VhL4DOzhE3zULJuun3PwqqQqMdATVcZbIQkNgyRvNBoqqHMBQEs7QsjDbp2nK+Szz
EcelGyvXmHrW7yImaom6Yrg95k31VCmp/pGDRnTDwDrcOPJiv9jDReEmTAQkPuqLO+mFNly+
DDHM9fNbzGumstsQ3wq3DOXz1pCV3JXwhjeaHSboeEbmr55bX0XHLSKaecctA0rXDXEyZWZ/
ODlawSrAXzw0H7a+xBwjnNXZ3zYiwk3x+WQrPqNjb+qXiLLTxAKzx2/KnaFhxkPlte5jPRNB
FciDolL+H/10LsCdSzLOrGnY2zH6vL2JMZfxjnb73zWFcdWWE01LTD7wpN5O1MP3+N47lcVe
lWbkD04cJvhwxLElYSO24B743GG5EyGYt9SeZRE6xbgwq3fVOS8KqjwGxwi4adSBTtw0CV8W
S/6n8dck1vBvjA+qpk0zMSYSqc3+jzW9UiGTmTEIwfw80p/lGNsfjcNBJ86nFkWUnHmrsi8k
Dv57sK70mTg239g08f5Uvdga/5UreMBSgB0hUj5sbq57r7B1fsVr0Kag468la8zKy3ZEZ0gX
++sbaJ9WGHhnKvjooeH+4Y6HwAFsdINde++FlCmp4EuNKKEEuXbSKLaOTy3+6pJ2DYdvRCL+
frZwxH4hcrw8qh+8IakB02viewZS/qT57v4=
END

exec 5>misc.test
echo 'ok # SKIP' >&5
cat hodgepodge >&5
echo 'not ok # TODO' >&5
echo 'ok' >&5
exec 5>&-

cat > skipall.test << 'END'
1..0 # SKIP all
END

run_make -e IGNORE TESTS="$(echo *.test)" check
cat test-suite.log

grep ':.*ok|not seen' test-suite.log && exit 1

for s in skip todo fail xpass bail error; do
  $FGREP "::$s::" test-suite.log
done

grep '^1\.\.0 # SKIP all$' test-suite.log

test_suite_contents=$(cat test-suite.log)
hodgepodge_contents=$(cat hodgepodge)
case $test_suite_contents in
  *"$hodgepodge_contents"*) ;;
  *) exit 1;;
esac

: