3 ms·
> a) Shouldn't tests have names? That's what the text following the test number is for. > b) (more serious) To generate valid TAP output, I need to know up-fr
by duskwuff 3y ago
> a) Shouldn't tests have names?
That's what the text following the test number is for.
> b) (more serious) To generate valid TAP output, I need to know up-front how many tests there are. What if I can run the tests in sequence but I don't know how to count them? This can happen if there is a tree of tests, where each node knows what children it has but not what children they have.
Typically you'd use subtests for this, e.g.
1..1
# Subtest: root
1..2
Subtest: branch 1
1..2
ok 1 - leaf 1
ok 2 - leaf 2
ok 1 - branch 1
ok 2 - leaf 3
ok 1 - root
But if you really didn't know the number of tests up front for some reason, the test plan is also allowed to appear at the end of the file.
- stevekemp 3y agoI wrote a simple set of test-cases for my lisp implementation, and use the TAP format for the output. In my case I pipe to "tapview", by ESR, to visualize the results. The raw output is otherwise pretty basic: TAP version 14 ok tst:zero:1 ok tst:zero:2 .. ok union:1 ok union:2 ok year:len 1..215 Tapview is pretty portable, and works well as a simple output visualizer turning my view into: ./yal examples/lisp-tests.lisp | _misc/tapview ........................................................... 215 tests, 0 failures.