File: //snap/core18/current/usr/lib/python3.6/test/libregrtest/__pycache__/runtest_mp.cpython-36.pyc
3
�ähg � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlm Z yd dl
Z
W n& ek
r~ ed� ej
d� Y nX d dlmZmZmZmZmZ d dlmZ d dlmZ dZd Zd
d� Zdd
� ZG dd� d�ZG dd� de
j�Zdd� ZdS )� N)�supportz+Multiprocess option requires thread support� )�runtest�INTERRUPTED�CHILD_ERROR�PROGRESS_MIN_TIME�format_test_result)�setup_tests)�format_durationg >@g @c
C s� ddl m}m} t|�}|| f}tj|�}tjftj � dddd|f�}|j
rV|dg7 }||||dtjd ktj
d
�}|� |j� \}} |j� }
W dQ R X |
|| fS )a) Run the given test in a subprocess with --worker-args.
ns is the option Namespace parsed from command-line arguments. regrtest
is invoked in a subprocess with the --worker-args argument; when the
subprocess exits, its return code, stdout and stderr are returned as a
3-tuple.
r )�Popen�PIPEz-uz-mz
test.regrtestz
--worker-argsz--pgoT�nt)�stdout�stderrZuniversal_newlinesZ close_fds�cwdN)�
subprocessr r �vars�json�dumps�sys�
executabler Zargs_from_interpreter_flags�pgo�os�nameZSAVEDCWDZcommunicate�wait)�testname�nsr r �ns_dict�worker_args�cmd�popenr r �retcode� r"