develooper Front page | perl.module-authors | Postings from November 2003

Re: How to indicate a dependency in my module

Thread Previous | Thread Next
From:
darren chamberlain
Date:
November 10, 2003 12:10
Subject:
Re: How to indicate a dependency in my module
Message ID:
5d950b544f0668156846b3e546740fa2fbb27a89@tumbleweed.boston.com
* Bruno Negrao <qmail at engepel.com.br> [2003-11-10 17:10]:
> I?m finishing to write a module, Proc::Daemontools, and it requires that the
> daemontools package be installed on a machine for it to work.
> Where must I indicate that this module have a dependency? I already wrote
> this on the README file. Is there any other place?
> 
> In my test script, I cause the test to fail if it cannot find a process,
> 'svscan', running on the machine. Do you think that this can cause all the
> cpan-testers to fail?

I think the best thing to do in your test would be something like:

  my $have_svscan = 0;

  if (find_svscan()) {
      $have_svscan = 1;
      plan tests => 2;
  }
  else {
      plan tests => 1;
  }

  use_ok("Proc::Daemontools");
  ok("Some svscan related test") if $have_svscan;

Where find_svscan looks in the Appropriate Places for svscan, and runs
the tests if it can be found.

(darren)

-- 
You know the great thing about TV? If something important happens
anywhere at all in the world, no matter what time of the day or night,
you can always change the channel.
    -- Jim Ignatowski

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About