1*0a6a1f1dSLionel Sambuc //
2*0a6a1f1dSLionel Sambuc // Automated Testing Framework (atf)
3*0a6a1f1dSLionel Sambuc //
4*0a6a1f1dSLionel Sambuc // Copyright (c) 2010 The NetBSD Foundation, Inc.
5*0a6a1f1dSLionel Sambuc // All rights reserved.
6*0a6a1f1dSLionel Sambuc //
7*0a6a1f1dSLionel Sambuc // Redistribution and use in source and binary forms, with or without
8*0a6a1f1dSLionel Sambuc // modification, are permitted provided that the following conditions
9*0a6a1f1dSLionel Sambuc // are met:
10*0a6a1f1dSLionel Sambuc // 1. Redistributions of source code must retain the above copyright
11*0a6a1f1dSLionel Sambuc // notice, this list of conditions and the following disclaimer.
12*0a6a1f1dSLionel Sambuc // 2. Redistributions in binary form must reproduce the above copyright
13*0a6a1f1dSLionel Sambuc // notice, this list of conditions and the following disclaimer in the
14*0a6a1f1dSLionel Sambuc // documentation and/or other materials provided with the distribution.
15*0a6a1f1dSLionel Sambuc //
16*0a6a1f1dSLionel Sambuc // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17*0a6a1f1dSLionel Sambuc // CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18*0a6a1f1dSLionel Sambuc // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19*0a6a1f1dSLionel Sambuc // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20*0a6a1f1dSLionel Sambuc // IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21*0a6a1f1dSLionel Sambuc // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*0a6a1f1dSLionel Sambuc // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23*0a6a1f1dSLionel Sambuc // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24*0a6a1f1dSLionel Sambuc // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25*0a6a1f1dSLionel Sambuc // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26*0a6a1f1dSLionel Sambuc // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27*0a6a1f1dSLionel Sambuc // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*0a6a1f1dSLionel Sambuc //
29*0a6a1f1dSLionel Sambuc
30*0a6a1f1dSLionel Sambuc #include <iostream>
31*0a6a1f1dSLionel Sambuc #include <sstream>
32*0a6a1f1dSLionel Sambuc #include <string>
33*0a6a1f1dSLionel Sambuc #include <utility>
34*0a6a1f1dSLionel Sambuc #include <vector>
35*0a6a1f1dSLionel Sambuc
36*0a6a1f1dSLionel Sambuc #include <atf-c++.hpp>
37*0a6a1f1dSLionel Sambuc
38*0a6a1f1dSLionel Sambuc #include "parser.hpp"
39*0a6a1f1dSLionel Sambuc #include "reader.hpp"
40*0a6a1f1dSLionel Sambuc #include "test_helpers.hpp"
41*0a6a1f1dSLionel Sambuc #include "text.hpp"
42*0a6a1f1dSLionel Sambuc
43*0a6a1f1dSLionel Sambuc namespace impl = tools::atf_report;
44*0a6a1f1dSLionel Sambuc
45*0a6a1f1dSLionel Sambuc class tps_reader : protected impl::atf_tps_reader {
46*0a6a1f1dSLionel Sambuc void
got_info(const std::string & what,const std::string & val)47*0a6a1f1dSLionel Sambuc got_info(const std::string& what, const std::string& val)
48*0a6a1f1dSLionel Sambuc {
49*0a6a1f1dSLionel Sambuc m_calls.push_back("got_info(" + what + ", " + val + ")");
50*0a6a1f1dSLionel Sambuc }
51*0a6a1f1dSLionel Sambuc
52*0a6a1f1dSLionel Sambuc void
got_ntps(size_t ntps)53*0a6a1f1dSLionel Sambuc got_ntps(size_t ntps)
54*0a6a1f1dSLionel Sambuc {
55*0a6a1f1dSLionel Sambuc m_calls.push_back("got_ntps(" + tools::text::to_string(ntps) + ")");
56*0a6a1f1dSLionel Sambuc }
57*0a6a1f1dSLionel Sambuc
58*0a6a1f1dSLionel Sambuc void
got_tp_start(const std::string & tpname,size_t ntcs)59*0a6a1f1dSLionel Sambuc got_tp_start(const std::string& tpname, size_t ntcs)
60*0a6a1f1dSLionel Sambuc {
61*0a6a1f1dSLionel Sambuc m_calls.push_back("got_tp_start(" + tpname + ", " +
62*0a6a1f1dSLionel Sambuc tools::text::to_string(ntcs) + ")");
63*0a6a1f1dSLionel Sambuc }
64*0a6a1f1dSLionel Sambuc
65*0a6a1f1dSLionel Sambuc void
got_tp_end(struct timeval * tv,const std::string & reason)66*0a6a1f1dSLionel Sambuc got_tp_end(struct timeval* tv __attribute__((__unused__)),
67*0a6a1f1dSLionel Sambuc const std::string& reason)
68*0a6a1f1dSLionel Sambuc {
69*0a6a1f1dSLionel Sambuc m_calls.push_back("got_tp_end(" + reason + ")");
70*0a6a1f1dSLionel Sambuc }
71*0a6a1f1dSLionel Sambuc
72*0a6a1f1dSLionel Sambuc void
got_tc_start(const std::string & tcname)73*0a6a1f1dSLionel Sambuc got_tc_start(const std::string& tcname)
74*0a6a1f1dSLionel Sambuc {
75*0a6a1f1dSLionel Sambuc m_calls.push_back("got_tc_start(" + tcname + ")");
76*0a6a1f1dSLionel Sambuc }
77*0a6a1f1dSLionel Sambuc
78*0a6a1f1dSLionel Sambuc void
got_tc_end(const std::string & state,struct timeval * tv,const std::string & reason)79*0a6a1f1dSLionel Sambuc got_tc_end(const std::string& state,
80*0a6a1f1dSLionel Sambuc struct timeval* tv __attribute__((__unused__)),
81*0a6a1f1dSLionel Sambuc const std::string& reason)
82*0a6a1f1dSLionel Sambuc {
83*0a6a1f1dSLionel Sambuc const std::string r = state + (reason.empty() ? "" : ", " + reason);
84*0a6a1f1dSLionel Sambuc m_calls.push_back("got_tc_end(" + r + ")");
85*0a6a1f1dSLionel Sambuc }
86*0a6a1f1dSLionel Sambuc
87*0a6a1f1dSLionel Sambuc void
got_tc_stdout_line(const std::string & line)88*0a6a1f1dSLionel Sambuc got_tc_stdout_line(const std::string& line)
89*0a6a1f1dSLionel Sambuc {
90*0a6a1f1dSLionel Sambuc m_calls.push_back("got_tc_stdout_line(" + line + ")");
91*0a6a1f1dSLionel Sambuc }
92*0a6a1f1dSLionel Sambuc
93*0a6a1f1dSLionel Sambuc void
got_tc_stderr_line(const std::string & line)94*0a6a1f1dSLionel Sambuc got_tc_stderr_line(const std::string& line)
95*0a6a1f1dSLionel Sambuc {
96*0a6a1f1dSLionel Sambuc m_calls.push_back("got_tc_stderr_line(" + line + ")");
97*0a6a1f1dSLionel Sambuc }
98*0a6a1f1dSLionel Sambuc
99*0a6a1f1dSLionel Sambuc void
got_eof(void)100*0a6a1f1dSLionel Sambuc got_eof(void)
101*0a6a1f1dSLionel Sambuc {
102*0a6a1f1dSLionel Sambuc m_calls.push_back("got_eof()");
103*0a6a1f1dSLionel Sambuc }
104*0a6a1f1dSLionel Sambuc
105*0a6a1f1dSLionel Sambuc public:
tps_reader(std::istream & is)106*0a6a1f1dSLionel Sambuc tps_reader(std::istream& is) :
107*0a6a1f1dSLionel Sambuc impl::atf_tps_reader(is)
108*0a6a1f1dSLionel Sambuc {
109*0a6a1f1dSLionel Sambuc }
110*0a6a1f1dSLionel Sambuc
111*0a6a1f1dSLionel Sambuc void
read(void)112*0a6a1f1dSLionel Sambuc read(void)
113*0a6a1f1dSLionel Sambuc {
114*0a6a1f1dSLionel Sambuc atf_tps_reader::read();
115*0a6a1f1dSLionel Sambuc }
116*0a6a1f1dSLionel Sambuc
117*0a6a1f1dSLionel Sambuc std::vector< std::string > m_calls;
118*0a6a1f1dSLionel Sambuc };
119*0a6a1f1dSLionel Sambuc
120*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_1);
ATF_TEST_CASE_BODY(tps_1)121*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_1)
122*0a6a1f1dSLionel Sambuc {
123*0a6a1f1dSLionel Sambuc const char* input =
124*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
125*0a6a1f1dSLionel Sambuc "\n"
126*0a6a1f1dSLionel Sambuc "tps-count: 0\n"
127*0a6a1f1dSLionel Sambuc ;
128*0a6a1f1dSLionel Sambuc
129*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
130*0a6a1f1dSLionel Sambuc "got_ntps(0)",
131*0a6a1f1dSLionel Sambuc "got_eof()",
132*0a6a1f1dSLionel Sambuc NULL
133*0a6a1f1dSLionel Sambuc };
134*0a6a1f1dSLionel Sambuc
135*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
136*0a6a1f1dSLionel Sambuc NULL
137*0a6a1f1dSLionel Sambuc };
138*0a6a1f1dSLionel Sambuc
139*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
140*0a6a1f1dSLionel Sambuc }
141*0a6a1f1dSLionel Sambuc
142*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_2);
ATF_TEST_CASE_BODY(tps_2)143*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_2)
144*0a6a1f1dSLionel Sambuc {
145*0a6a1f1dSLionel Sambuc const char* input =
146*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
147*0a6a1f1dSLionel Sambuc "\n"
148*0a6a1f1dSLionel Sambuc "tps-count: 2\n"
149*0a6a1f1dSLionel Sambuc "tp-start: 123.456, first-prog, 0\n"
150*0a6a1f1dSLionel Sambuc "tp-end: 123.567, first-prog\n"
151*0a6a1f1dSLionel Sambuc "tp-start: 123.678, second-prog, 0\n"
152*0a6a1f1dSLionel Sambuc "tp-end: 123.789, second-prog, This program failed\n"
153*0a6a1f1dSLionel Sambuc ;
154*0a6a1f1dSLionel Sambuc
155*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
156*0a6a1f1dSLionel Sambuc "got_ntps(2)",
157*0a6a1f1dSLionel Sambuc "got_tp_start(first-prog, 0)",
158*0a6a1f1dSLionel Sambuc "got_tp_end()",
159*0a6a1f1dSLionel Sambuc "got_tp_start(second-prog, 0)",
160*0a6a1f1dSLionel Sambuc "got_tp_end(This program failed)",
161*0a6a1f1dSLionel Sambuc "got_eof()",
162*0a6a1f1dSLionel Sambuc NULL
163*0a6a1f1dSLionel Sambuc };
164*0a6a1f1dSLionel Sambuc
165*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
166*0a6a1f1dSLionel Sambuc NULL
167*0a6a1f1dSLionel Sambuc };
168*0a6a1f1dSLionel Sambuc
169*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
170*0a6a1f1dSLionel Sambuc }
171*0a6a1f1dSLionel Sambuc
172*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_3);
ATF_TEST_CASE_BODY(tps_3)173*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_3)
174*0a6a1f1dSLionel Sambuc {
175*0a6a1f1dSLionel Sambuc const char* input =
176*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
177*0a6a1f1dSLionel Sambuc "\n"
178*0a6a1f1dSLionel Sambuc "tps-count: 2\n"
179*0a6a1f1dSLionel Sambuc "tp-start: 123.123, first-prog, 3\n"
180*0a6a1f1dSLionel Sambuc "tc-start: 123.234, first-test\n"
181*0a6a1f1dSLionel Sambuc "tc-end: 123.345, first-test, passed\n"
182*0a6a1f1dSLionel Sambuc "tc-start: 123.456, second-test\n"
183*0a6a1f1dSLionel Sambuc "tc-end: 123.567, second-test, skipped, Testing skipped reason\n"
184*0a6a1f1dSLionel Sambuc "tc-start: 123.678, third.test\n"
185*0a6a1f1dSLionel Sambuc "tc-end: 123.789, third.test, failed, Testing failed reason\n"
186*0a6a1f1dSLionel Sambuc "tp-end: 123.890, first-prog\n"
187*0a6a1f1dSLionel Sambuc "tp-start: 124.901, second-prog, 3\n"
188*0a6a1f1dSLionel Sambuc "tc-start: 124.1012, first-test\n"
189*0a6a1f1dSLionel Sambuc "tc-so:first stdout line for 1st test\n"
190*0a6a1f1dSLionel Sambuc "tc-se:first stderr line for 1st test\n"
191*0a6a1f1dSLionel Sambuc "tc-so:second stdout line for 1st test\n"
192*0a6a1f1dSLionel Sambuc "tc-se:second stderr line for 1st test\n"
193*0a6a1f1dSLionel Sambuc "tc-end: 124.1123, first-test, passed\n"
194*0a6a1f1dSLionel Sambuc "tc-start: 124.1234, second-test\n"
195*0a6a1f1dSLionel Sambuc "tc-so:first stdout line for 2nd test\n"
196*0a6a1f1dSLionel Sambuc "tc-se:first stderr line for 2nd test\n"
197*0a6a1f1dSLionel Sambuc "tc-so:second stdout line for 2nd test\n"
198*0a6a1f1dSLionel Sambuc "tc-se:second stderr line for 2nd test\n"
199*0a6a1f1dSLionel Sambuc "tc-end: 124.1345, second-test, skipped, Testing skipped reason\n"
200*0a6a1f1dSLionel Sambuc "tc-start: 124.1456, third.test\n"
201*0a6a1f1dSLionel Sambuc "tc-so:first stdout line for 3rd test\n"
202*0a6a1f1dSLionel Sambuc "tc-se:first stderr line for 3rd test\n"
203*0a6a1f1dSLionel Sambuc "tc-so:second stdout line for 3rd test\n"
204*0a6a1f1dSLionel Sambuc "tc-se:second stderr line for 3rd test\n"
205*0a6a1f1dSLionel Sambuc "tc-end: 124.1567, third.test, failed, Testing failed reason\n"
206*0a6a1f1dSLionel Sambuc "tp-end: 124.1678, second-prog, This program failed\n"
207*0a6a1f1dSLionel Sambuc ;
208*0a6a1f1dSLionel Sambuc
209*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
210*0a6a1f1dSLionel Sambuc "got_ntps(2)",
211*0a6a1f1dSLionel Sambuc "got_tp_start(first-prog, 3)",
212*0a6a1f1dSLionel Sambuc "got_tc_start(first-test)",
213*0a6a1f1dSLionel Sambuc "got_tc_end(passed)",
214*0a6a1f1dSLionel Sambuc "got_tc_start(second-test)",
215*0a6a1f1dSLionel Sambuc "got_tc_end(skipped, Testing skipped reason)",
216*0a6a1f1dSLionel Sambuc "got_tc_start(third.test)",
217*0a6a1f1dSLionel Sambuc "got_tc_end(failed, Testing failed reason)",
218*0a6a1f1dSLionel Sambuc "got_tp_end()",
219*0a6a1f1dSLionel Sambuc "got_tp_start(second-prog, 3)",
220*0a6a1f1dSLionel Sambuc "got_tc_start(first-test)",
221*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(first stdout line for 1st test)",
222*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(first stderr line for 1st test)",
223*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(second stdout line for 1st test)",
224*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(second stderr line for 1st test)",
225*0a6a1f1dSLionel Sambuc "got_tc_end(passed)",
226*0a6a1f1dSLionel Sambuc "got_tc_start(second-test)",
227*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(first stdout line for 2nd test)",
228*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(first stderr line for 2nd test)",
229*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(second stdout line for 2nd test)",
230*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(second stderr line for 2nd test)",
231*0a6a1f1dSLionel Sambuc "got_tc_end(skipped, Testing skipped reason)",
232*0a6a1f1dSLionel Sambuc "got_tc_start(third.test)",
233*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(first stdout line for 3rd test)",
234*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(first stderr line for 3rd test)",
235*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(second stdout line for 3rd test)",
236*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(second stderr line for 3rd test)",
237*0a6a1f1dSLionel Sambuc "got_tc_end(failed, Testing failed reason)",
238*0a6a1f1dSLionel Sambuc "got_tp_end(This program failed)",
239*0a6a1f1dSLionel Sambuc "got_eof()",
240*0a6a1f1dSLionel Sambuc NULL
241*0a6a1f1dSLionel Sambuc };
242*0a6a1f1dSLionel Sambuc
243*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
244*0a6a1f1dSLionel Sambuc NULL
245*0a6a1f1dSLionel Sambuc };
246*0a6a1f1dSLionel Sambuc
247*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
248*0a6a1f1dSLionel Sambuc }
249*0a6a1f1dSLionel Sambuc
250*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_4);
ATF_TEST_CASE_BODY(tps_4)251*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_4)
252*0a6a1f1dSLionel Sambuc {
253*0a6a1f1dSLionel Sambuc const char* input =
254*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
255*0a6a1f1dSLionel Sambuc "\n"
256*0a6a1f1dSLionel Sambuc "info: a, foo\n"
257*0a6a1f1dSLionel Sambuc "info: b, bar\n"
258*0a6a1f1dSLionel Sambuc "info: c, baz\n"
259*0a6a1f1dSLionel Sambuc "tps-count: 2\n"
260*0a6a1f1dSLionel Sambuc "tp-start: 234.1, first-prog, 3\n"
261*0a6a1f1dSLionel Sambuc "tc-start: 234.12, first-test\n"
262*0a6a1f1dSLionel Sambuc "tc-end: 234.23, first-test, passed\n"
263*0a6a1f1dSLionel Sambuc "tc-start: 234.34, second-test\n"
264*0a6a1f1dSLionel Sambuc "tc-end: 234.45, second-test, skipped, Testing skipped reason\n"
265*0a6a1f1dSLionel Sambuc "tc-start: 234.56, third-test\n"
266*0a6a1f1dSLionel Sambuc "tc-end: 234.67, third-test, failed, Testing failed reason\n"
267*0a6a1f1dSLionel Sambuc "tp-end: 234.78, first-prog\n"
268*0a6a1f1dSLionel Sambuc "tp-start: 234.89, second-prog, 3\n"
269*0a6a1f1dSLionel Sambuc "tc-start: 234.90, first-test\n"
270*0a6a1f1dSLionel Sambuc "tc-so:first stdout line for 1st test\n"
271*0a6a1f1dSLionel Sambuc "tc-se:first stderr line for 1st test\n"
272*0a6a1f1dSLionel Sambuc "tc-so:second stdout line for 1st test\n"
273*0a6a1f1dSLionel Sambuc "tc-se:second stderr line for 1st test\n"
274*0a6a1f1dSLionel Sambuc "tc-end: 234.101, first-test, passed\n"
275*0a6a1f1dSLionel Sambuc "tc-start: 234.112, second-test\n"
276*0a6a1f1dSLionel Sambuc "tc-so:first stdout line for 2nd test\n"
277*0a6a1f1dSLionel Sambuc "tc-se:first stderr line for 2nd test\n"
278*0a6a1f1dSLionel Sambuc "tc-so:second stdout line for 2nd test\n"
279*0a6a1f1dSLionel Sambuc "tc-se:second stderr line for 2nd test\n"
280*0a6a1f1dSLionel Sambuc "tc-end: 234.123, second-test, skipped, Testing skipped reason\n"
281*0a6a1f1dSLionel Sambuc "tc-start: 234.134, third-test\n"
282*0a6a1f1dSLionel Sambuc "tc-so:first stdout line for 3rd test\n"
283*0a6a1f1dSLionel Sambuc "tc-se:first stderr line for 3rd test\n"
284*0a6a1f1dSLionel Sambuc "tc-so:second stdout line for 3rd test\n"
285*0a6a1f1dSLionel Sambuc "tc-se:second stderr line for 3rd test\n"
286*0a6a1f1dSLionel Sambuc "tc-end: 234.145, third-test, failed, Testing failed reason\n"
287*0a6a1f1dSLionel Sambuc "tp-end: 234.156, second-prog, This program failed\n"
288*0a6a1f1dSLionel Sambuc "info: d, foo\n"
289*0a6a1f1dSLionel Sambuc "info: e, bar\n"
290*0a6a1f1dSLionel Sambuc "info: f, baz\n"
291*0a6a1f1dSLionel Sambuc ;
292*0a6a1f1dSLionel Sambuc
293*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
294*0a6a1f1dSLionel Sambuc "got_info(a, foo)",
295*0a6a1f1dSLionel Sambuc "got_info(b, bar)",
296*0a6a1f1dSLionel Sambuc "got_info(c, baz)",
297*0a6a1f1dSLionel Sambuc "got_ntps(2)",
298*0a6a1f1dSLionel Sambuc "got_tp_start(first-prog, 3)",
299*0a6a1f1dSLionel Sambuc "got_tc_start(first-test)",
300*0a6a1f1dSLionel Sambuc "got_tc_end(passed)",
301*0a6a1f1dSLionel Sambuc "got_tc_start(second-test)",
302*0a6a1f1dSLionel Sambuc "got_tc_end(skipped, Testing skipped reason)",
303*0a6a1f1dSLionel Sambuc "got_tc_start(third-test)",
304*0a6a1f1dSLionel Sambuc "got_tc_end(failed, Testing failed reason)",
305*0a6a1f1dSLionel Sambuc "got_tp_end()",
306*0a6a1f1dSLionel Sambuc "got_tp_start(second-prog, 3)",
307*0a6a1f1dSLionel Sambuc "got_tc_start(first-test)",
308*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(first stdout line for 1st test)",
309*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(first stderr line for 1st test)",
310*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(second stdout line for 1st test)",
311*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(second stderr line for 1st test)",
312*0a6a1f1dSLionel Sambuc "got_tc_end(passed)",
313*0a6a1f1dSLionel Sambuc "got_tc_start(second-test)",
314*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(first stdout line for 2nd test)",
315*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(first stderr line for 2nd test)",
316*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(second stdout line for 2nd test)",
317*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(second stderr line for 2nd test)",
318*0a6a1f1dSLionel Sambuc "got_tc_end(skipped, Testing skipped reason)",
319*0a6a1f1dSLionel Sambuc "got_tc_start(third-test)",
320*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(first stdout line for 3rd test)",
321*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(first stderr line for 3rd test)",
322*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(second stdout line for 3rd test)",
323*0a6a1f1dSLionel Sambuc "got_tc_stderr_line(second stderr line for 3rd test)",
324*0a6a1f1dSLionel Sambuc "got_tc_end(failed, Testing failed reason)",
325*0a6a1f1dSLionel Sambuc "got_tp_end(This program failed)",
326*0a6a1f1dSLionel Sambuc "got_info(d, foo)",
327*0a6a1f1dSLionel Sambuc "got_info(e, bar)",
328*0a6a1f1dSLionel Sambuc "got_info(f, baz)",
329*0a6a1f1dSLionel Sambuc "got_eof()",
330*0a6a1f1dSLionel Sambuc NULL
331*0a6a1f1dSLionel Sambuc };
332*0a6a1f1dSLionel Sambuc
333*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
334*0a6a1f1dSLionel Sambuc NULL
335*0a6a1f1dSLionel Sambuc };
336*0a6a1f1dSLionel Sambuc
337*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
338*0a6a1f1dSLionel Sambuc }
339*0a6a1f1dSLionel Sambuc
340*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_5);
ATF_TEST_CASE_BODY(tps_5)341*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_5)
342*0a6a1f1dSLionel Sambuc {
343*0a6a1f1dSLionel Sambuc const char* input =
344*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
345*0a6a1f1dSLionel Sambuc "\n"
346*0a6a1f1dSLionel Sambuc "tps-count: 1\n"
347*0a6a1f1dSLionel Sambuc "tp-start: 345.123, the-prog, 1\n"
348*0a6a1f1dSLionel Sambuc "tc-start: 345.134, the-test\n"
349*0a6a1f1dSLionel Sambuc "tc-so:--- a 2007-11-04 14:00:41.000000000 +0100\n"
350*0a6a1f1dSLionel Sambuc "tc-so:+++ b 2007-11-04 14:00:48.000000000 +0100\n"
351*0a6a1f1dSLionel Sambuc "tc-so:@@ -1,7 +1,7 @@\n"
352*0a6a1f1dSLionel Sambuc "tc-so: This test is meant to simulate a diff.\n"
353*0a6a1f1dSLionel Sambuc "tc-so: Blank space at beginning of context lines must be preserved.\n"
354*0a6a1f1dSLionel Sambuc "tc-so: \n"
355*0a6a1f1dSLionel Sambuc "tc-so:-First original line.\n"
356*0a6a1f1dSLionel Sambuc "tc-so:-Second original line.\n"
357*0a6a1f1dSLionel Sambuc "tc-so:+First modified line.\n"
358*0a6a1f1dSLionel Sambuc "tc-so:+Second modified line.\n"
359*0a6a1f1dSLionel Sambuc "tc-so: \n"
360*0a6a1f1dSLionel Sambuc "tc-so: EOF\n"
361*0a6a1f1dSLionel Sambuc "tc-end: 345.145, the-test, passed\n"
362*0a6a1f1dSLionel Sambuc "tp-end: 345.156, the-prog\n"
363*0a6a1f1dSLionel Sambuc ;
364*0a6a1f1dSLionel Sambuc
365*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_BEGIN
366*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
367*0a6a1f1dSLionel Sambuc "got_ntps(1)",
368*0a6a1f1dSLionel Sambuc "got_tp_start(the-prog, 1)",
369*0a6a1f1dSLionel Sambuc "got_tc_start(the-test)",
370*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(--- a 2007-11-04 14:00:41.000000000 +0100)",
371*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(+++ b 2007-11-04 14:00:48.000000000 +0100)",
372*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(@@ -1,7 +1,7 @@)",
373*0a6a1f1dSLionel Sambuc "got_tc_stdout_line( This test is meant to simulate a diff.)",
374*0a6a1f1dSLionel Sambuc "got_tc_stdout_line( Blank space at beginning of context lines must be preserved.)",
375*0a6a1f1dSLionel Sambuc "got_tc_stdout_line( )",
376*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(-First original line.)",
377*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(-Second original line.)",
378*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(+First modified line.)",
379*0a6a1f1dSLionel Sambuc "got_tc_stdout_line(+Second modified line.)",
380*0a6a1f1dSLionel Sambuc "got_tc_stdout_line( )",
381*0a6a1f1dSLionel Sambuc "got_tc_stdout_line( EOF)",
382*0a6a1f1dSLionel Sambuc "got_tc_end(passed)",
383*0a6a1f1dSLionel Sambuc "got_tp_end()",
384*0a6a1f1dSLionel Sambuc "got_eof()",
385*0a6a1f1dSLionel Sambuc NULL
386*0a6a1f1dSLionel Sambuc };
387*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_END
388*0a6a1f1dSLionel Sambuc
389*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
390*0a6a1f1dSLionel Sambuc NULL
391*0a6a1f1dSLionel Sambuc };
392*0a6a1f1dSLionel Sambuc
393*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
394*0a6a1f1dSLionel Sambuc }
395*0a6a1f1dSLionel Sambuc
396*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_6);
ATF_TEST_CASE_BODY(tps_6)397*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_6)
398*0a6a1f1dSLionel Sambuc {
399*0a6a1f1dSLionel Sambuc const char* input =
400*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
401*0a6a1f1dSLionel Sambuc "\n"
402*0a6a1f1dSLionel Sambuc "tps-count: 1\n"
403*0a6a1f1dSLionel Sambuc "tp-start: 321.1, the-prog, 8\n"
404*0a6a1f1dSLionel Sambuc "tc-start: 321.12, one\n"
405*0a6a1f1dSLionel Sambuc "tc-end: 321.23, one, expected_death, The reason\n"
406*0a6a1f1dSLionel Sambuc "tc-start: 321.34, two\n"
407*0a6a1f1dSLionel Sambuc "tc-end: 321.45, two, expected_exit, This would be an exit\n"
408*0a6a1f1dSLionel Sambuc "tc-start: 321.56, three\n"
409*0a6a1f1dSLionel Sambuc "tc-end: 321.67, three, expected_failure, And this a failure\n"
410*0a6a1f1dSLionel Sambuc "tc-start: 321.78, four\n"
411*0a6a1f1dSLionel Sambuc "tc-end: 321.89, four, expected_signal, And this a signal\n"
412*0a6a1f1dSLionel Sambuc "tc-start: 321.90, five\n"
413*0a6a1f1dSLionel Sambuc "tc-end: 321.101, five, failed, Another reason\n"
414*0a6a1f1dSLionel Sambuc "tc-start: 321.112, six\n"
415*0a6a1f1dSLionel Sambuc "tc-end: 321.123, six, passed\n"
416*0a6a1f1dSLionel Sambuc "tc-start: 321.134, seven\n"
417*0a6a1f1dSLionel Sambuc "tc-end: 321.145, seven, skipped, Skipping it\n"
418*0a6a1f1dSLionel Sambuc "tc-start: 321.156, eight\n"
419*0a6a1f1dSLionel Sambuc "tc-end: 321.167, eight, expected_timeout, Some hang reason\n"
420*0a6a1f1dSLionel Sambuc "tp-end: 321.178, the-prog\n"
421*0a6a1f1dSLionel Sambuc ;
422*0a6a1f1dSLionel Sambuc
423*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_BEGIN
424*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
425*0a6a1f1dSLionel Sambuc "got_ntps(1)",
426*0a6a1f1dSLionel Sambuc "got_tp_start(the-prog, 8)",
427*0a6a1f1dSLionel Sambuc "got_tc_start(one)",
428*0a6a1f1dSLionel Sambuc "got_tc_end(expected_death, The reason)",
429*0a6a1f1dSLionel Sambuc "got_tc_start(two)",
430*0a6a1f1dSLionel Sambuc "got_tc_end(expected_exit, This would be an exit)",
431*0a6a1f1dSLionel Sambuc "got_tc_start(three)",
432*0a6a1f1dSLionel Sambuc "got_tc_end(expected_failure, And this a failure)",
433*0a6a1f1dSLionel Sambuc "got_tc_start(four)",
434*0a6a1f1dSLionel Sambuc "got_tc_end(expected_signal, And this a signal)",
435*0a6a1f1dSLionel Sambuc "got_tc_start(five)",
436*0a6a1f1dSLionel Sambuc "got_tc_end(failed, Another reason)",
437*0a6a1f1dSLionel Sambuc "got_tc_start(six)",
438*0a6a1f1dSLionel Sambuc "got_tc_end(passed)",
439*0a6a1f1dSLionel Sambuc "got_tc_start(seven)",
440*0a6a1f1dSLionel Sambuc "got_tc_end(skipped, Skipping it)",
441*0a6a1f1dSLionel Sambuc "got_tc_start(eight)",
442*0a6a1f1dSLionel Sambuc "got_tc_end(expected_timeout, Some hang reason)",
443*0a6a1f1dSLionel Sambuc "got_tp_end()",
444*0a6a1f1dSLionel Sambuc "got_eof()",
445*0a6a1f1dSLionel Sambuc NULL
446*0a6a1f1dSLionel Sambuc };
447*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_END
448*0a6a1f1dSLionel Sambuc
449*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
450*0a6a1f1dSLionel Sambuc NULL
451*0a6a1f1dSLionel Sambuc };
452*0a6a1f1dSLionel Sambuc
453*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
454*0a6a1f1dSLionel Sambuc }
455*0a6a1f1dSLionel Sambuc
456*0a6a1f1dSLionel Sambuc
457*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_50);
ATF_TEST_CASE_BODY(tps_50)458*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_50)
459*0a6a1f1dSLionel Sambuc {
460*0a6a1f1dSLionel Sambuc const char* input =
461*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
462*0a6a1f1dSLionel Sambuc "\n"
463*0a6a1f1dSLionel Sambuc "foo\n"
464*0a6a1f1dSLionel Sambuc ;
465*0a6a1f1dSLionel Sambuc
466*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
467*0a6a1f1dSLionel Sambuc NULL
468*0a6a1f1dSLionel Sambuc };
469*0a6a1f1dSLionel Sambuc
470*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
471*0a6a1f1dSLionel Sambuc "3: Unexpected token `foo'; expected tps-count or info field",
472*0a6a1f1dSLionel Sambuc NULL
473*0a6a1f1dSLionel Sambuc };
474*0a6a1f1dSLionel Sambuc
475*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
476*0a6a1f1dSLionel Sambuc }
477*0a6a1f1dSLionel Sambuc
478*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_51);
ATF_TEST_CASE_BODY(tps_51)479*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_51)
480*0a6a1f1dSLionel Sambuc {
481*0a6a1f1dSLionel Sambuc const char* input =
482*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
483*0a6a1f1dSLionel Sambuc "\n"
484*0a6a1f1dSLionel Sambuc "tps-count\n"
485*0a6a1f1dSLionel Sambuc ;
486*0a6a1f1dSLionel Sambuc
487*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
488*0a6a1f1dSLionel Sambuc NULL
489*0a6a1f1dSLionel Sambuc };
490*0a6a1f1dSLionel Sambuc
491*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
492*0a6a1f1dSLionel Sambuc "3: Unexpected token `<<NEWLINE>>'; expected `:'",
493*0a6a1f1dSLionel Sambuc NULL
494*0a6a1f1dSLionel Sambuc };
495*0a6a1f1dSLionel Sambuc
496*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
497*0a6a1f1dSLionel Sambuc }
498*0a6a1f1dSLionel Sambuc
499*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_52);
ATF_TEST_CASE_BODY(tps_52)500*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_52)
501*0a6a1f1dSLionel Sambuc {
502*0a6a1f1dSLionel Sambuc const char* input =
503*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
504*0a6a1f1dSLionel Sambuc "\n"
505*0a6a1f1dSLionel Sambuc "tps-count:\n"
506*0a6a1f1dSLionel Sambuc ;
507*0a6a1f1dSLionel Sambuc
508*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
509*0a6a1f1dSLionel Sambuc NULL
510*0a6a1f1dSLionel Sambuc };
511*0a6a1f1dSLionel Sambuc
512*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
513*0a6a1f1dSLionel Sambuc "3: Unexpected token `<<NEWLINE>>'; expected number of test programs",
514*0a6a1f1dSLionel Sambuc NULL
515*0a6a1f1dSLionel Sambuc };
516*0a6a1f1dSLionel Sambuc
517*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
518*0a6a1f1dSLionel Sambuc }
519*0a6a1f1dSLionel Sambuc
520*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_53);
ATF_TEST_CASE_BODY(tps_53)521*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_53)
522*0a6a1f1dSLionel Sambuc {
523*0a6a1f1dSLionel Sambuc const char* input =
524*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
525*0a6a1f1dSLionel Sambuc "\n"
526*0a6a1f1dSLionel Sambuc "tps-count: 1\n"
527*0a6a1f1dSLionel Sambuc "foo\n"
528*0a6a1f1dSLionel Sambuc ;
529*0a6a1f1dSLionel Sambuc
530*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
531*0a6a1f1dSLionel Sambuc "got_ntps(1)",
532*0a6a1f1dSLionel Sambuc NULL
533*0a6a1f1dSLionel Sambuc };
534*0a6a1f1dSLionel Sambuc
535*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
536*0a6a1f1dSLionel Sambuc "4: Unexpected token `foo'; expected start of test program",
537*0a6a1f1dSLionel Sambuc NULL
538*0a6a1f1dSLionel Sambuc };
539*0a6a1f1dSLionel Sambuc
540*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
541*0a6a1f1dSLionel Sambuc }
542*0a6a1f1dSLionel Sambuc
543*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_54);
ATF_TEST_CASE_BODY(tps_54)544*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_54)
545*0a6a1f1dSLionel Sambuc {
546*0a6a1f1dSLionel Sambuc const char* input =
547*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
548*0a6a1f1dSLionel Sambuc "\n"
549*0a6a1f1dSLionel Sambuc "tps-count: 1\n"
550*0a6a1f1dSLionel Sambuc "foo\n"
551*0a6a1f1dSLionel Sambuc "tp-start\n"
552*0a6a1f1dSLionel Sambuc "tp-start:\n"
553*0a6a1f1dSLionel Sambuc "tp-start: 123\n"
554*0a6a1f1dSLionel Sambuc "tp-start: 123.\n"
555*0a6a1f1dSLionel Sambuc "tp-start: 123.456\n"
556*0a6a1f1dSLionel Sambuc "tp-start: 123.456,\n"
557*0a6a1f1dSLionel Sambuc "tp-start: 123.456, foo\n"
558*0a6a1f1dSLionel Sambuc "tp-start: 123.456, foo,\n"
559*0a6a1f1dSLionel Sambuc "tp-start: 123.456, foo, 0\n"
560*0a6a1f1dSLionel Sambuc "bar\n"
561*0a6a1f1dSLionel Sambuc "tp-start: 456.789, foo, 0\n"
562*0a6a1f1dSLionel Sambuc "tp-end\n"
563*0a6a1f1dSLionel Sambuc "tp-start: 777.777, foo, 0\n"
564*0a6a1f1dSLionel Sambuc "tp-end:\n"
565*0a6a1f1dSLionel Sambuc "tp-start: 777.777, foo, 0\n"
566*0a6a1f1dSLionel Sambuc "tp-end: 777\n"
567*0a6a1f1dSLionel Sambuc "tp-start: 777.777, foo, 0\n"
568*0a6a1f1dSLionel Sambuc "tp-end: 777.\n"
569*0a6a1f1dSLionel Sambuc "tp-start: 777.777, foo, 0\n"
570*0a6a1f1dSLionel Sambuc "tp-end: 777.888\n"
571*0a6a1f1dSLionel Sambuc "tp-start: 777.777, foo, 0\n"
572*0a6a1f1dSLionel Sambuc "tp-end: 777.888, \n"
573*0a6a1f1dSLionel Sambuc "tp-start: 777.777, foo, 0\n"
574*0a6a1f1dSLionel Sambuc "tp-end: 777.888, bar\n"
575*0a6a1f1dSLionel Sambuc "tp-start: 777.777, foo, 0\n"
576*0a6a1f1dSLionel Sambuc "tp-end: 777.888, foo,\n"
577*0a6a1f1dSLionel Sambuc ;
578*0a6a1f1dSLionel Sambuc
579*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
580*0a6a1f1dSLionel Sambuc "got_ntps(1)",
581*0a6a1f1dSLionel Sambuc NULL
582*0a6a1f1dSLionel Sambuc };
583*0a6a1f1dSLionel Sambuc
584*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
585*0a6a1f1dSLionel Sambuc "4: Unexpected token `foo'; expected start of test program",
586*0a6a1f1dSLionel Sambuc "5: Unexpected token `<<NEWLINE>>'; expected `:'",
587*0a6a1f1dSLionel Sambuc "6: Unexpected token `<<NEWLINE>>'; expected timestamp",
588*0a6a1f1dSLionel Sambuc "7: Malformed timestamp value 123",
589*0a6a1f1dSLionel Sambuc "8: Malformed timestamp value 123.",
590*0a6a1f1dSLionel Sambuc "9: Unexpected token `<<NEWLINE>>'; expected `,'",
591*0a6a1f1dSLionel Sambuc "10: Unexpected token `<<NEWLINE>>'; expected test program name",
592*0a6a1f1dSLionel Sambuc "11: Unexpected token `<<NEWLINE>>'; expected `,'",
593*0a6a1f1dSLionel Sambuc "12: Unexpected token `<<NEWLINE>>'; expected number of test programs",
594*0a6a1f1dSLionel Sambuc "14: Unexpected token `bar'; expected end of test program",
595*0a6a1f1dSLionel Sambuc "16: Unexpected token `<<NEWLINE>>'; expected `:'",
596*0a6a1f1dSLionel Sambuc "18: Unexpected token `<<NEWLINE>>'; expected timestamp",
597*0a6a1f1dSLionel Sambuc "20: Malformed timestamp value 777",
598*0a6a1f1dSLionel Sambuc "22: Malformed timestamp value 777.",
599*0a6a1f1dSLionel Sambuc "24: Unexpected token `<<NEWLINE>>'; expected `,'",
600*0a6a1f1dSLionel Sambuc
601*0a6a1f1dSLionel Sambuc "26: Unexpected token `<<NEWLINE>>'; expected test program name",
602*0a6a1f1dSLionel Sambuc "28: Test program name used in terminator does not match opening",
603*0a6a1f1dSLionel Sambuc "30: Empty reason for failed test program",
604*0a6a1f1dSLionel Sambuc NULL
605*0a6a1f1dSLionel Sambuc };
606*0a6a1f1dSLionel Sambuc
607*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
608*0a6a1f1dSLionel Sambuc }
609*0a6a1f1dSLionel Sambuc
610*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_55);
ATF_TEST_CASE_BODY(tps_55)611*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_55)
612*0a6a1f1dSLionel Sambuc {
613*0a6a1f1dSLionel Sambuc const char* input =
614*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
615*0a6a1f1dSLionel Sambuc "\n"
616*0a6a1f1dSLionel Sambuc "tps-count: 1\n"
617*0a6a1f1dSLionel Sambuc "tp-start: 100.200, foo, 1\n"
618*0a6a1f1dSLionel Sambuc "foo\n"
619*0a6a1f1dSLionel Sambuc "tc-start\n"
620*0a6a1f1dSLionel Sambuc "tc-start:\n"
621*0a6a1f1dSLionel Sambuc "tc-start: 111\n"
622*0a6a1f1dSLionel Sambuc "tc-start: 111.\n"
623*0a6a1f1dSLionel Sambuc "tc-start: 111.222\n"
624*0a6a1f1dSLionel Sambuc "tc-start: 111.222,\n"
625*0a6a1f1dSLionel Sambuc "tc-start: 111.222, foo\n"
626*0a6a1f1dSLionel Sambuc "bar\n"
627*0a6a1f1dSLionel Sambuc "tc-start: 111.333, foo\n"
628*0a6a1f1dSLionel Sambuc "tc-end\n"
629*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
630*0a6a1f1dSLionel Sambuc "tc-end:\n"
631*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
632*0a6a1f1dSLionel Sambuc "tc-end: 111\n"
633*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
634*0a6a1f1dSLionel Sambuc "tc-end: 111.\n"
635*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
636*0a6a1f1dSLionel Sambuc "tc-end: 111.555\n"
637*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
638*0a6a1f1dSLionel Sambuc "tc-end: 111.555, \n"
639*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
640*0a6a1f1dSLionel Sambuc "tc-end: 111.555, bar\n"
641*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
642*0a6a1f1dSLionel Sambuc "tc-end: 111.555, foo\n"
643*0a6a1f1dSLionel Sambuc "tc-start: 111.444, foo\n"
644*0a6a1f1dSLionel Sambuc "tc-end: 111.555, foo,\n"
645*0a6a1f1dSLionel Sambuc "tp-end: 111.666, foo\n"
646*0a6a1f1dSLionel Sambuc ;
647*0a6a1f1dSLionel Sambuc
648*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
649*0a6a1f1dSLionel Sambuc "got_ntps(1)",
650*0a6a1f1dSLionel Sambuc "got_tp_start(foo, 1)",
651*0a6a1f1dSLionel Sambuc NULL
652*0a6a1f1dSLionel Sambuc };
653*0a6a1f1dSLionel Sambuc
654*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_BEGIN
655*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
656*0a6a1f1dSLionel Sambuc "5: Unexpected token `foo'; expected start of test case",
657*0a6a1f1dSLionel Sambuc "6: Unexpected token `<<NEWLINE>>'; expected `:'",
658*0a6a1f1dSLionel Sambuc "7: Unexpected token `<<NEWLINE>>'; expected timestamp",
659*0a6a1f1dSLionel Sambuc "8: Malformed timestamp value 111",
660*0a6a1f1dSLionel Sambuc "9: Malformed timestamp value 111.",
661*0a6a1f1dSLionel Sambuc "10: Unexpected token `<<NEWLINE>>'; expected `,'",
662*0a6a1f1dSLionel Sambuc "11: Unexpected token `<<NEWLINE>>'; expected test case name",
663*0a6a1f1dSLionel Sambuc "13: Unexpected token `bar'; expected end of test case or test case's stdout/stderr line",
664*0a6a1f1dSLionel Sambuc "15: Unexpected token `<<NEWLINE>>'; expected `:'",
665*0a6a1f1dSLionel Sambuc "17: Unexpected token `<<NEWLINE>>'; expected timestamp",
666*0a6a1f1dSLionel Sambuc "19: Malformed timestamp value 111",
667*0a6a1f1dSLionel Sambuc "21: Malformed timestamp value 111.",
668*0a6a1f1dSLionel Sambuc "23: Unexpected token `<<NEWLINE>>'; expected `,'",
669*0a6a1f1dSLionel Sambuc "25: Unexpected token `<<NEWLINE>>'; expected test case name",
670*0a6a1f1dSLionel Sambuc "27: Test case name used in terminator does not match opening",
671*0a6a1f1dSLionel Sambuc "29: Unexpected token `<<NEWLINE>>'; expected `,'",
672*0a6a1f1dSLionel Sambuc "31: Unexpected token `<<NEWLINE>>'; expected expected_{death,exit,failure,signal,timeout}, failed, passed or skipped",
673*0a6a1f1dSLionel Sambuc "32: Unexpected token `tp-end'; expected start of test case",
674*0a6a1f1dSLionel Sambuc NULL
675*0a6a1f1dSLionel Sambuc };
676*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_END
677*0a6a1f1dSLionel Sambuc
678*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
679*0a6a1f1dSLionel Sambuc }
680*0a6a1f1dSLionel Sambuc
681*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_56);
ATF_TEST_CASE_BODY(tps_56)682*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_56)
683*0a6a1f1dSLionel Sambuc {
684*0a6a1f1dSLionel Sambuc const char* input =
685*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
686*0a6a1f1dSLionel Sambuc "\n"
687*0a6a1f1dSLionel Sambuc "tps-count: 1\n"
688*0a6a1f1dSLionel Sambuc "tp-start: 111.222, foo, 1\n"
689*0a6a1f1dSLionel Sambuc "tc-start: 111.333, foo\n"
690*0a6a1f1dSLionel Sambuc "tc-end: 111.444, foo, passe\n"
691*0a6a1f1dSLionel Sambuc "tc-start: 111.333, foo\n"
692*0a6a1f1dSLionel Sambuc "tc-end: 111.444, foo, passed,\n"
693*0a6a1f1dSLionel Sambuc "tc-start: 111.555, bar\n"
694*0a6a1f1dSLionel Sambuc "tc-end: 111.666, bar, failed\n"
695*0a6a1f1dSLionel Sambuc "tc-start: 111.555, bar\n"
696*0a6a1f1dSLionel Sambuc "tc-end: 111.666, bar, failed,\n"
697*0a6a1f1dSLionel Sambuc "tc-start: 111.555, baz\n"
698*0a6a1f1dSLionel Sambuc "tc-end: 111.666, baz, skipped\n"
699*0a6a1f1dSLionel Sambuc "tc-start: 111.555, baz\n"
700*0a6a1f1dSLionel Sambuc "tc-end: 111.666, baz, skipped,\n"
701*0a6a1f1dSLionel Sambuc "tp-end: 111.777, foo\n"
702*0a6a1f1dSLionel Sambuc ;
703*0a6a1f1dSLionel Sambuc
704*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
705*0a6a1f1dSLionel Sambuc "got_ntps(1)",
706*0a6a1f1dSLionel Sambuc "got_tp_start(foo, 1)",
707*0a6a1f1dSLionel Sambuc "got_tc_start(foo)",
708*0a6a1f1dSLionel Sambuc NULL
709*0a6a1f1dSLionel Sambuc };
710*0a6a1f1dSLionel Sambuc
711*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_BEGIN
712*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
713*0a6a1f1dSLionel Sambuc "6: Unexpected token `passe'; expected expected_{death,exit,failure,signal,timeout}, failed, passed or skipped",
714*0a6a1f1dSLionel Sambuc "8: Unexpected token `,'; expected new line",
715*0a6a1f1dSLionel Sambuc "10: Unexpected token `<<NEWLINE>>'; expected `,'",
716*0a6a1f1dSLionel Sambuc "12: Empty reason for failed test case result",
717*0a6a1f1dSLionel Sambuc "14: Unexpected token `<<NEWLINE>>'; expected `,'",
718*0a6a1f1dSLionel Sambuc "16: Empty reason for skipped test case result",
719*0a6a1f1dSLionel Sambuc "17: Unexpected token `tp-end'; expected start of test case",
720*0a6a1f1dSLionel Sambuc NULL
721*0a6a1f1dSLionel Sambuc };
722*0a6a1f1dSLionel Sambuc // NO_CHECK_STYLE_END
723*0a6a1f1dSLionel Sambuc
724*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
725*0a6a1f1dSLionel Sambuc }
726*0a6a1f1dSLionel Sambuc
727*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_57);
ATF_TEST_CASE_BODY(tps_57)728*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_57)
729*0a6a1f1dSLionel Sambuc {
730*0a6a1f1dSLionel Sambuc const char* input =
731*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
732*0a6a1f1dSLionel Sambuc "\n"
733*0a6a1f1dSLionel Sambuc "tps-count: 2\n"
734*0a6a1f1dSLionel Sambuc "tp-start: 111.222, foo, 0\n"
735*0a6a1f1dSLionel Sambuc "tp-end: 111.333, foo\n"
736*0a6a1f1dSLionel Sambuc ;
737*0a6a1f1dSLionel Sambuc
738*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
739*0a6a1f1dSLionel Sambuc "got_ntps(2)",
740*0a6a1f1dSLionel Sambuc "got_tp_start(foo, 0)",
741*0a6a1f1dSLionel Sambuc "got_tp_end()",
742*0a6a1f1dSLionel Sambuc NULL
743*0a6a1f1dSLionel Sambuc };
744*0a6a1f1dSLionel Sambuc
745*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
746*0a6a1f1dSLionel Sambuc "6: Unexpected token `<<EOF>>'; expected start of test program",
747*0a6a1f1dSLionel Sambuc NULL
748*0a6a1f1dSLionel Sambuc };
749*0a6a1f1dSLionel Sambuc
750*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
751*0a6a1f1dSLionel Sambuc }
752*0a6a1f1dSLionel Sambuc
753*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_58);
ATF_TEST_CASE_BODY(tps_58)754*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_58)
755*0a6a1f1dSLionel Sambuc {
756*0a6a1f1dSLionel Sambuc const char* input =
757*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
758*0a6a1f1dSLionel Sambuc "\n"
759*0a6a1f1dSLionel Sambuc "tps-count: 1\n"
760*0a6a1f1dSLionel Sambuc "tp-start: 111.222, foo, 0\n"
761*0a6a1f1dSLionel Sambuc "tp-end: 111.333, foo\n"
762*0a6a1f1dSLionel Sambuc "tp-start: 111.444, bar, 0\n"
763*0a6a1f1dSLionel Sambuc "tp-end: 111.555, bar\n"
764*0a6a1f1dSLionel Sambuc ;
765*0a6a1f1dSLionel Sambuc
766*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
767*0a6a1f1dSLionel Sambuc "got_ntps(1)",
768*0a6a1f1dSLionel Sambuc "got_tp_start(foo, 0)",
769*0a6a1f1dSLionel Sambuc "got_tp_end()",
770*0a6a1f1dSLionel Sambuc NULL
771*0a6a1f1dSLionel Sambuc };
772*0a6a1f1dSLionel Sambuc
773*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
774*0a6a1f1dSLionel Sambuc "6: Unexpected token `tp-start'; expected end of stream or info field",
775*0a6a1f1dSLionel Sambuc NULL
776*0a6a1f1dSLionel Sambuc };
777*0a6a1f1dSLionel Sambuc
778*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
779*0a6a1f1dSLionel Sambuc }
780*0a6a1f1dSLionel Sambuc
781*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_59);
ATF_TEST_CASE_BODY(tps_59)782*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_59)
783*0a6a1f1dSLionel Sambuc {
784*0a6a1f1dSLionel Sambuc const char* input =
785*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
786*0a6a1f1dSLionel Sambuc "\n"
787*0a6a1f1dSLionel Sambuc "info\n"
788*0a6a1f1dSLionel Sambuc ;
789*0a6a1f1dSLionel Sambuc
790*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
791*0a6a1f1dSLionel Sambuc NULL
792*0a6a1f1dSLionel Sambuc };
793*0a6a1f1dSLionel Sambuc
794*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
795*0a6a1f1dSLionel Sambuc "3: Unexpected token `<<NEWLINE>>'; expected `:'",
796*0a6a1f1dSLionel Sambuc NULL
797*0a6a1f1dSLionel Sambuc };
798*0a6a1f1dSLionel Sambuc
799*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
800*0a6a1f1dSLionel Sambuc }
801*0a6a1f1dSLionel Sambuc
802*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_60);
ATF_TEST_CASE_BODY(tps_60)803*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_60)
804*0a6a1f1dSLionel Sambuc {
805*0a6a1f1dSLionel Sambuc const char* input =
806*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
807*0a6a1f1dSLionel Sambuc "\n"
808*0a6a1f1dSLionel Sambuc "info:\n"
809*0a6a1f1dSLionel Sambuc ;
810*0a6a1f1dSLionel Sambuc
811*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
812*0a6a1f1dSLionel Sambuc NULL
813*0a6a1f1dSLionel Sambuc };
814*0a6a1f1dSLionel Sambuc
815*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
816*0a6a1f1dSLionel Sambuc "3: Unexpected token `<<NEWLINE>>'; expected info property name",
817*0a6a1f1dSLionel Sambuc NULL
818*0a6a1f1dSLionel Sambuc };
819*0a6a1f1dSLionel Sambuc
820*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
821*0a6a1f1dSLionel Sambuc }
822*0a6a1f1dSLionel Sambuc
823*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_61);
ATF_TEST_CASE_BODY(tps_61)824*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_61)
825*0a6a1f1dSLionel Sambuc {
826*0a6a1f1dSLionel Sambuc const char* input =
827*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
828*0a6a1f1dSLionel Sambuc "\n"
829*0a6a1f1dSLionel Sambuc "info: a\n"
830*0a6a1f1dSLionel Sambuc ;
831*0a6a1f1dSLionel Sambuc
832*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
833*0a6a1f1dSLionel Sambuc NULL
834*0a6a1f1dSLionel Sambuc };
835*0a6a1f1dSLionel Sambuc
836*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
837*0a6a1f1dSLionel Sambuc "3: Unexpected token `<<NEWLINE>>'; expected `,'",
838*0a6a1f1dSLionel Sambuc NULL
839*0a6a1f1dSLionel Sambuc };
840*0a6a1f1dSLionel Sambuc
841*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
842*0a6a1f1dSLionel Sambuc }
843*0a6a1f1dSLionel Sambuc
844*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_62);
ATF_TEST_CASE_BODY(tps_62)845*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_62)
846*0a6a1f1dSLionel Sambuc {
847*0a6a1f1dSLionel Sambuc const char* input =
848*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
849*0a6a1f1dSLionel Sambuc "\n"
850*0a6a1f1dSLionel Sambuc "info: a,\n"
851*0a6a1f1dSLionel Sambuc ;
852*0a6a1f1dSLionel Sambuc
853*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
854*0a6a1f1dSLionel Sambuc "got_info(a, )",
855*0a6a1f1dSLionel Sambuc NULL
856*0a6a1f1dSLionel Sambuc };
857*0a6a1f1dSLionel Sambuc
858*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
859*0a6a1f1dSLionel Sambuc "4: Unexpected token `<<EOF>>'; expected tps-count or info field",
860*0a6a1f1dSLionel Sambuc NULL
861*0a6a1f1dSLionel Sambuc };
862*0a6a1f1dSLionel Sambuc
863*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
864*0a6a1f1dSLionel Sambuc }
865*0a6a1f1dSLionel Sambuc
866*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_63);
ATF_TEST_CASE_BODY(tps_63)867*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_63)
868*0a6a1f1dSLionel Sambuc {
869*0a6a1f1dSLionel Sambuc const char* input =
870*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
871*0a6a1f1dSLionel Sambuc "\n"
872*0a6a1f1dSLionel Sambuc "info: a, b\n"
873*0a6a1f1dSLionel Sambuc ;
874*0a6a1f1dSLionel Sambuc
875*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
876*0a6a1f1dSLionel Sambuc "got_info(a, b)",
877*0a6a1f1dSLionel Sambuc NULL
878*0a6a1f1dSLionel Sambuc };
879*0a6a1f1dSLionel Sambuc
880*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
881*0a6a1f1dSLionel Sambuc "4: Unexpected token `<<EOF>>'; expected tps-count or info field",
882*0a6a1f1dSLionel Sambuc NULL
883*0a6a1f1dSLionel Sambuc };
884*0a6a1f1dSLionel Sambuc
885*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
886*0a6a1f1dSLionel Sambuc }
887*0a6a1f1dSLionel Sambuc
888*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_64);
ATF_TEST_CASE_BODY(tps_64)889*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_64)
890*0a6a1f1dSLionel Sambuc {
891*0a6a1f1dSLionel Sambuc const char* input =
892*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
893*0a6a1f1dSLionel Sambuc "\n"
894*0a6a1f1dSLionel Sambuc "info: a, b\n"
895*0a6a1f1dSLionel Sambuc "info: a.b.c.def, g\n"
896*0a6a1f1dSLionel Sambuc "tps-count\n"
897*0a6a1f1dSLionel Sambuc ;
898*0a6a1f1dSLionel Sambuc
899*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
900*0a6a1f1dSLionel Sambuc "got_info(a, b)",
901*0a6a1f1dSLionel Sambuc "got_info(a.b.c.def, g)",
902*0a6a1f1dSLionel Sambuc NULL
903*0a6a1f1dSLionel Sambuc };
904*0a6a1f1dSLionel Sambuc
905*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
906*0a6a1f1dSLionel Sambuc "5: Unexpected token `<<NEWLINE>>'; expected `:'",
907*0a6a1f1dSLionel Sambuc NULL
908*0a6a1f1dSLionel Sambuc };
909*0a6a1f1dSLionel Sambuc
910*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
911*0a6a1f1dSLionel Sambuc }
912*0a6a1f1dSLionel Sambuc
913*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_65);
ATF_TEST_CASE_BODY(tps_65)914*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_65)
915*0a6a1f1dSLionel Sambuc {
916*0a6a1f1dSLionel Sambuc const char* input =
917*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
918*0a6a1f1dSLionel Sambuc "\n"
919*0a6a1f1dSLionel Sambuc "info: a, b\n"
920*0a6a1f1dSLionel Sambuc "tps-count:\n"
921*0a6a1f1dSLionel Sambuc ;
922*0a6a1f1dSLionel Sambuc
923*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
924*0a6a1f1dSLionel Sambuc "got_info(a, b)",
925*0a6a1f1dSLionel Sambuc NULL
926*0a6a1f1dSLionel Sambuc };
927*0a6a1f1dSLionel Sambuc
928*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
929*0a6a1f1dSLionel Sambuc "4: Unexpected token `<<NEWLINE>>'; expected number of test programs",
930*0a6a1f1dSLionel Sambuc NULL
931*0a6a1f1dSLionel Sambuc };
932*0a6a1f1dSLionel Sambuc
933*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
934*0a6a1f1dSLionel Sambuc }
935*0a6a1f1dSLionel Sambuc
936*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_WITHOUT_HEAD(tps_66);
ATF_TEST_CASE_BODY(tps_66)937*0a6a1f1dSLionel Sambuc ATF_TEST_CASE_BODY(tps_66)
938*0a6a1f1dSLionel Sambuc {
939*0a6a1f1dSLionel Sambuc const char* input =
940*0a6a1f1dSLionel Sambuc "Content-Type: application/X-atf-tps; version=\"3\"\n"
941*0a6a1f1dSLionel Sambuc "\n"
942*0a6a1f1dSLionel Sambuc "info: a, b\n"
943*0a6a1f1dSLionel Sambuc "tps-count: 0\n"
944*0a6a1f1dSLionel Sambuc "info\n"
945*0a6a1f1dSLionel Sambuc ;
946*0a6a1f1dSLionel Sambuc
947*0a6a1f1dSLionel Sambuc const char* exp_calls[] = {
948*0a6a1f1dSLionel Sambuc "got_info(a, b)",
949*0a6a1f1dSLionel Sambuc "got_ntps(0)",
950*0a6a1f1dSLionel Sambuc NULL
951*0a6a1f1dSLionel Sambuc };
952*0a6a1f1dSLionel Sambuc
953*0a6a1f1dSLionel Sambuc const char* exp_errors[] = {
954*0a6a1f1dSLionel Sambuc "5: Unexpected token `<<NEWLINE>>'; expected `:'",
955*0a6a1f1dSLionel Sambuc NULL
956*0a6a1f1dSLionel Sambuc };
957*0a6a1f1dSLionel Sambuc
958*0a6a1f1dSLionel Sambuc do_parser_test< tps_reader >(input, exp_calls, exp_errors);
959*0a6a1f1dSLionel Sambuc }
960*0a6a1f1dSLionel Sambuc
ATF_INIT_TEST_CASES(tcs)961*0a6a1f1dSLionel Sambuc ATF_INIT_TEST_CASES(tcs)
962*0a6a1f1dSLionel Sambuc {
963*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_1);
964*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_2);
965*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_3);
966*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_4);
967*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_5);
968*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_6);
969*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_50);
970*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_51);
971*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_52);
972*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_53);
973*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_54);
974*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_55);
975*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_56);
976*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_57);
977*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_58);
978*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_59);
979*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_60);
980*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_61);
981*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_62);
982*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_63);
983*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_64);
984*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_65);
985*0a6a1f1dSLionel Sambuc ATF_ADD_TEST_CASE(tcs, tps_66);
986*0a6a1f1dSLionel Sambuc }
987*0a6a1f1dSLionel Sambuc
988