Add build script for Linux.
[matthijs/upstream/mobilegtd.git] / tests / test_all.py
1 import nose
2 import os
3 from nose.selector import Selector
4 from nose.plugins import Plugin
5
6 import unittest
7
8
9 class MySelector(Selector):
10     def wantDirectory(self, dirname):
11         parts = dirname.split(os.path.sep)
12         return 'specs' in parts
13     def wantFile(self, filepath):
14         
15         # we want python modules under specs/
16         dirname,filename = os.path.split(filepath)
17         base, ext = os.path.splitext(filename)
18         return self.wantDirectory(dirname) and ext == '.py' and base[0:2] != '__'
19     def wantModule(self, module):
20         # wantDirectory and wantFile above will ensure that
21         # we never see an unwanted module
22         return True
23     def wantFunction(self, function):
24         # never collect functions
25         return False
26     def wantClass(self, cls):
27         # only collect TestCase subclasses
28         return issubclass(cls, unittest.TestCase)
29
30 class UseMySelector(Plugin):
31     enabled = True
32     def configure(self, options, conf):
33         pass # always on
34     def prepareTestLoader(self, loader):
35         loader.selector = MySelector(loader.config)
36 nose.main(plugins=[UseMySelector()])