freebsd / kyua

Testing framework for infrastructure software
BSD 3-Clause "New" or "Revised" License
147 stars 42 forks source link

TAP handler does not handle 1..0 without SKIP #193

Open pemensik opened 5 years ago

pemensik commented 5 years ago

In issue #159, handling of SKIP was corrected. However, it seems incomplete to me.

I admit tap specification is somehow vague on Skipping. But I think the example for whole test skip clearly mentions zero in range: 1..0. I have failing test in bind unit tests written using cmocka library. It outputs just

1..0
# ok - tests

Which kyua 0.13 reports as a broken test. It seems fine to me.

Anyway, specification says:

Similarly, one can include an explanation in a plan line, emitted if the test file is skipped completely

I think that means explanation is just nice to have. It makes sense to not parse it then. Instead, range with X..0 should be handled as skip, no matter what is in comment. If that is the case, comments with skip can just be ignored.

ngie-eign commented 5 years ago

@pemensik: does it show skipped with ‘prove -v’, by chance?

pemensik commented 5 years ago

No, perl implementation does not handle it well also.

prove -v ./timer_test
./timer_test .. 
[==========] Running 0 test(s).
[==========] 0 test(s) run.
[  PASSED  ] 0 test(s).
No subtests run 

Test Summary Report
-------------------
./timer_test (Wstat: 0 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  0 wallclock secs ( 0.02 usr +  0.01 sys =  0.03 CPU)
Result: FAIL

prove is handling it the same way as kyua.

ngie-eign commented 5 years ago

No, perl implementation does not handle it well also.

prove -v ./timer_test
./timer_test .. 
[==========] Running 0 test(s).
[==========] 0 test(s) run.
[  PASSED  ] 0 test(s).
No subtests run 

Test Summary Report
-------------------
./timer_test (Wstat: 0 Tests: 0 Failed: 0)
  Parse errors: No plan found in TAP output
Files=1, Tests=0,  0 wallclock secs ( 0.02 usr +  0.01 sys =  0.03 CPU)
Result: FAIL

prove is handling it the same way as kyua.

Well... not really. It's actually claiming that it passed because it's reading the last line, whereas kyua claims the output is bad.