Skip to content

Commit

Permalink
Add some tests for parsing out of order tests, mostly passing.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
leto committed Dec 5, 2009
1 parent 0513ece commit 053210a
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion t/03-parse_tapstream_error.t
Expand Up @@ -7,7 +7,7 @@
.include 'test_more.pir'
.local pmc tapir, klass

plan(27)
plan(35)

# setup test data
klass = newclass [ 'Tapir'; 'Parser' ]
Expand All @@ -17,6 +17,46 @@
test_parse_death_with_passing_tests(tapir)
test_plumage_sanity(tapir)
test_exit_code(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
Expand Down

0 comments on commit 053210a

Please sign in to comment.