Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

How do I pass command line args to test module?

by Anonymous Monk
on Oct 06, 2001 at 19:46 UTC ( [id://117208]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I'm writing a module and would like to test it with tests in t/. I need to pass each test the same command line argument. Is there an entry I can make in Makefile.PL that will pass the arg or do I need to write a mother test script that evals the other test scripts? TIA. TG
  • Comment on How do I pass command line args to test module?

Replies are listed 'Best First'.
Re: How do I pass command line args to test module?
by thraxil (Prior) on Oct 06, 2001 at 20:36 UTC
Re: How do I pass command line args to test module?
by Anonymous Monk on Oct 06, 2001 at 22:38 UTC
    I figured it out!!!
    
    In the script prior to testing for command line args, I set them
    via the following:
    
    @ARGV = qw(blah);
    
    It seems to work as I wish it to.
    
    TG
    
Re: How do I pass command line args to test module?
by Anonymous Monk on Oct 06, 2001 at 20:46 UTC
    I appreciate your input but...
    
    I did look at Test::Harness and found:
    
      The global variable $Test::Harness::switches is exportable and can be used
      to set perl command line options used for running the test script(s). The
      default value is `-w'.
    
    which I don't think is going to do what I want it to do.  My
    understanding is that $Test::Harness::switches = "-w blah" would
    result in
    
      perl -w blah t/test.t
    
    not
    
      perl -w t/test.t blah  < this is what I want
    
    Also, I want to set a variable in Makefile.PL that will set
    a variable in Makefile to be used by make test. 
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://117208]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-26 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found