| 1 |
package Test::AllTests; |
| 2 |
|
| 3 |
use warnings; |
| 4 |
use strict; |
| 5 |
use Test::Unit::TestSuite; |
| 6 |
use Test::CopyDBTest; |
| 7 |
use Test::Debconf::DbDriver::DirTreeTest; |
| 8 |
use Test::Debconf::DbDriver::FileTest; |
| 9 |
use Test::Debconf::DbDriver::LDAPTest; |
| 10 |
|
| 11 |
sub suite { |
| 12 |
my $class = shift; |
| 13 |
|
| 14 |
# create an empty suite |
| 15 |
my $suite = Test::Unit::TestSuite->empty_new("All Tests Suite"); |
| 16 |
|
| 17 |
# add CopyDB test suite |
| 18 |
$suite->add_test(Test::CopyDBTest->suite()); |
| 19 |
|
| 20 |
# add DirTree test suite |
| 21 |
$suite->add_test(Test::Debconf::DbDriver::DirTreeTest->suite()); |
| 22 |
|
| 23 |
# add File test suite |
| 24 |
$suite->add_test(Test::Debconf::DbDriver::FileTest->suite()); |
| 25 |
|
| 26 |
# add LDAP test suite |
| 27 |
no strict 'refs'; |
| 28 |
my $ldapsuite; |
| 29 |
my $ldapsuite_method = \&{"Test::Debconf::DbDriver::LDAPTest::suite"}; |
| 30 |
eval { |
| 31 |
$ldapsuite = $ldapsuite_method->(); |
| 32 |
}; |
| 33 |
$suite->add_test($ldapsuite); |
| 34 |
|
| 35 |
# add your test suite or test case |
| 36 |
# extract suite by way of suite method and add |
| 37 |
#$suite->add_test(MyModule::Suite->suite()); |
| 38 |
|
| 39 |
# get and add another existing suite |
| 40 |
#$suite->add_test(Test::Unit::TestSuite->new("MyModule::TestCase")); |
| 41 |
|
| 42 |
|
| 43 |
# return the suite built |
| 44 |
return $suite; |
| 45 |
} |
| 46 |
|
| 47 |
1; |