fwiw, i've come up with a couple of other useful shorthand
routines for my Wombat::Test package:

  sub have_lib {
      for (@_) {
          unless (eval "require $_") {
              $@ = "$_ not found\n" if $@ =~ /^Can't locate/;
              return undef;
          }
      }
      return 1;
  }

  sub skip_all {
      my $msg = $_[0] ? " # Skipped: $_[0]" : '';
      print "1..0$msg\n";
      exit;
  }

they allow me to do stuff like this at the beginning of each
test file:

  skip_all $@ unless have_lib qw(mod_perl Foo Apache::FakeRequest);
  plan tests => 6;

which gives this output:

  connector/apache/apache.skipped: Foo not found


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to