Commits

Matt Williams  committed 0a3df8f

Add a cProfile benchmark.

  • Participants
  • Parent commits 2236b70

Comments (0)

Files changed (2)

File doxylink/test/test_parser.py

 
 from sphinxcontrib.doxylink import parsing
 
+try:
+    import cProfile as profile
+except ImportError:
+    import profile
+
 class TestNormalise(unittest.TestCase):
 	def setUp(self):
 		#List of tuples of: (input, correct output)
 		for arglist in self.arglists:
 			self.assertEqual(parsing.normalise(arglist[0]), arglist[1])
 
-if __name__ == '__main__':
-    unittest.main()
-
+profile.runctx("parsing.normalise('( QWidget * parent = 0, const char * name = 0, Qt::WindowFlags f = 0 )')", globals(), locals())

File doxylink/tox.ini

 [tox]
-envlist=python,doc
+envlist=benchmark,python,doc
+
+[testenv:benchmark]
+deps=
+	py
+commands=
+	python -m cProfile test/test_parser.py
 
 [testenv:python]
 deps=