Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Running specific tests

by guiwp (Sexton)
on Jul 04, 2016 at 15:18 UTC ( [id://1167150]=perlquestion: print w/replies, xml ) Need Help??

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

How to run specific tests?Today I searched the web how tests is done in perl, just found a stackoverflow answer but its not working.

prove t/02-login.t

t/02-login.t .. skipped: extended test Files=1, Tests=0, 0 wallclock secs ( 0.03 usr + 0.00 sys = 0.03 CPU +) Result: NOTESTS

Seems that the test couldn't be run

Replies are listed 'Best First'.
Re: Running specific tests
by Anonymous Monk on Jul 04, 2016 at 15:24 UTC

    Try

    EXTENDED_TESTING=1 prove t/02-login.t

    Normally the tests themselves decide whether they should be skipped or not. The test uses Test::Is, which in this case apparently checks the EXTENDED_TESTING environment variable.

      Thank you, more than that I just had to add -Ilib too: EXTENDED_TESTING=1 prove -Ilib t/02-login.t

        BTW, the short form of prove -Ilib is prove -l.

Re: Running specific tests
by neilwatson (Priest) on Jul 04, 2016 at 15:24 UTC
    Please submit some short test code and your expected and actual results. The prove command you provided will run all tests in the argument file 't/02-login.t'. Do you mean just specific tests inside that file?

    Neil Watson
    watson-wilson.ca

      Do you mean just specific tests inside that file?

      Would be nice too. Can you tell me how to do it?

        It is impossible as the granularity is a test file

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-12-12 20:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (65 votes). Check out past polls.