source: trunk/game/run_tests.py @ 310

Revision 284, 1.1 KB checked in by b0rland_parpg, 10 years ago (diff)

Ticket #67: patch by b0rland

  • Added GPL headers to test scripts
  • Added descriptions to test methods
  • Added the try/except guard to Openable class where it accesses GameObject?'s method (being overcautious)
  • Added tests for Openable class
  • Renamed some more test classes to match the naming convention
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
1#!/usr/bin/python
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
17import sys, os, unittest
18
19def _jp(path):
20    return os.path.sep.join(path.split('/'))
21
22_paths = ('../../engine/swigwrappers/python', '../../engine/extensions','tests')
23test_suite = unittest.TestSuite()
24
25for p in _paths:
26    if p not in sys.path:
27        sys.path.append(_jp(p))
28
29for p in os.listdir("tests") :
30    if p[-3:] == ".py" :
31        test_suite.addTest(unittest.TestLoader().loadTestsFromName(p[:-3]))
32
33unittest.TextTestRunner(verbosity=2).run(test_suite)
Note: See TracBrowser for help on using the repository browser.