forked from lsbardel/python-stdnet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runtests.py
executable file
·39 lines (29 loc) · 1.05 KB
/
runtests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
'''Stdnet asynchronous test suite. Requires pulsar_.
.. _pulsar:
'''
from stdnet.conf import settings
from stdnet.utils import PPath
p = PPath(__file__)
p.add(module = 'pulsar', up = 1, down = ('pulsar',))
from pulsar.apps.test import TestSuite, TestOptionPlugin
from pulsar.apps.test.plugins import bench
class TestServer(TestOptionPlugin):
name = "server"
flags = ["-s", "--server"]
desc = 'Backend server where to run tests.'
default = settings.DEFAULT_BACKEND
def configure(self, cfg):
settings.DEFAULT_BACKEND = cfg.server
class TestDataSize(TestOptionPlugin):
name = "size"
flags = ["--size"]
desc = 'Size of the dataset to test. Choose one between "tiny", "small",\
"normal", "big", "huge".'
default = 'small'
if __name__ == '__main__':
suite = TestSuite(description = 'Stdnet Asynchronous test suite',
modules = ('tests','stdnet.apps'),
plugins = (TestServer(),bench.BenchMark(),)
)
suite.start()