http://www.perlmonks.org?node_id=1167150

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