From 7b1962d6cc86d8eab35f9dac3fad292cd3ee1b1a Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Fri, 4 Dec 2009 21:12:22 -0800 Subject: [PATCH] Add some tests for parsing out of order tests, mostly passing. Currently we do not count any tests that are out of order as passed, so test files with out of order tests do not pass, but this is currently dumb luck. The parse_tapstream method needs to be modified to detect out of order tests and still count which pass and fail. --- t/03-parse_tapstream_error.t | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/t/03-parse_tapstream_error.t b/t/03-parse_tapstream_error.t index c1b177f..d5973ff 100755 --- a/t/03-parse_tapstream_error.t +++ b/t/03-parse_tapstream_error.t @@ -7,7 +7,7 @@ load_bytecode 'lib/Tapir/Stream.pbc' load_bytecode 'lib/Tapir/Parser.pbc' - plan(28) + plan(35) # setup test data klass = newclass [ 'Tapir'; 'Parser' ] @@ -18,6 +18,46 @@ test_plumage_sanity(tapir) test_exit_code(tapir) test_exit_code_pass(tapir) + test_parse_tapstream_out_of_order(tapir) +.end + +.sub test_parse_tapstream_out_of_order + .param pmc tapir + .local string tap_error + .local pmc stream + tap_error = <<"TAP" +1..4 +ok 1 - foo +ok 3 - bar +ok 2 - baz +ok 4 - fuzzlebub +TAP + stream = tapir.'parse_tapstream'(tap_error) + + $I0 = stream.'get_plan'() + is($I0,4,"plan is correct") + + $I0 = stream.'is_pass'() + is($I0,0,"parse_tapstream does not pass something with out of order tests") + + $I0 = stream.'get_pass'() + is($I0,4,"parse_tapstream gets 4 passed tests") + + $I0 = stream.'get_todo'() + is($I0,0,"parse_tapstream gets no todo tests") + + $I0 = stream.'get_skip'() + is($I0,0,"parse_tapstream gets no skip tests") + + $I0 = stream.'get_fail'() + is($I0,0,"parse_tapstream gets no fails") + + $I0 = stream.'total'() + is($I0,4,"parse_tapstream gets correct # of tests in total") + + $I0 = stream.'get_exit_code'() + is($I0,0,"parse_tapstream gets correct exit code") + .end .sub test_exit_code_pass -- 2.11.4.GIT