2 // Automated Testing Framework (atf)
4 // Copyright (c) 2010 The NetBSD Foundation, Inc.
5 // All rights reserved.
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
10 // 1. Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 // 2. Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
16 // THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
17 // CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
18 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 // IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
21 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
23 // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
25 // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
27 // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 #include <atf-c++.hpp>
40 #include "test_helpers.hpp"
43 namespace impl
= tools::atf_report
;
45 class tps_reader
: protected impl::atf_tps_reader
{
47 got_info(const std::string
& what
, const std::string
& val
)
49 m_calls
.push_back("got_info(" + what
+ ", " + val
+ ")");
55 m_calls
.push_back("got_ntps(" + tools::text::to_string(ntps
) + ")");
59 got_tp_start(const std::string
& tpname
, size_t ntcs
)
61 m_calls
.push_back("got_tp_start(" + tpname
+ ", " +
62 tools::text::to_string(ntcs
) + ")");
66 got_tp_end(struct timeval
* tv
__attribute__((__unused__
)),
67 const std::string
& reason
)
69 m_calls
.push_back("got_tp_end(" + reason
+ ")");
73 got_tc_start(const std::string
& tcname
)
75 m_calls
.push_back("got_tc_start(" + tcname
+ ")");
79 got_tc_end(const std::string
& state
,
80 struct timeval
* tv
__attribute__((__unused__
)),
81 const std::string
& reason
)
83 const std::string r
= state
+ (reason
.empty() ? "" : ", " + reason
);
84 m_calls
.push_back("got_tc_end(" + r
+ ")");
88 got_tc_stdout_line(const std::string
& line
)
90 m_calls
.push_back("got_tc_stdout_line(" + line
+ ")");
94 got_tc_stderr_line(const std::string
& line
)
96 m_calls
.push_back("got_tc_stderr_line(" + line
+ ")");
102 m_calls
.push_back("got_eof()");
106 tps_reader(std::istream
& is
) :
107 impl::atf_tps_reader(is
)
114 atf_tps_reader::read();
117 std::vector
< std::string
> m_calls
;
120 ATF_TEST_CASE_WITHOUT_HEAD(tps_1
);
121 ATF_TEST_CASE_BODY(tps_1
)
124 "Content-Type: application/X-atf-tps; version=\"3\"\n"
129 const char* exp_calls
[] = {
135 const char* exp_errors
[] = {
139 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
142 ATF_TEST_CASE_WITHOUT_HEAD(tps_2
);
143 ATF_TEST_CASE_BODY(tps_2
)
146 "Content-Type: application/X-atf-tps; version=\"3\"\n"
149 "tp-start: 123.456, first-prog, 0\n"
150 "tp-end: 123.567, first-prog\n"
151 "tp-start: 123.678, second-prog, 0\n"
152 "tp-end: 123.789, second-prog, This program failed\n"
155 const char* exp_calls
[] = {
157 "got_tp_start(first-prog, 0)",
159 "got_tp_start(second-prog, 0)",
160 "got_tp_end(This program failed)",
165 const char* exp_errors
[] = {
169 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
172 ATF_TEST_CASE_WITHOUT_HEAD(tps_3
);
173 ATF_TEST_CASE_BODY(tps_3
)
176 "Content-Type: application/X-atf-tps; version=\"3\"\n"
179 "tp-start: 123.123, first-prog, 3\n"
180 "tc-start: 123.234, first-test\n"
181 "tc-end: 123.345, first-test, passed\n"
182 "tc-start: 123.456, second-test\n"
183 "tc-end: 123.567, second-test, skipped, Testing skipped reason\n"
184 "tc-start: 123.678, third.test\n"
185 "tc-end: 123.789, third.test, failed, Testing failed reason\n"
186 "tp-end: 123.890, first-prog\n"
187 "tp-start: 124.901, second-prog, 3\n"
188 "tc-start: 124.1012, first-test\n"
189 "tc-so:first stdout line for 1st test\n"
190 "tc-se:first stderr line for 1st test\n"
191 "tc-so:second stdout line for 1st test\n"
192 "tc-se:second stderr line for 1st test\n"
193 "tc-end: 124.1123, first-test, passed\n"
194 "tc-start: 124.1234, second-test\n"
195 "tc-so:first stdout line for 2nd test\n"
196 "tc-se:first stderr line for 2nd test\n"
197 "tc-so:second stdout line for 2nd test\n"
198 "tc-se:second stderr line for 2nd test\n"
199 "tc-end: 124.1345, second-test, skipped, Testing skipped reason\n"
200 "tc-start: 124.1456, third.test\n"
201 "tc-so:first stdout line for 3rd test\n"
202 "tc-se:first stderr line for 3rd test\n"
203 "tc-so:second stdout line for 3rd test\n"
204 "tc-se:second stderr line for 3rd test\n"
205 "tc-end: 124.1567, third.test, failed, Testing failed reason\n"
206 "tp-end: 124.1678, second-prog, This program failed\n"
209 const char* exp_calls
[] = {
211 "got_tp_start(first-prog, 3)",
212 "got_tc_start(first-test)",
213 "got_tc_end(passed)",
214 "got_tc_start(second-test)",
215 "got_tc_end(skipped, Testing skipped reason)",
216 "got_tc_start(third.test)",
217 "got_tc_end(failed, Testing failed reason)",
219 "got_tp_start(second-prog, 3)",
220 "got_tc_start(first-test)",
221 "got_tc_stdout_line(first stdout line for 1st test)",
222 "got_tc_stderr_line(first stderr line for 1st test)",
223 "got_tc_stdout_line(second stdout line for 1st test)",
224 "got_tc_stderr_line(second stderr line for 1st test)",
225 "got_tc_end(passed)",
226 "got_tc_start(second-test)",
227 "got_tc_stdout_line(first stdout line for 2nd test)",
228 "got_tc_stderr_line(first stderr line for 2nd test)",
229 "got_tc_stdout_line(second stdout line for 2nd test)",
230 "got_tc_stderr_line(second stderr line for 2nd test)",
231 "got_tc_end(skipped, Testing skipped reason)",
232 "got_tc_start(third.test)",
233 "got_tc_stdout_line(first stdout line for 3rd test)",
234 "got_tc_stderr_line(first stderr line for 3rd test)",
235 "got_tc_stdout_line(second stdout line for 3rd test)",
236 "got_tc_stderr_line(second stderr line for 3rd test)",
237 "got_tc_end(failed, Testing failed reason)",
238 "got_tp_end(This program failed)",
243 const char* exp_errors
[] = {
247 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
250 ATF_TEST_CASE_WITHOUT_HEAD(tps_4
);
251 ATF_TEST_CASE_BODY(tps_4
)
254 "Content-Type: application/X-atf-tps; version=\"3\"\n"
260 "tp-start: 234.1, first-prog, 3\n"
261 "tc-start: 234.12, first-test\n"
262 "tc-end: 234.23, first-test, passed\n"
263 "tc-start: 234.34, second-test\n"
264 "tc-end: 234.45, second-test, skipped, Testing skipped reason\n"
265 "tc-start: 234.56, third-test\n"
266 "tc-end: 234.67, third-test, failed, Testing failed reason\n"
267 "tp-end: 234.78, first-prog\n"
268 "tp-start: 234.89, second-prog, 3\n"
269 "tc-start: 234.90, first-test\n"
270 "tc-so:first stdout line for 1st test\n"
271 "tc-se:first stderr line for 1st test\n"
272 "tc-so:second stdout line for 1st test\n"
273 "tc-se:second stderr line for 1st test\n"
274 "tc-end: 234.101, first-test, passed\n"
275 "tc-start: 234.112, second-test\n"
276 "tc-so:first stdout line for 2nd test\n"
277 "tc-se:first stderr line for 2nd test\n"
278 "tc-so:second stdout line for 2nd test\n"
279 "tc-se:second stderr line for 2nd test\n"
280 "tc-end: 234.123, second-test, skipped, Testing skipped reason\n"
281 "tc-start: 234.134, third-test\n"
282 "tc-so:first stdout line for 3rd test\n"
283 "tc-se:first stderr line for 3rd test\n"
284 "tc-so:second stdout line for 3rd test\n"
285 "tc-se:second stderr line for 3rd test\n"
286 "tc-end: 234.145, third-test, failed, Testing failed reason\n"
287 "tp-end: 234.156, second-prog, This program failed\n"
293 const char* exp_calls
[] = {
298 "got_tp_start(first-prog, 3)",
299 "got_tc_start(first-test)",
300 "got_tc_end(passed)",
301 "got_tc_start(second-test)",
302 "got_tc_end(skipped, Testing skipped reason)",
303 "got_tc_start(third-test)",
304 "got_tc_end(failed, Testing failed reason)",
306 "got_tp_start(second-prog, 3)",
307 "got_tc_start(first-test)",
308 "got_tc_stdout_line(first stdout line for 1st test)",
309 "got_tc_stderr_line(first stderr line for 1st test)",
310 "got_tc_stdout_line(second stdout line for 1st test)",
311 "got_tc_stderr_line(second stderr line for 1st test)",
312 "got_tc_end(passed)",
313 "got_tc_start(second-test)",
314 "got_tc_stdout_line(first stdout line for 2nd test)",
315 "got_tc_stderr_line(first stderr line for 2nd test)",
316 "got_tc_stdout_line(second stdout line for 2nd test)",
317 "got_tc_stderr_line(second stderr line for 2nd test)",
318 "got_tc_end(skipped, Testing skipped reason)",
319 "got_tc_start(third-test)",
320 "got_tc_stdout_line(first stdout line for 3rd test)",
321 "got_tc_stderr_line(first stderr line for 3rd test)",
322 "got_tc_stdout_line(second stdout line for 3rd test)",
323 "got_tc_stderr_line(second stderr line for 3rd test)",
324 "got_tc_end(failed, Testing failed reason)",
325 "got_tp_end(This program failed)",
333 const char* exp_errors
[] = {
337 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
340 ATF_TEST_CASE_WITHOUT_HEAD(tps_5
);
341 ATF_TEST_CASE_BODY(tps_5
)
344 "Content-Type: application/X-atf-tps; version=\"3\"\n"
347 "tp-start: 345.123, the-prog, 1\n"
348 "tc-start: 345.134, the-test\n"
349 "tc-so:--- a 2007-11-04 14:00:41.000000000 +0100\n"
350 "tc-so:+++ b 2007-11-04 14:00:48.000000000 +0100\n"
351 "tc-so:@@ -1,7 +1,7 @@\n"
352 "tc-so: This test is meant to simulate a diff.\n"
353 "tc-so: Blank space at beginning of context lines must be preserved.\n"
355 "tc-so:-First original line.\n"
356 "tc-so:-Second original line.\n"
357 "tc-so:+First modified line.\n"
358 "tc-so:+Second modified line.\n"
361 "tc-end: 345.145, the-test, passed\n"
362 "tp-end: 345.156, the-prog\n"
365 // NO_CHECK_STYLE_BEGIN
366 const char* exp_calls
[] = {
368 "got_tp_start(the-prog, 1)",
369 "got_tc_start(the-test)",
370 "got_tc_stdout_line(--- a 2007-11-04 14:00:41.000000000 +0100)",
371 "got_tc_stdout_line(+++ b 2007-11-04 14:00:48.000000000 +0100)",
372 "got_tc_stdout_line(@@ -1,7 +1,7 @@)",
373 "got_tc_stdout_line( This test is meant to simulate a diff.)",
374 "got_tc_stdout_line( Blank space at beginning of context lines must be preserved.)",
375 "got_tc_stdout_line( )",
376 "got_tc_stdout_line(-First original line.)",
377 "got_tc_stdout_line(-Second original line.)",
378 "got_tc_stdout_line(+First modified line.)",
379 "got_tc_stdout_line(+Second modified line.)",
380 "got_tc_stdout_line( )",
381 "got_tc_stdout_line( EOF)",
382 "got_tc_end(passed)",
387 // NO_CHECK_STYLE_END
389 const char* exp_errors
[] = {
393 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
396 ATF_TEST_CASE_WITHOUT_HEAD(tps_6
);
397 ATF_TEST_CASE_BODY(tps_6
)
400 "Content-Type: application/X-atf-tps; version=\"3\"\n"
403 "tp-start: 321.1, the-prog, 8\n"
404 "tc-start: 321.12, one\n"
405 "tc-end: 321.23, one, expected_death, The reason\n"
406 "tc-start: 321.34, two\n"
407 "tc-end: 321.45, two, expected_exit, This would be an exit\n"
408 "tc-start: 321.56, three\n"
409 "tc-end: 321.67, three, expected_failure, And this a failure\n"
410 "tc-start: 321.78, four\n"
411 "tc-end: 321.89, four, expected_signal, And this a signal\n"
412 "tc-start: 321.90, five\n"
413 "tc-end: 321.101, five, failed, Another reason\n"
414 "tc-start: 321.112, six\n"
415 "tc-end: 321.123, six, passed\n"
416 "tc-start: 321.134, seven\n"
417 "tc-end: 321.145, seven, skipped, Skipping it\n"
418 "tc-start: 321.156, eight\n"
419 "tc-end: 321.167, eight, expected_timeout, Some hang reason\n"
420 "tp-end: 321.178, the-prog\n"
423 // NO_CHECK_STYLE_BEGIN
424 const char* exp_calls
[] = {
426 "got_tp_start(the-prog, 8)",
428 "got_tc_end(expected_death, The reason)",
430 "got_tc_end(expected_exit, This would be an exit)",
431 "got_tc_start(three)",
432 "got_tc_end(expected_failure, And this a failure)",
433 "got_tc_start(four)",
434 "got_tc_end(expected_signal, And this a signal)",
435 "got_tc_start(five)",
436 "got_tc_end(failed, Another reason)",
438 "got_tc_end(passed)",
439 "got_tc_start(seven)",
440 "got_tc_end(skipped, Skipping it)",
441 "got_tc_start(eight)",
442 "got_tc_end(expected_timeout, Some hang reason)",
447 // NO_CHECK_STYLE_END
449 const char* exp_errors
[] = {
453 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
457 ATF_TEST_CASE_WITHOUT_HEAD(tps_50
);
458 ATF_TEST_CASE_BODY(tps_50
)
461 "Content-Type: application/X-atf-tps; version=\"3\"\n"
466 const char* exp_calls
[] = {
470 const char* exp_errors
[] = {
471 "3: Unexpected token `foo'; expected tps-count or info field",
475 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
478 ATF_TEST_CASE_WITHOUT_HEAD(tps_51
);
479 ATF_TEST_CASE_BODY(tps_51
)
482 "Content-Type: application/X-atf-tps; version=\"3\"\n"
487 const char* exp_calls
[] = {
491 const char* exp_errors
[] = {
492 "3: Unexpected token `<<NEWLINE>>'; expected `:'",
496 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
499 ATF_TEST_CASE_WITHOUT_HEAD(tps_52
);
500 ATF_TEST_CASE_BODY(tps_52
)
503 "Content-Type: application/X-atf-tps; version=\"3\"\n"
508 const char* exp_calls
[] = {
512 const char* exp_errors
[] = {
513 "3: Unexpected token `<<NEWLINE>>'; expected number of test programs",
517 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
520 ATF_TEST_CASE_WITHOUT_HEAD(tps_53
);
521 ATF_TEST_CASE_BODY(tps_53
)
524 "Content-Type: application/X-atf-tps; version=\"3\"\n"
530 const char* exp_calls
[] = {
535 const char* exp_errors
[] = {
536 "4: Unexpected token `foo'; expected start of test program",
540 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
543 ATF_TEST_CASE_WITHOUT_HEAD(tps_54
);
544 ATF_TEST_CASE_BODY(tps_54
)
547 "Content-Type: application/X-atf-tps; version=\"3\"\n"
555 "tp-start: 123.456\n"
556 "tp-start: 123.456,\n"
557 "tp-start: 123.456, foo\n"
558 "tp-start: 123.456, foo,\n"
559 "tp-start: 123.456, foo, 0\n"
561 "tp-start: 456.789, foo, 0\n"
563 "tp-start: 777.777, foo, 0\n"
565 "tp-start: 777.777, foo, 0\n"
567 "tp-start: 777.777, foo, 0\n"
569 "tp-start: 777.777, foo, 0\n"
571 "tp-start: 777.777, foo, 0\n"
572 "tp-end: 777.888, \n"
573 "tp-start: 777.777, foo, 0\n"
574 "tp-end: 777.888, bar\n"
575 "tp-start: 777.777, foo, 0\n"
576 "tp-end: 777.888, foo,\n"
579 const char* exp_calls
[] = {
584 const char* exp_errors
[] = {
585 "4: Unexpected token `foo'; expected start of test program",
586 "5: Unexpected token `<<NEWLINE>>'; expected `:'",
587 "6: Unexpected token `<<NEWLINE>>'; expected timestamp",
588 "7: Malformed timestamp value 123",
589 "8: Malformed timestamp value 123.",
590 "9: Unexpected token `<<NEWLINE>>'; expected `,'",
591 "10: Unexpected token `<<NEWLINE>>'; expected test program name",
592 "11: Unexpected token `<<NEWLINE>>'; expected `,'",
593 "12: Unexpected token `<<NEWLINE>>'; expected number of test programs",
594 "14: Unexpected token `bar'; expected end of test program",
595 "16: Unexpected token `<<NEWLINE>>'; expected `:'",
596 "18: Unexpected token `<<NEWLINE>>'; expected timestamp",
597 "20: Malformed timestamp value 777",
598 "22: Malformed timestamp value 777.",
599 "24: Unexpected token `<<NEWLINE>>'; expected `,'",
601 "26: Unexpected token `<<NEWLINE>>'; expected test program name",
602 "28: Test program name used in terminator does not match opening",
603 "30: Empty reason for failed test program",
607 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
610 ATF_TEST_CASE_WITHOUT_HEAD(tps_55
);
611 ATF_TEST_CASE_BODY(tps_55
)
614 "Content-Type: application/X-atf-tps; version=\"3\"\n"
617 "tp-start: 100.200, foo, 1\n"
623 "tc-start: 111.222\n"
624 "tc-start: 111.222,\n"
625 "tc-start: 111.222, foo\n"
627 "tc-start: 111.333, foo\n"
629 "tc-start: 111.444, foo\n"
631 "tc-start: 111.444, foo\n"
633 "tc-start: 111.444, foo\n"
635 "tc-start: 111.444, foo\n"
637 "tc-start: 111.444, foo\n"
638 "tc-end: 111.555, \n"
639 "tc-start: 111.444, foo\n"
640 "tc-end: 111.555, bar\n"
641 "tc-start: 111.444, foo\n"
642 "tc-end: 111.555, foo\n"
643 "tc-start: 111.444, foo\n"
644 "tc-end: 111.555, foo,\n"
645 "tp-end: 111.666, foo\n"
648 const char* exp_calls
[] = {
650 "got_tp_start(foo, 1)",
654 // NO_CHECK_STYLE_BEGIN
655 const char* exp_errors
[] = {
656 "5: Unexpected token `foo'; expected start of test case",
657 "6: Unexpected token `<<NEWLINE>>'; expected `:'",
658 "7: Unexpected token `<<NEWLINE>>'; expected timestamp",
659 "8: Malformed timestamp value 111",
660 "9: Malformed timestamp value 111.",
661 "10: Unexpected token `<<NEWLINE>>'; expected `,'",
662 "11: Unexpected token `<<NEWLINE>>'; expected test case name",
663 "13: Unexpected token `bar'; expected end of test case or test case's stdout/stderr line",
664 "15: Unexpected token `<<NEWLINE>>'; expected `:'",
665 "17: Unexpected token `<<NEWLINE>>'; expected timestamp",
666 "19: Malformed timestamp value 111",
667 "21: Malformed timestamp value 111.",
668 "23: Unexpected token `<<NEWLINE>>'; expected `,'",
669 "25: Unexpected token `<<NEWLINE>>'; expected test case name",
670 "27: Test case name used in terminator does not match opening",
671 "29: Unexpected token `<<NEWLINE>>'; expected `,'",
672 "31: Unexpected token `<<NEWLINE>>'; expected expected_{death,exit,failure,signal,timeout}, failed, passed or skipped",
673 "32: Unexpected token `tp-end'; expected start of test case",
676 // NO_CHECK_STYLE_END
678 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
681 ATF_TEST_CASE_WITHOUT_HEAD(tps_56
);
682 ATF_TEST_CASE_BODY(tps_56
)
685 "Content-Type: application/X-atf-tps; version=\"3\"\n"
688 "tp-start: 111.222, foo, 1\n"
689 "tc-start: 111.333, foo\n"
690 "tc-end: 111.444, foo, passe\n"
691 "tc-start: 111.333, foo\n"
692 "tc-end: 111.444, foo, passed,\n"
693 "tc-start: 111.555, bar\n"
694 "tc-end: 111.666, bar, failed\n"
695 "tc-start: 111.555, bar\n"
696 "tc-end: 111.666, bar, failed,\n"
697 "tc-start: 111.555, baz\n"
698 "tc-end: 111.666, baz, skipped\n"
699 "tc-start: 111.555, baz\n"
700 "tc-end: 111.666, baz, skipped,\n"
701 "tp-end: 111.777, foo\n"
704 const char* exp_calls
[] = {
706 "got_tp_start(foo, 1)",
711 // NO_CHECK_STYLE_BEGIN
712 const char* exp_errors
[] = {
713 "6: Unexpected token `passe'; expected expected_{death,exit,failure,signal,timeout}, failed, passed or skipped",
714 "8: Unexpected token `,'; expected new line",
715 "10: Unexpected token `<<NEWLINE>>'; expected `,'",
716 "12: Empty reason for failed test case result",
717 "14: Unexpected token `<<NEWLINE>>'; expected `,'",
718 "16: Empty reason for skipped test case result",
719 "17: Unexpected token `tp-end'; expected start of test case",
722 // NO_CHECK_STYLE_END
724 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
727 ATF_TEST_CASE_WITHOUT_HEAD(tps_57
);
728 ATF_TEST_CASE_BODY(tps_57
)
731 "Content-Type: application/X-atf-tps; version=\"3\"\n"
734 "tp-start: 111.222, foo, 0\n"
735 "tp-end: 111.333, foo\n"
738 const char* exp_calls
[] = {
740 "got_tp_start(foo, 0)",
745 const char* exp_errors
[] = {
746 "6: Unexpected token `<<EOF>>'; expected start of test program",
750 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
753 ATF_TEST_CASE_WITHOUT_HEAD(tps_58
);
754 ATF_TEST_CASE_BODY(tps_58
)
757 "Content-Type: application/X-atf-tps; version=\"3\"\n"
760 "tp-start: 111.222, foo, 0\n"
761 "tp-end: 111.333, foo\n"
762 "tp-start: 111.444, bar, 0\n"
763 "tp-end: 111.555, bar\n"
766 const char* exp_calls
[] = {
768 "got_tp_start(foo, 0)",
773 const char* exp_errors
[] = {
774 "6: Unexpected token `tp-start'; expected end of stream or info field",
778 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
781 ATF_TEST_CASE_WITHOUT_HEAD(tps_59
);
782 ATF_TEST_CASE_BODY(tps_59
)
785 "Content-Type: application/X-atf-tps; version=\"3\"\n"
790 const char* exp_calls
[] = {
794 const char* exp_errors
[] = {
795 "3: Unexpected token `<<NEWLINE>>'; expected `:'",
799 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
802 ATF_TEST_CASE_WITHOUT_HEAD(tps_60
);
803 ATF_TEST_CASE_BODY(tps_60
)
806 "Content-Type: application/X-atf-tps; version=\"3\"\n"
811 const char* exp_calls
[] = {
815 const char* exp_errors
[] = {
816 "3: Unexpected token `<<NEWLINE>>'; expected info property name",
820 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
823 ATF_TEST_CASE_WITHOUT_HEAD(tps_61
);
824 ATF_TEST_CASE_BODY(tps_61
)
827 "Content-Type: application/X-atf-tps; version=\"3\"\n"
832 const char* exp_calls
[] = {
836 const char* exp_errors
[] = {
837 "3: Unexpected token `<<NEWLINE>>'; expected `,'",
841 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
844 ATF_TEST_CASE_WITHOUT_HEAD(tps_62
);
845 ATF_TEST_CASE_BODY(tps_62
)
848 "Content-Type: application/X-atf-tps; version=\"3\"\n"
853 const char* exp_calls
[] = {
858 const char* exp_errors
[] = {
859 "4: Unexpected token `<<EOF>>'; expected tps-count or info field",
863 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
866 ATF_TEST_CASE_WITHOUT_HEAD(tps_63
);
867 ATF_TEST_CASE_BODY(tps_63
)
870 "Content-Type: application/X-atf-tps; version=\"3\"\n"
875 const char* exp_calls
[] = {
880 const char* exp_errors
[] = {
881 "4: Unexpected token `<<EOF>>'; expected tps-count or info field",
885 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
888 ATF_TEST_CASE_WITHOUT_HEAD(tps_64
);
889 ATF_TEST_CASE_BODY(tps_64
)
892 "Content-Type: application/X-atf-tps; version=\"3\"\n"
895 "info: a.b.c.def, g\n"
899 const char* exp_calls
[] = {
901 "got_info(a.b.c.def, g)",
905 const char* exp_errors
[] = {
906 "5: Unexpected token `<<NEWLINE>>'; expected `:'",
910 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
913 ATF_TEST_CASE_WITHOUT_HEAD(tps_65
);
914 ATF_TEST_CASE_BODY(tps_65
)
917 "Content-Type: application/X-atf-tps; version=\"3\"\n"
923 const char* exp_calls
[] = {
928 const char* exp_errors
[] = {
929 "4: Unexpected token `<<NEWLINE>>'; expected number of test programs",
933 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
936 ATF_TEST_CASE_WITHOUT_HEAD(tps_66
);
937 ATF_TEST_CASE_BODY(tps_66
)
940 "Content-Type: application/X-atf-tps; version=\"3\"\n"
947 const char* exp_calls
[] = {
953 const char* exp_errors
[] = {
954 "5: Unexpected token `<<NEWLINE>>'; expected `:'",
958 do_parser_test
< tps_reader
>(input
, exp_calls
, exp_errors
);
961 ATF_INIT_TEST_CASES(tcs
)
963 ATF_ADD_TEST_CASE(tcs
, tps_1
);
964 ATF_ADD_TEST_CASE(tcs
, tps_2
);
965 ATF_ADD_TEST_CASE(tcs
, tps_3
);
966 ATF_ADD_TEST_CASE(tcs
, tps_4
);
967 ATF_ADD_TEST_CASE(tcs
, tps_5
);
968 ATF_ADD_TEST_CASE(tcs
, tps_6
);
969 ATF_ADD_TEST_CASE(tcs
, tps_50
);
970 ATF_ADD_TEST_CASE(tcs
, tps_51
);
971 ATF_ADD_TEST_CASE(tcs
, tps_52
);
972 ATF_ADD_TEST_CASE(tcs
, tps_53
);
973 ATF_ADD_TEST_CASE(tcs
, tps_54
);
974 ATF_ADD_TEST_CASE(tcs
, tps_55
);
975 ATF_ADD_TEST_CASE(tcs
, tps_56
);
976 ATF_ADD_TEST_CASE(tcs
, tps_57
);
977 ATF_ADD_TEST_CASE(tcs
, tps_58
);
978 ATF_ADD_TEST_CASE(tcs
, tps_59
);
979 ATF_ADD_TEST_CASE(tcs
, tps_60
);
980 ATF_ADD_TEST_CASE(tcs
, tps_61
);
981 ATF_ADD_TEST_CASE(tcs
, tps_62
);
982 ATF_ADD_TEST_CASE(tcs
, tps_63
);
983 ATF_ADD_TEST_CASE(tcs
, tps_64
);
984 ATF_ADD_TEST_CASE(tcs
, tps_65
);
985 ATF_ADD_TEST_CASE(tcs
, tps_66
);