B
    u9až  ã               @   s€   d Z ddlZddlZddlZddlZddlmZ ddlmZm	Z	 e	edƒ e	edƒ G dd„ deƒZ
d	d
„ Zedkr|e ¡  dS )z/This test checks for correct wait4() behavior.
é    N)ÚForkWait)Úreap_childrenÚget_attributeÚforkÚwait4c               @   s   e Zd Zdd„ ZdS )Ú	Wait4Testc             C   s’   t j}tj d¡rd}t ¡ d }x6t ¡ |krXt  ||¡\}}}||krLP t d¡ q$W |  	||¡ |  	|dd|d@ |d? f ¡ |  
|¡ d S )NZaixr   g      $@gš™™™™™¹?zcause = %d, exit = %déÿ   é   )ÚosÚWNOHANGÚsysÚplatformÚ
startswithÚtimeZ	monotonicr   ZsleepZassertEqualZ
assertTrue)ÚselfZcpidÚoptionZdeadlineZspidÚstatusZrusage© r   ú /usr/lib/python3.7/test_wait4.pyÚ	wait_impl   s    zWait4Test.wait_implN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s   r   c               C   s
   t ƒ  d S )N)r   r   r   r   r   ÚtearDownModule#   s    r   Ú__main__)Ú__doc__r
   r   r   ZunittestZtest.fork_waitr   Ztest.supportr   r   r   r   r   Úmainr   r   r   r   Ú<module>   s   

