* Better Patch for Configfile handling
[opeanno-debian-packaging.git] / run_tests.py
blob791b79fc0d7b9bca81552d40a067c95ba75e926c
1 #!/usr/bin/env python
3 # ###################################################
4 # Copyright (C) 2008 The OpenAnno Team
5 # team@openanno.org
6 # This file is part of OpenAnno.
8 # OpenAnno is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the
20 # Free Software Foundation, Inc.,
21 # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 # ###################################################
25 import os
26 import sys
27 import openanno
28 import unittest
30 if __name__ == '__main__':
31 # the usual setup:
32 openanno.findFIFE()
33 sys.path.append('game/ext')
34 import game.main
36 loader = unittest.TestLoader()
37 result = unittest.TestResult()
38 suite = unittest.TestSuite()
40 from tests import *
43 # add tests here:
44 suite.addTest(loader.loadTestsFromModule(pathfinding))
48 suite.run(result)
51 print "\nRESULTS:\n"
53 print result.testsRun, 'tests were run'
54 print 'All successful:', result.wasSuccessful()
56 if not result.wasSuccessful():
58 print
60 print len(result.failures),'Failures:'
61 for (case, error) in result.failures:
62 print 'Case:', case
63 print error
64 print
66 print
68 print len(result.errors),'Errors:'
69 for (case, error) in result.errors:
70 print 'Case:', case
71 print error
72 print