source: branches/active/character_customization/game/run_tests.py @ 833

Revision 685, 1.2 KB checked in by technomage, 8 years ago (diff)

Patch by Technomage

  • Replaced the test_dialogue.py testsuite with the test_dialogueprocessor.py testsuite and added/updated unittest TestCases? for all public methods of the DialogueProcessor? class.
  • DialogueProcessor? was refactored to be much more liberal about raising exceptions instead of silently handling errors; the code documentation has been updated to describe this new behavior.
  • Refactored exception-handling code in the dialogueparsers.py gamemodel.py modules related to the dialogue engine to deal with the changes to the DialogueProcessor? class.
  • Added a new method to the Dialogue class, getRootSection, which returns the root DialogueSection? for the a particular dialogue; also added some error checking code for inputs to the constructor.
  • Updated the run_tests.py script to import config.py and attempt to read the FIFE Python module path from it, just like run.py.
  • Property svn:eol-style set to native
  • Property svn:executable set to *
Line 
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
17import sys, os, unittest
18
19#Check if config.py exists. Get 'fife_path' from config
20try:
21    import config
22    sys.path.append(config.fife_path)
23except:
24    pass
25
26def _jp(path):
27    return os.path.sep.join(path.split('/'))
28
29_paths = ('../../engine/swigwrappers/python', '../../engine/extensions','tests')
30test_suite = unittest.TestSuite()
31
32for p in _paths:
33    if p not in sys.path:
34        sys.path.append(_jp(p))
35
36for p in os.listdir("tests") :
37    if p[-3:] == ".py" :
38        test_suite.addTest(unittest.TestLoader().loadTestsFromName(p[:-3]))
39
40unittest.TextTestRunner(verbosity=2).run(test_suite)
Note: See TracBrowser for help on using the repository browser.