in reply to Test::More fails...

G'day Bod,

Excellent analysis by ++hv. Here's some additional tips.

Here's a simple test script (pm_11152486_test_more.t):

#!perl use strict; use warnings; use Test::More tests => 3; my ($var1, $var2) = (1, 2); # Test1 ok($var1 == $var2, 'Fail: ok()'); # Test2 is($var1, $var2, 'Fail: is()'); # Test3 ok($var2 == $var1, 'Fail: ok()') or diag "\$var1[$var1] \$var2[$var2]";

In simple cases, you can interpolate the values of the arguments into the test name; e.g.

ok($var1 == $var2, "Fail: ok($var1 == $var2)");

in which case, diag() is unnecessary.

In more complex cases, doing this is not easy, or can result in cumbersome test names; or you may want additional information such as values from %ENV. This is where diag() can be particularly useful.

Here's a straightforward run of that code:

$ perl pm_11152486_test_more.t 1..3 not ok 1 - Fail: ok() # Failed test 'Fail: ok()' # at pm_11152486_test_more.t line 11. not ok 2 - Fail: is() # Failed test 'Fail: is()' # at pm_11152486_test_more.t line 14. # got: '1' # expected: '2' not ok 3 - Fail: ok() # Failed test 'Fail: ok()' # at pm_11152486_test_more.t line 17. # $var1[1] $var2[2] # Looks like you failed 3 tests of 3.

Consider the prove utility for additional output information:

$ prove pm_11152486_test_more.t pm_11152486_test_more.t .. 1/3 # Failed test 'Fail: ok()' # at pm_11152486_test_more.t line 11. # Failed test 'Fail: is()' # at pm_11152486_test_more.t line 14. # got: '1' # expected: '2' # Failed test 'Fail: ok()' # at pm_11152486_test_more.t line 17. # $var1[1] $var2[2] # Looks like you failed 3 tests of 3. pm_11152486_test_more.t .. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/3 subtests Test Summary Report ------------------- pm_11152486_test_more.t (Wstat: 768 (exited 3) Tests: 3 Failed: 3) Failed tests: 1-3 Non-zero exit status: 3 Files=1, Tests=3, 0 wallclock secs ( 0.05 usr 0.02 sys + 0.03 cusr + 0.09 csys = 0.19 CPU) Result: FAIL

Use the -v option for verbose output:

$ prove -v pm_11152486_test_more.t pm_11152486_test_more.t .. 1..3 not ok 1 - Fail: ok() not ok 2 - Fail: is() not ok 3 - Fail: ok() # Failed test 'Fail: ok()' # at pm_11152486_test_more.t line 11. # Failed test 'Fail: is()' # at pm_11152486_test_more.t line 14. # got: '1' # expected: '2' # Failed test 'Fail: ok()' # at pm_11152486_test_more.t line 17. # $var1[1] $var2[2] # Looks like you failed 3 tests of 3. Dubious, test returned 3 (wstat 768, 0x300) Failed 3/3 subtests Test Summary Report ------------------- pm_11152486_test_more.t (Wstat: 768 (exited 3) Tests: 3 Failed: 3) Failed tests: 1-3 Non-zero exit status: 3 Files=1, Tests=3, 0 wallclock secs ( 0.00 usr 0.09 sys + 0.03 cusr + 0.08 csys = 0.20 CPU) Result: FAIL

In situations where make test (or other variants of make) has shown some test scripts to have failed; rerun the failed tests individually with as much output as possible. From the same directory that you ran make test, run

prove -vb t/failed_test.t

In your example, 00-load.t was OK but 01-openai.t was not. So run:

prove -vb t/01-openai.t

You can run prove with multiple files; I generally don't — normally the output from one file is enough to deal with at once. :-)

— Ken