[PATCH] D31677: [lit] Use process pools for test execution by default
Michał Górny via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 25 15:26:53 PDT 2017
mgorny added a comment.
This commit breaks the unittest adaptor:
FAIL: lit :: unittest-adaptor.py (1 of 1)
More specifically, the `execute_test()` method is broken:
======================================================================
ERROR: runTest (lit.LitTestCase.LitTestCase)
unittest-adaptor :: test-one.txt
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/src/llvm/utils/lit/lit/LitTestCase.py", line 27, in runTest
self._run.execute_test(self._test)
File "/usr/src/llvm/utils/lit/lit/run.py", line 221, in execute_test
return execute_test(test, self.lit_config, self.parallelism_semaphores)
AttributeError: 'Run' object has no attribute 'parallelism_semaphores'
================
Comment at: llvm/trunk/utils/lit/lit/run.py:221
def execute_test(self, test):
- pg = test.config.parallelism_group
- if callable(pg): pg = pg(test)
-
- result = None
- semaphore = None
- try:
- if pg: semaphore = self.parallelism_semaphores[pg]
- if semaphore: semaphore.acquire()
- start_time = time.time()
- result = test.config.test_format.execute(test, self.lit_config)
-
- # Support deprecated result from execute() which returned the result
- # code and additional output as a tuple.
- if isinstance(result, tuple):
- code, output = result
- result = lit.Test.Result(code, output)
- elif not isinstance(result, lit.Test.Result):
- raise ValueError("unexpected result from test execution")
-
- result.elapsed = time.time() - start_time
- except KeyboardInterrupt:
- raise
- except:
- if self.lit_config.debug:
- raise
- output = 'Exception during script execution:\n'
- output += traceback.format_exc()
- output += '\n'
- result = lit.Test.Result(lit.Test.UNRESOLVED, output)
- finally:
- if semaphore: semaphore.release()
-
- test.setResult(result)
+ return execute_test(test, self.lit_config, self.parallelism_semaphores)
----------------
`self.parallelism_semaphores` are not defined in this context.
Repository:
rL LLVM
https://reviews.llvm.org/D31677
More information about the llvm-commits
mailing list