aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Lettner <julian.lettner@gmail.com>2019-02-25 21:14:43 -0800
committerJulian Lettner <julian.lettner@apple.com>2019-11-04 10:16:24 -0800
commitbd14bb42f03a227c7a83db942af4680d2fe0a78d (patch)
tree41d3955ab4e8cbcd77f9348752f35f7d22cc762e
parentd8f2bff75126c6dde694ad245f9807fa12ad5630 (diff)
downloadllvm-bd14bb42f03a227c7a83db942af4680d2fe0a78d.zip
llvm-bd14bb42f03a227c7a83db942af4680d2fe0a78d.tar.gz
llvm-bd14bb42f03a227c7a83db942af4680d2fe0a78d.tar.bz2
[lit] Move measurement of testing time out of Run.execute
-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 af36b07..89fff9e 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 11992c80..166b64e 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):