You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For better reporting, including skips. Prove (at least as of
TAP::Harness v3.35_01 and Perl v5.22.3) seems to report skips only
when there were also failures. For example, here's a skip-only test:
$ validation/mounts.t
TAP version 13
1..1
ok 1 # SKIP TODO: mounts generation options have not been implemented
$ prove validation/mounts.t
validation/mounts.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)
Result: PASS
node-tap (as of version 11.0.0) reports that skip:
$ tap validation/mounts.t
validation/mounts.t ................................... 0/1
Skipped: 1
TODO: mounts generation options have not been implemented
total ................................................. 0/1
0 passing (27.297ms)
1 pending
And here's a skip with a failure test:
$ ./test-skip
TAP version 13
1..2
not ok 1 - failing
ok 2 # SKIP: skipping
Prove warns about the skip now:
$ prove test-skip
test-skip .. Failed 1/2 subtests
(less 1 skipped subtest: 0 okay)
Test Summary Report
-------------------
test-skip (Wstat: 0 Tests: 2 Failed: 1)
Failed test: 1
Files=1, Tests=2, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU)
Result: FAIL
But node-tap has a nicer warning:
$ tap ./test-skip
./test-skip ........................................... 0/2
not ok failing
Skipped: 1
: skipping
total ................................................. 0/2
0 passing (39.088ms)
1 pending
1 failing
Similarly, node-tap does a better job handling YAML blocks [1]:
$ ./test-yaml
TAP version 13
1..4
ok 1 - success diagnostic
# success
not ok 2 - failure diagnostic
# failure
ok 3 - success YAML
---
message: success
...
not ok 4 - failure YAML
---
message: failure
...
Prove either shows no diagnostics:
$ prove test-yaml
test-yaml .. Failed 2/4 subtests
Test Summary Report
-------------------
test-yaml (Wstat: 0 Tests: 4 Failed: 2)
Failed tests: 2, 4
Files=1, Tests=4, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU)
Result: FAIL
or it shows all the diagnostics (even for successful tests):
$ prove --comments test-yaml
test-yaml .. 1/?
# success
# failure
test-yaml .. Failed 2/4 subtests
Test Summary Report
-------------------
test-yaml (Wstat: 0 Tests: 4 Failed: 2)
Failed tests: 2, 4
Files=1, Tests=4, 0 wallclock secs ( 0.02 usr + 0.00 sys = 0.02 CPU)
Result: FAIL
I can't find a way to get Prove to show the YAML blocks. node-tap, on
the other hand, does the right thing with YAML blocks:
$ tap ./test-yaml
./test-yaml ........................................... 2/4
not ok failure diagnostic
not ok failure YAML
message: failure
total ................................................. 2/4
2 passing (42.409ms)
2 failing
We don't use YAML blocks at the moment, but I'm going to transition to
them later.
[1]: http://testanything.org/tap-version-13-specification.html#yaml-blocks
Signed-off-by: W. Trevor King <[email protected]>
The runtime validation suite uses [`prove`][prove], which is packaged for most distributions (for example, it is in [Debian's `perl` package][debian-perl] and [Gentoo's `dev-lang/perl` package][gentoo-perl]).
34
-
If you cannot install `prove`, you can probably run the test suite with another [TAP consumer][tap-consumers], although you'll have to edit the [`Makefile`](Makefile) to replace `prove`.
33
+
The runtime validation suite uses [node-tap][], which is packaged for some distributions (for example, it is in [Debian's `node-tap` package][debian-node-tap]).
34
+
If your distribution does not package node-tap, you can install [npm][] (for example, from [Gentoo's `nodejs` package][gentoo-nodejs]) and use it:
total ............................................. 267/273
101
+
102
+
103
+
267 passing (31s)
104
+
1 pending
105
+
5 failing
106
+
107
+
make: *** [Makefile:43: localvalidation] Error 1
84
108
```
85
109
86
-
If you are confident that the `validation/*.t` are current, you can run `prove` (or your preferred TAP consumer) directly to avoid unnecessary rebuilds:
0 commit comments