[Perlunit-users] Using @TESTS for changing tests execution order
Status: Beta
Brought to you by:
mca1001
|
From: Dmitry D. <dd...@ic...> - 2003-10-04 06:06:50
|
Hi All!
I read from TestCase.pm POD that one can populate @TESTS array in order
to specify the desired order of tests execution:
### quote begin
If you need to specify the test order, you can do one of the
following:
=over 4
=item * Set @TESTS
our @TESTS = qw(my_test my_test_2);
This is the simplest, and recommended way.
### quote end
But the above does not work for me. I can include only desired tests
using @TESTS, but they are listed and executed in a random order,
although I name them as test_001_foo, test_oo2_bar, etc. I think that
the reason is in the following return statement (line 114 of TestCase.pm):
return keys %tests;
I decided to override list_tests method like this:
sub list_tests {
my $self = shift;
return sort $self->SUPER::list_tests(@_);
}
It works as expected. What do you think? Am I missing something?
Thanks
Dmitry.
|