use strict; use warnings; use Test::More; die bless {}, __PACKAGE__; done_testing;
というのを作ってperlで実行するとこういう感じのエラーが出る。
$ perl t/01_exception.t main=HASH(0x7fb1ba002eb8)
proveで実行すると"main=HASH(0x7fb1ba002eb8)"みたいなのが出てこない。なんでや。
$ prove t/01_exception.t [17:08:21] t/01_exception.t .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run [17:08:21] Test Summary Report ------------------- t/01_exception.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=1, Tests=0, 0 wallclock secs ( 0.05 usr 0.01 sys + 0.06 cusr 0.00 csys = 0.12 CPU) Result: FAIL
die "@{[bless {}, __PACKAGE__]}";ってやったら出てきた。
$ prove t/01_exception.t [17:17:14] t/01_exception.t .. main=HASH(0x7fda29002eb8) at t/01_exception.t line 5. [17:17:14] t/01_exception.t .. Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run [17:17:14] Test Summary Report ------------------- t/01_exception.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=1, Tests=0, 0 wallclock secs ( 0.05 usr 0.01 sys + 0.06 cusr 0.00 csys = 0.12 CPU) Result: FAIL
dieの上にpass;を書くとそれっぽいのが出てきた。
$ prove t/01_exception.t [17:24:11] t/01_exception.t .. 1/? main=HASH(0x7fc5f9002eb8)# Tests were run but no plan was declared and done_testing() was not seen. [17:24:11] t/01_exception.t .. Dubious, test returned 255 (wstat 65280, 0xff00) All 1 subtests passed [17:24:11] Test Summary Report ------------------- t/01_exception.t (Wstat: 65280 Tests: 1 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=1, Tests=1, 0 wallclock secs ( 0.06 usr 0.01 sys + 0.08 cusr 0.00 csys = 0.15 CPU) Result: FAIL
わからない。
追記:
prove -vすればええんちゃうかな〜って思ってやってみたらできた。
$ prove -v t/01_exception.t [21:12:41] t/01_exception.t .. main=HASH(0x7f8168802eb8)Dubious, test returned 255 (wstat 65280, 0xff00) No subtests run [21:12:41] Test Summary Report ------------------- t/01_exception.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=1, Tests=0, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.03 cusr 0.00 csys = 0.07 CPU) Result: FAIL