1
# arch-tag: cd547407-1daf-41ce-a75b-5fb8f5590f33
2
# Copyright (C) 2004 Canonical Ltd.
3
# 2004 David Allouche <david@allouche.net>
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, write to the Free Software
17
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
43
mod = __import__(name)
44
components = name.split('.')
45
for comp in components[1:]:
46
mod = getattr(mod, comp)
49
def test_suite(limit=()):
50
excluded = ('test_suite', 'test_twisted', 'test_twisted_arch')
51
suite = unittest.TestSuite()
53
for test_name in limit:
54
components = test_name.split('.')
55
assert len(components) in (1,2)
56
module_name = components[0]
57
module = my_import('%s.test_%s' % (__name__, module_name))
58
module_limit = components[1:]
59
suite.addTest(module.test_suite(module_limit))
61
for module_name in __all__:
62
if module_name in excluded: continue
63
if not module_name.startswith('test_'): continue
64
module = my_import('%s.%s' % (__name__, module_name))
65
suite.addTest(module.test_suite())
69
from arch.tests import framework
70
return framework.run_test_suite(argv, test_suite)