Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: Test::More command-line arguments?

by tobyink (Abbot)
on Sep 25, 2012 at 00:24 UTC ( #995465=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Test::More command-line arguments?
in thread Test::More command-line arguments?

prove does not pass on arguments to the test files. prove assumes that you're trying to run test cases called "one", "two" and "three".

If you need to provide arguments to a test file, you need to run it with perl, not prove:

$ perl t.t one two three

If you really want to use prove then perhaps modify your test file to read its options from environment variables instead.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re^3: Test::More command-line arguments?
Select or Download Code
Re^4: Test::More command-line arguments?
by Anonymous Monk on Sep 25, 2012 at 00:30 UTC

    | If you really want to use prove then perhaps modify your test file to read its options from environment variables instead.

    Bummer.

    Thanks, I may have to resort to this method. I appreciate the time both of you spent is drawing out the fundamental problem.

      Well, your tests shouldn't need arguments :)

      If you need to database connection details, traditional solution is to either use env vars ( along the lines of TEST_MYSQL_USER TEST_MYSQL_PASS ... or TEST_MYSQL_DSN )

      Of via distribution config file , which your tests know how to read

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995465]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2014-10-25 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (148 votes), past polls