303
|
1 #!/usr/bin/python
|
245
|
2
|
|
3 import cProfile
|
|
4 import unittest
|
|
5 import pstats
|
307
|
6 import sys
|
|
7 import os
|
|
8
|
323
|
9 p = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'python')
|
|
10 sys.path.insert(0, p)
|
|
11
|
245
|
12 if __name__ == '__main__':
|
|
13 suite = unittest.TestLoader().discover('.')
|
|
14 def runtests():
|
|
15 unittest.TextTestRunner().run(suite)
|
261
|
16 #s = cProfile.run('runtests()',sort='cumtime')
|
323
|
17 p = cProfile.Profile()
|
|
18 s = p.run('runtests()')
|
|
19 stats = pstats.Stats(p)
|
|
20 stats.sort_stats('tottime')
|
|
21 stats.print_stats(.1)
|