10

When I run make test using the normal test harness that CPAN modules have, it will just output a brief summary (if all went well).

t/000_basic.t .......................... ok   
t/001_db_handle.t ...................... ok     
t/002_dr_handle.t ...................... ok     
t/003_db_can_connect.t ................. ok   
... snip ...
All tests successful.
Files=30, Tests=606,  2 wallclock secs 
Result: PASS

If I run the tests individually, they output much more detailed information.

1..7
ok 1 - use DBIx::ProcedureCall::PostgreSQL;
ok 2 - simple call to current_time
ok 3 - call to power() with positional parameters
ok 4 - call to power() using the run() interface
ok 5 - call to setseed with a named parameter
ok 6 - call a table function
ok 7 - call a table function and fetch

How can I run all the tests in this verbose mode? Is there something that I can pass to make test?

Thilo
  • 257,207
  • 101
  • 511
  • 656

2 Answers2

18

The ExtUtils::MakeMaker docs explain this in the make test section:

make test TEST_VERBOSE=1

If the distribution uses Module::Build, it's a bit different:

./Build test verbose=1

You can also use the prove command that comes with Test-Harness:

prove -bv

(or prove --blib --verbose if you prefer long options.) This command is a bit different, because it does not build the module first. The --blib option causes it to look for the built-but-uninstalled module created by make or ./Build, but if you forgot to rebuild the module after changing something, it will run the tests against the previously-built copy. If you haven't built the module at all, it will test the installed version of the module instead.

prove also lets you run only a specific test or tests:

prove -bv t/failing.t
cjm
  • 61,471
  • 9
  • 126
  • 175
9

You can also use the prove command:

prove --blib --verbose

from the unpacked module's top directory. --blib includes the needed directories for a built but not installed module distribution.

ysth
  • 96,171
  • 6
  • 121
  • 214
  • Oh, that's pretty. It also highlights what I was specifically looking for (skipped tests). – Thilo Mar 15 '11 at 04:57