On 01/07/06, Michael G Schwern <[EMAIL PROTECTED]> wrote:
The PITA / TestBuilder2 BOF at YAPC whacked up this TAP extension.
Test groups in TAP. There are several use-cases here.
1. I want to name a group of tests rather than the individuals.
2. I don't want to have to count up the total number of tests in my
file but I do want the protection of the plan. I'd like to be able to
say "I'm going to run 5 tests. I'm going to run 4 more tests. Now 8
more".
3. The spew to STDERR from my code when it does something wrong cannot
be associated with a single test. But if I had a test grouping I
could associate it with that group.
Here's what we came up with.
1..10
..4 - name for this group
ok 1
ok 2
ok 3
ok 4
..2 - I will call this group Bruce
ok 5
ok 6
..4
ok 7
ok 8
ok 9
ok 10
Pros:
* Its backwards compatible. The ..# lines are currently considered
junk and ignored.
* Its pretty readable.
* It solves #1
* Combined with 'no_plan' it solves #2.
..2
ok 1
ok 2
..3
ok 3
ok 4
ok 5
1..5
* It solves #3.
1..5
..3
ok 1
Oh god, the hurting
oh dear, oh god at Foo.pm line 23
not ok 2
# Failed test ...
# got : this
# expected: that
ok 3
..2
ok 4
ok 5
Cons?
There's no way to declare a top-level plan. That is, I can't say how
many groups of tests I'm going to run so there's effectively no plan,
F