annotate test/grind.py @ 396:fb3c1f029b30

Added baselexer into c3 lexer
author Windel Bouwman
date Tue, 27 May 2014 22:19:32 +0200
parents 39bf68bf1891
children
rev   line source
303
be7f60545368 Final fixups
Windel Bouwman
parents: 287
diff changeset
1 #!/usr/bin/python
245
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
2
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
3 import cProfile
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
4 import unittest
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
5 import pstats
307
e609d5296ee9 Massive rewrite of codegenerator
Windel Bouwman
parents: 303
diff changeset
6 import sys
e609d5296ee9 Massive rewrite of codegenerator
Windel Bouwman
parents: 303
diff changeset
7 import os
e609d5296ee9 Massive rewrite of codegenerator
Windel Bouwman
parents: 303
diff changeset
8
323
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 311
diff changeset
9 p = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'python')
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 311
diff changeset
10 sys.path.insert(0, p)
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 311
diff changeset
11
245
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
12 if __name__ == '__main__':
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
13 suite = unittest.TestLoader().discover('.')
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
14 def runtests():
66912720d712 Added grinder
Windel Bouwman
parents:
diff changeset
15 unittest.TextTestRunner().run(suite)
261
444b9df2ed99 try to split up code generation
Windel Bouwman
parents: 245
diff changeset
16 #s = cProfile.run('runtests()',sort='cumtime')
323
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 311
diff changeset
17 p = cProfile.Profile()
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 311
diff changeset
18 s = p.run('runtests()')
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 311
diff changeset
19 stats = pstats.Stats(p)
366
39bf68bf1891 Fix sample tests and deterministic build
Windel Bouwman
parents: 323
diff changeset
20 #stats.sort_stats('tottime')
39bf68bf1891 Fix sample tests and deterministic build
Windel Bouwman
parents: 323
diff changeset
21 stats.sort_stats('cumtime')
323
e9fe6988497c Used burg for generating expressions
Windel Bouwman
parents: 311
diff changeset
22 stats.print_stats(.1)