Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Running specific tests

by guiwp (Sexton)
on Jul 04, 2016 at 15:18 UTC ( #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


    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

      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?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2023-09-27 01:15 GMT
Find Nodes?
    Voting Booth?

    No recent polls found