Jeffrey Kegler has asked for the wisdom of the Perl Monks concerning the following question:
use_ok() does not seem to be the answer. It's a test in itself, which I don't want. It seems aimed at loading the module to be tested, not a module to be used for the test.
It seems a simple enough task, but I get very perplexing results. Trying this sample test script
use strict; use warnings; use Test::Weaken 0.002002; use Test::More tests => 1; pass("Just so I have a test in the example");
But using the test target of an ExtUtils-MakeMaker generated Makefile, I get:1..1 ok 1 - Just so I have a test in the example
Seems as if Test::Harness can't find a VERSION number which a raw perl command had no trouble finding. (If you suspect I'm doing something wrong in Test::Weaken 0.002002, it's on CPAN for your inspection.)t/4monks......Test::Weaken does not define $Test::Weaken::VERSION--ver +sion check failed at t/4monks.t line 4. BEGIN failed--compilation aborted at t/4monks.t line 4. t/4monks......dubious + Test returned status 2 (wstat 512, 0x200)
I've tried some eval trickery, but that this problem with the mysterious disappearing VERSION number so far has defeated me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Skipping tests if a module is not available
by dragonchild (Archbishop) on Oct 31, 2007 at 03:08 UTC | |
by Jeffrey Kegler (Hermit) on Oct 31, 2007 at 04:21 UTC | |
by dragonchild (Archbishop) on Oct 31, 2007 at 12:36 UTC | |
by GrandFather (Saint) on Oct 31, 2007 at 04:25 UTC | |
by jdporter (Paladin) on Oct 31, 2007 at 12:26 UTC | |
|
Re: Skipping tests if a module is not available
by chromatic (Archbishop) on Oct 31, 2007 at 03:07 UTC | |
by Jeffrey Kegler (Hermit) on Oct 31, 2007 at 04:36 UTC |