"""
The functions in this module are meant to run on a separate worker process.
Exception: in single process mode _execute is called directly.
For efficiency, we copy all data needed to execute all tests into each worker
and store it in global variables. This reduces the cost of each task.
"""
= None
= None
"""Copy data shared by all test executions into worker processes"""
global
global
=
=
# We use the following strategy for dealing with Ctrl+C/KeyboardInterrupt in
# subprocesses created by the multiprocessing.Pool.
# https://noswap.com/blog/python-multiprocessing-keyboardinterrupt
"""Run one test in a multiprocessing.Pool
Side effects in this function and functions it calls are not visible in the
main lit process.
Arguments and results of this function are pickled, so they should be cheap
to copy.
"""
=
return
# TODO(python3): replace with contextlib.nullcontext
yield
=
=
return
# Do not inline! Directly used by LitTestCase.py
=
=
= -
=
=
return
=
return
=
+=
+=
return
# Support deprecated result from execute() which returned the result
# code and additional output as a tuple.
return
assert
, =
return