source: trunk/game/run_tests.py @ 279

Revision 279, 482 bytes checked in by b0rland_parpg, 10 years ago (diff)

Ticket #67: Patch by b0rland

  • Moved GameObject? tests to a separate file and added more tests
  • Rewrote run_tests to automatically execute all tests from tests directory
  • Converted all tests into camelCase naming convention
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#!/usr/bin/python
2import sys, os, unittest
3
4def _jp(path):
5    return os.path.sep.join(path.split('/'))
6
7_paths = ('../../engine/swigwrappers/python', '../../engine/extensions','tests')
8test_suite = unittest.TestSuite()
9
10for p in _paths:
11    if p not in sys.path:
12        sys.path.append(_jp(p))
13
14for p in os.listdir("tests") :
15    if p[-3:] == ".py" :
16        test_suite.addTest(unittest.TestLoader().loadTestsFromName(p[:-3]))
17
18unittest.TextTestRunner(verbosity=2).run(test_suite)
Note: See TracBrowser for help on using the repository browser.