summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool
diff options
context:
space:
mode:
authorGary Oberbrunner <garyo@oberbrunner.com>2014-03-30 14:53:39 (GMT)
committerGary Oberbrunner <garyo@oberbrunner.com>2014-03-30 14:53:39 (GMT)
commit29b5018f78b8fe161b76b19125eec2a164c58098 (patch)
tree711940a9fd90bb13ba470dc05e29ab81ff3c2126 /src/engine/SCons/Tool
parent1166292efdcece6306f8545fd6fb3ce44521b77d (diff)
parent32a609a88ee6d8682840dc9b2ffd31988f91a12a (diff)
downloadSCons-29b5018f78b8fe161b76b19125eec2a164c58098.zip
SCons-29b5018f78b8fe161b76b19125eec2a164c58098.tar.gz
SCons-29b5018f78b8fe161b76b19125eec2a164c58098.tar.bz2
Merged in techtonik/scons (pull request #124)
New configurable test runner for unittests
Diffstat (limited to 'src/engine/SCons/Tool')
-rw-r--r--src/engine/SCons/Tool/JavaCommonTests.py6
-rw-r--r--src/engine/SCons/Tool/PharLapCommonTests.py5
-rw-r--r--src/engine/SCons/Tool/ToolTests.py5
-rw-r--r--src/engine/SCons/Tool/javacTests.py5
-rw-r--r--src/engine/SCons/Tool/msvsTests.py6
-rw-r--r--src/engine/SCons/Tool/wixTests.py5
6 files changed, 21 insertions, 11 deletions
diff --git a/src/engine/SCons/Tool/JavaCommonTests.py b/src/engine/SCons/Tool/JavaCommonTests.py
index 76944c1..902030d 100644
--- a/src/engine/SCons/Tool/JavaCommonTests.py
+++ b/src/engine/SCons/Tool/JavaCommonTests.py
@@ -27,6 +27,9 @@ import os.path
import sys
import unittest
+import TestUnit
+
+import SCons.Scanner.IDL
import SCons.Tool.JavaCommon
@@ -570,8 +573,7 @@ if __name__ == "__main__":
for tclass in tclasses:
names = unittest.getTestCaseNames(tclass, 'test_')
suite.addTests(list(map(tclass, names)))
- if not unittest.TextTestRunner().run(suite).wasSuccessful():
- sys.exit(1)
+ TestUnit.run(suite)
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/PharLapCommonTests.py b/src/engine/SCons/Tool/PharLapCommonTests.py
index d1e7f60..e67d426 100644
--- a/src/engine/SCons/Tool/PharLapCommonTests.py
+++ b/src/engine/SCons/Tool/PharLapCommonTests.py
@@ -28,6 +28,8 @@ import os.path
import os
import sys
+import TestUnit
+
import SCons.Errors
from SCons.Tool.PharLapCommon import *
@@ -58,8 +60,7 @@ class PharLapCommonTestCase(unittest.TestCase):
if __name__ == "__main__":
suite = unittest.makeSuite(PharLapCommonTestCase, 'test_')
- if not unittest.TextTestRunner().run(suite).wasSuccessful():
- sys.exit(1)
+ TestUnit.run(suite)
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/ToolTests.py b/src/engine/SCons/Tool/ToolTests.py
index 9595680..3e6da5b 100644
--- a/src/engine/SCons/Tool/ToolTests.py
+++ b/src/engine/SCons/Tool/ToolTests.py
@@ -26,6 +26,8 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import sys
import unittest
+import TestUnit
+
import SCons.Errors
import SCons.Tool
@@ -76,8 +78,7 @@ class ToolTestCase(unittest.TestCase):
if __name__ == "__main__":
suite = unittest.makeSuite(ToolTestCase, 'test_')
- if not unittest.TextTestRunner().run(suite).wasSuccessful():
- sys.exit(1)
+ TestUnit.run(suite)
# Local Variables:
# tab-width:4
diff --git a/src/engine/SCons/Tool/javacTests.py b/src/engine/SCons/Tool/javacTests.py
index 4631c8a..bf75d8a 100644
--- a/src/engine/SCons/Tool/javacTests.py
+++ b/src/engine/SCons/Tool/javacTests.py
@@ -24,6 +24,8 @@
import os
import unittest
+import TestUnit
+
import SCons.Tool.javac
class DummyNode(object):
@@ -99,4 +101,5 @@ class pathoptTestCase(unittest.TestCase):
'')
if __name__ == "__main__":
- unittest.main()
+ suite = unittest.makeSuite(pathoptTestCase, 'test_')
+ TestUnit.run(suite)
diff --git a/src/engine/SCons/Tool/msvsTests.py b/src/engine/SCons/Tool/msvsTests.py
index 3a9cac7..2f4f302 100644
--- a/src/engine/SCons/Tool/msvsTests.py
+++ b/src/engine/SCons/Tool/msvsTests.py
@@ -25,10 +25,12 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
import sys
-import TestCmd
import unittest
import copy
+import TestCmd
+import TestUnit
+
from SCons.Tool.msvs import *
from SCons.Tool.MSCommon.vs import SupportedVSList
import SCons.Util
@@ -759,7 +761,7 @@ if __name__ == "__main__":
del os.environ[k]
suite = unittest.makeSuite(test_class, 'test_')
- if not unittest.TextTestRunner().run(suite).wasSuccessful():
+ if not TestUnit.cli.get_runner()().run(suite).wasSuccessful():
exit_val = 1
finally:
os.env = back_osenv
diff --git a/src/engine/SCons/Tool/wixTests.py b/src/engine/SCons/Tool/wixTests.py
index c815dd0..c683e98 100644
--- a/src/engine/SCons/Tool/wixTests.py
+++ b/src/engine/SCons/Tool/wixTests.py
@@ -33,6 +33,8 @@ from SCons.Tool.wix import *
from SCons.Environment import Environment
import TestCmd
+import TestUnit
+
# create fake candle and light, so the tool's exists() method will succeed
test = TestCmd.TestCmd(workdir = '')
@@ -52,8 +54,7 @@ class WixTestCase(unittest.TestCase):
if __name__ == "__main__":
suite = unittest.makeSuite(WixTestCase, 'test_')
- if not unittest.TextTestRunner().run(suite).wasSuccessful():
- sys.exit(1)
+ TestUnit.run(suite)
# Local Variables:
# tab-width:4