in reply to Running specific test cases with Test::Class

Test::Class shows you very clearly how to run individual tests. You're telling it to run all tests. Better:
use Example::Module1; $ENV{TEST_METHOD} = 't001'; use Example::Module2; $ENV{TEST_METHOD} = 't002'; Test::Class->runtests;

Replies are listed 'Best First'.
Re^2: Running specific test cases with Test::Class
by mkhan (Sexton) on Aug 16, 2011 at 18:01 UTC
    Thanks for your response.
    I tried what you mentioned.
    The problem with that solution is that since there also exists a t002 in Module1, it executes that one as well along with the t002 of Module2.

    That's my real problem.
      How about this:
      #!/usr/bin/perl use strict; use warnings; use Example::Test; $ENV{TEST_METHOD} = '/path/to//Example-Module1/t/t001'; Test::Class->runtests; $ENV{TEST_METHOD} = '/path/to/Example-Module2/t/t002'; Test::Class->runtests;
        t001, t002 etc are not files.
        They are test cases/subroutines within the Module1.pm and Module2.pm.