view test/grind.py @ 398:c0d9837acde8

x86 target refactor
author Windel Bouwman
date Thu, 29 May 2014 12:13:37 +0200
parents 39bf68bf1891
children
line wrap: on
line source

#!/usr/bin/python

import cProfile
import unittest
import pstats
import sys
import os

p = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'python')
sys.path.insert(0, p)

if __name__ == '__main__':
    suite = unittest.TestLoader().discover('.')
    def runtests():
        unittest.TextTestRunner().run(suite)
    #s = cProfile.run('runtests()',sort='cumtime')
    p = cProfile.Profile()
    s = p.run('runtests()')
    stats = pstats.Stats(p)
    #stats.sort_stats('tottime')
    stats.sort_stats('cumtime')
    stats.print_stats(.1)