-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Janik Zikovsky
committed
Dec 23, 2011
1 parent
8eca95a
commit ecde61f
Showing
2 changed files
with
30 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
""" | ||
Utility functions for running python test scripts | ||
inside MantidPlot. | ||
""" | ||
import sys | ||
import os | ||
import unittest | ||
import time | ||
|
||
def runTests(classname): | ||
""" Run the test suite in the class. | ||
Uses the XML runner if the MANTID_SOURCE environment variable was set. | ||
""" | ||
# Custom code to create and run this single test suite | ||
suite = unittest.TestSuite() | ||
suite.addTest( unittest.makeSuite(classname) ) | ||
# Get the XML runner if the environment variable was set | ||
src = os.getenv('MANTID_SOURCE') | ||
if src is None: | ||
runner = unittest.TextTestRunner() | ||
else: | ||
sys.path.append( os.path.join(src, "TestingTools/unittest-xml-reporting/src") ) | ||
import xmlrunner | ||
runner = xmlrunner.XMLTestRunner(output='Testing') | ||
#Run using either runner | ||
runner.run(suite) |