Re: [RFC PATCH 1/2] Add C TAP harness
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 2, 2023, 15:54 UTC
- Message-ID
- <6451324ed84e2_1ba2d29454@chronos.notmuch>
- In-Reply-To
- <afd3e80f-99d9-7472-36e7-335f86263d09@gmail.com>
Phillip Wood wrote:
> Unfortunately this library doesn't seem to offer any of those features. > It does support a lazy test plan but uses atexit() so will not detect if > the test program exits before all the tests have run.
I think there's a fundamental misunderstanding of how we use TAP.
If a program generates this output:
1..3 ok 1 - test 1 ok 2 - test 2
That's clearly not complete. It shouldn't be the job a test script to check for those cases.
If you run the programm through a TAP harness such as prove, you get:
foo.t .. Failed 1/3 subtests
Test Summary Report
-------------------
foo.t (Wstat: 0 Tests: 2 Failed: 0)
Parse errors: Bad plan. You planned 3 tests but ran 2.
Files=1, Tests=2, 0 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)
Result: FAILWhy do we bother generaing a TAP output if we are not going to take advantage of it?
-- Felipe Contreras