--- Andrew Savige <[EMAIL PROTECTED]> wrote:
> Oooooh, that 'grind' looks like a very handy command but I'm a bit
> confused about how you use it. Is it just a handy general-purpose
> command or do you use it specifically as part of "make test" in
> your CPAN distributions?

It's a utility that I wrote to allow me to better manage my tests.

> If you have used it in a CPAN module,
> please let me know which one, so I can take a look.

I've just made it available at 
http://users.easystreet.com/ovid/cgi_course/downloads/grind.gz

It needs more work, including allowing descending into directories (via File::Find or 
a similar
mechanism) and having pre and post actions.  I haven't figured out the best way to do 
the latter
(that would be things like setting up a test db, tearing it down afterwards, etc.)
 
> I assume grind calls Test::Harness:runtests() shortly after accepting
> these command-line options, running all "t/*.t" tests by default, and
> using @include and @exclude to include/exclude tests. Is that right?

Yes.

> What is --shuffle and --fast used for? Can you please give some
> examples of how you use it?

--shuffle will shuffle the order in which the tests are run to ensure that you have no 
accidental
dependency on test order.

--fast sets and environment variable that can be checked in the test scripts.  For 
example, if you
have a couple of tests that double the time of your test run and you want a fast check 
of
integrity, you can put this in your code:

  SKIP: {
    skip 'Fast Tests', 1 if $ENV{FAST_TESTS};
    ok( really_long_running_function(), '... successfully kills time');
  }

Fortunately, this is all documented in the POD :)

> BTW, is there a web site that allows you to search CPAN source code?
> For example, I might like to search all of CPAN for any distribution
> that contains Test::Harness in any file in the t/ directory.

Yes, it's called Google ;)

Actually, I don't think Google will be *that* specific, but use the following for your 
search
terms:

  site:search.cpan.org "use Test::Harness"

That will generate a lot of "probables".

Cheers,
Ovid

=====
Silence is Evil            http://users.easystreet.com/ovid/philosophy/indexdecency.htm
Ovid                       http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl  http://users.easystreet.com/ovid/cgi_course/

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Reply via email to