diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-01-06 14:43:00 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-01-06 14:43:00 +0100 |
commit | 8fd982b7d2b98b813465b21700be68c59c07f3d9 (patch) | |
tree | 03aede76927c05790d182c16c63262a315f0250c /scripts/Util.py | |
parent | Fixed ICE-7487 - C# AMI failure (diff) | |
download | ice-8fd982b7d2b98b813465b21700be68c59c07f3d9.tar.bz2 ice-8fd982b7d2b98b813465b21700be68c59c07f3d9.tar.xz ice-8fd982b7d2b98b813465b21700be68c59c07f3d9.zip |
Added --show-durations to allTests.py
Diffstat (limited to 'scripts/Util.py')
-rw-r--r-- | scripts/Util.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scripts/Util.py b/scripts/Util.py index c97c78024e0..4f7174fad7e 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -1478,6 +1478,13 @@ class Result: self._stdout = StringIO() self._writeToStdout = writeToStdout self._testcases = {} + self._duration = 0 + + def start(self): + self._duration = time.time() + + def finished(self): + self._duration = time.time() - self._duration def started(self, testcase): self._start = self._stdout.tell() @@ -1497,6 +1504,9 @@ class Result: def getFailed(self): return self._failed + def getDuration(self): + return self._duration + def getOutput(self, testcase=None): if testcase: if testcase in self._testcases: @@ -1606,6 +1616,7 @@ class TestSuite: def run(self, current): try: + current.result.start() cwd=None if self.chdir: cwd = os.getcwd() @@ -1613,6 +1624,7 @@ class TestSuite: current.driver.runTestSuite(current) finally: if cwd: os.chdir(cwd) + current.result.finished() def teardown(self, current, success): pass @@ -2043,7 +2055,7 @@ class BrowserProcessController(RemoteProcessController): # capabilities["acceptInsecureCerts"] = True # capabilities["moz:firefoxOptions"] = {} # capabilities["moz:firefoxOptions"]["binary"] = "/Applications/FirefoxNightly.app/Contents/MacOS/firefox-bin" - if isinstance(platform, Linux) and os.environ.get("DISPLAY") != ":1": + if isinstance(platform, Linux) and os.environ.get("DISPLAY", "") != ":1" and os.environ.get("USER", "") == "jenkins": current.writeln("error: DISPLAY is unset, setting it to :1") os.environ["DISPLAY"] = ":1" |