in reply to Problem with orderly execution of test cases in .t file

the problem is that the modules are called/executed at random order

How do you know that?

Please let me know how they can be executed serially...

Given the code you've posted, there's no obvious reason why you might see the results you see. The Perl parser does indeed execute the use statements in order. However, if one of those modules itself uses another of those modules, you may see them getting loaded in an order different from the order in this file.

You can verify this with the Devel::TraceUse module.

  • Comment on Re: Problem with orderly execution of test cases in .t file

Replies are listed 'Best First'.
Re^2: Problem with orderly execution of test cases in .t file
by Anonymous Monk on Jun 16, 2011 at 18:07 UTC
    one of those modules itself uses another of those modules, Whats the solution for this? Its happening for this.
      Whats the solution for this?

      Don't run tests on import(). Add a static method to each module to run its tests.

      Use something like Test::Routine or Test::Class to organize your test cases.