o
    2g                     @  sf   d Z ddlmZ ddlZddlZddlZddlZddlZej	ej
eddZG dd dejZdS )z*Test cases that run tests as subprocesses.    )annotationsNz..c                   @  s*   e Zd ZeejdddddZdS )	TestExternalwinzrt tests don't work on windowsreturnNonec              	   C  s   g }t j }tjdkr|ddg7 }d||d< t E}tj	tj
ddd| d	| g|t jtd
dd}t j }dt jvrFd|d< tjtj
ddg||d}|dkrZtdW d   dS 1 sew   Y  dS )z!Run C unit tests in a subprocess.darwinz-mmacosx-version-min=10.10z-stdlib=libc++ CPPFLAGSzsetup.py	build_extz--build-lib=z--build-temp=mypyczlib-rt)envcwdGTEST_COLORyesz-cz6import sys, test_capi; sys.exit(test_capi.run_tests())r   zmake test: C unit test failureN)osenvironcopysysplatformjointempfileTemporaryDirectory
subprocess
check_call
executablepathbase_dircallAssertionError)selfcppflagsr   tmpdirstatus r#   P/home/garg/my-data/venv/lib/python3.10/site-packages/mypyc/test/test_external.pytest_c_unit_test   s8   





"zTestExternal.test_c_unit_testN)r   r   )	__name__
__module____qualname__unittestskipIfr   r   
startswithr%   r#   r#   r#   r$   r      s    r   )__doc__
__future__r   r   r   r   r   r)   r   r   dirname__file__r   TestCaser   r#   r#   r#   r$   <module>   s    