summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xllvm/utils/lit/lit/main.py10
-rw-r--r--llvm/utils/lit/lit/run.py8
2 files changed, 8 insertions, 10 deletions
diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py
index af36b07f1fe..89fff9e037c 100755
--- a/llvm/utils/lit/lit/main.py
+++ b/llvm/utils/lit/lit/main.py
@@ -7,6 +7,7 @@ See lit.pod for more information.
import os
import platform
import sys
+import time
import lit.cl_arguments
import lit.discovery
@@ -85,7 +86,9 @@ def main(builtin_params = {}):
opts.numWorkers = min(len(tests), opts.numWorkers)
- elapsed = run_tests(tests, litConfig, opts, numTotalTests)
+ start = time.time()
+ run_tests(tests, litConfig, opts, numTotalTests)
+ elapsed = time.time() - start
print_summary(tests, elapsed, opts)
@@ -192,7 +195,7 @@ def run_tests(tests, litConfig, opts, numTotalTests):
display.print_header()
try:
- elapsed = execute_in_tmp_dir(run, litConfig)
+ execute_in_tmp_dir(run, litConfig)
except KeyboardInterrupt:
#TODO(yln): should we attempt to cleanup the progress bar here?
sys.exit(2)
@@ -203,7 +206,6 @@ def run_tests(tests, litConfig, opts, numTotalTests):
# display.clear()
display.clear()
- return elapsed
def execute_in_tmp_dir(run, litConfig):
# Create a temp directory inside the normal temp directory so that we can
@@ -226,7 +228,7 @@ def execute_in_tmp_dir(run, litConfig):
# scanning for stale temp directories, and deleting temp directories whose
# lit process has died.
try:
- return run.execute()
+ run.execute()
finally:
if tmp_dir:
try:
diff --git a/llvm/utils/lit/lit/run.py b/llvm/utils/lit/lit/run.py
index 11992c8073d..166b64e8a1e 100644
--- a/llvm/utils/lit/lit/run.py
+++ b/llvm/utils/lit/lit/run.py
@@ -1,6 +1,6 @@
import multiprocessing
-import time
import os
+import time
import lit.Test
import lit.util
@@ -51,19 +51,15 @@ class Run(object):
# Larger timeouts (one year, positive infinity) don't work on Windows.
one_week = 7 * 24 * 60 * 60 # days * hours * minutes * seconds
timeout = self.timeout or one_week
+ deadline = time.time() + timeout
- start = time.time()
- deadline = start + timeout
self._execute(deadline)
- end = time.time()
# Mark any tests that weren't run as UNRESOLVED.
for test in self.tests:
if test.result is None:
test.setResult(lit.Test.Result(lit.Test.UNRESOLVED, '', 0.0))
- return end - start
-
# TODO(yln): as the comment says.. this is racing with the main thread waiting
# for results
def _process_result(self, test, result):
OpenPOWER on IntegriCloud