Module run_tests
[hide private]
[frames] | no frames]

Source Code for Module run_tests

 1  #!/usr/bin/env python2 
 2   
 3  #   This program is free software: you can redistribute it and/or modify 
 4  #   it under the terms of the GNU General Public License as published by 
 5  #   the Free Software Foundation, either version 3 of the License, or 
 6  #   (at your option) any later version. 
 7   
 8  #   This program is distributed in the hope that it will be useful, 
 9  #   but WITHOUT ANY WARRANTY; without even the implied warranty of 
10  #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
11  #   GNU General Public License for more details. 
12   
13  #   You should have received a copy of the GNU General Public License 
14  #   along with this program.  If not, see <http://www.gnu.org/licenses/>. 
15   
16   
17  import sys, os, unittest 
18   
19  #Check if config.py exists. Get 'fife_path' from config 
20  try: 
21      import config 
22      sys.path.append(config.fife_path) 
23  except: 
24      pass 
25   
26 -def _jp(path):
27 return os.path.sep.join(path.split('/'))
28 29 _paths = ('../../engine/swigwrappers/python', '../../engine/extensions','tests') 30 test_suite = unittest.TestSuite() 31 32 for p in _paths: 33 if p not in sys.path: 34 sys.path.append(_jp(p)) 35 36 for p in os.listdir("tests") : 37 if p[-3:] == ".py" : 38 test_suite.addTest(unittest.TestLoader().loadTestsFromName(p[:-3])) 39 40 unittest.TextTestRunner(verbosity=2).run(test_suite) 41