[llvm] bd14bb4 - [lit] Move measurement of testing time out of Run.execute
Julian Lettner via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 4 10:17:17 PST 2019
Author: Julian Lettner
Date: 2019-11-04T10:16:24-08:00
New Revision: bd14bb42f03a227c7a83db942af4680d2fe0a78d
URL: https://github.com/llvm/llvm-project/commit/bd14bb42f03a227c7a83db942af4680d2fe0a78d
DIFF: https://github.com/llvm/llvm-project/commit/bd14bb42f03a227c7a83db942af4680d2fe0a78d.diff
LOG: [lit] Move measurement of testing time out of Run.execute
Added:
Modified:
llvm/utils/lit/lit/main.py
llvm/utils/lit/lit/run.py
Removed:
################################################################################
diff --git a/llvm/utils/lit/lit/main.py b/llvm/utils/lit/lit/main.py
index af36b07f1fef..89fff9e037c7 100755
--- a/llvm/utils/lit/lit/main.py
+++ b/llvm/utils/lit/lit/main.py
@@ -7,6 +7,7 @@
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 progress_callback(test):
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 progress_callback(test):
# 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 11992c8073d2..166b64e8a1e7 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 @@ def execute(self):
# 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):
More information about the llvm-commits
mailing list