o
    5‘ðil  ã                   @   sR   d dl mZ d dlmZ d dlmZmZ d dlZddlm	Z	m
Z
 G dd„ dƒZdS )	é    )Ú	sysconfig)ÚDistutilsPlatformError)Úis_mingwÚsplit_quotedNé   )ÚcygwinÚerrorsc                   @   s�   e Zd Zejjeƒ  dd�dd„ ƒZejjeƒ  dd�dd„ ƒZejjeƒ  dd�dd„ ƒZ	ejjeƒ  dd�d	d
„ ƒZ
ej d¡dd„ ƒZdS )ÚTestMinGW32Compilerznot on mingw)Úreasonc                 C   s   t  ¡ }|jdksJ ‚d S )NÚmingw32)r   ÚMinGW32CompilerÚcompiler_type©ÚselfÚcompiler© r   úq/root/parts/websockify/install/lib/python3.10/site-packages/setuptools/_distutils/compilers/C/tests/test_mingw.pyÚtest_compiler_type   s   z&TestMinGW32Compiler.test_compiler_typec                 C   s~   |  dd¡ |  dd¡ t ¡ }|jtdƒksJ ‚|jtdƒks"J ‚|jtdƒks+J ‚|jtdƒks4J ‚|jtdƒks=J ‚d S )	NÚCCÚccÚCXXzc++zcc -O -Wallzcc -shared -O -Wallzc++ -O -Wallz
cc -shared)	Úsetenvr   r   r   r   Úcompiler_soÚcompiler_cxxÚ
linker_exeÚ	linker_so)r   Úmonkeypatchr   r   r   r   Útest_set_executables   s   z(TestMinGW32Compiler.test_set_executablesc                 C   sB   t  ¡ }t t¡� | d¡ W d   ƒ d S 1 sw   Y  d S )Nz/usr/lib)r   r   ÚpytestÚraisesr   Úruntime_library_dir_optionr   r   r   r   Útest_runtime_library_dir_option   s   "ÿz3TestMinGW32Compiler.test_runtime_library_dir_optionc                 C   sL   |  tddd„ ¡ t tj¡� t ¡  W d   ƒ d S 1 sw   Y  d S )NÚis_cygwinccc                 S   s   dS )NTr   )Ú_r   r   r   Ú<lambda>%   s    z9TestMinGW32Compiler.test_cygwincc_error.<locals>.<lambda>)Úsetattrr   r   r   r   ÚErrorr   )r   r   r   r   r   Útest_cygwincc_error#   s   
"ÿz'TestMinGW32Compiler.test_cygwincc_errorzsys.platform == "cygwin"c                 C   s   t  ¡ }t |¡ d S )N)r   r   r   Úcustomize_compilerr   r   r   r   Ú(test_customize_compiler_with_msvc_python*   s   z<TestMinGW32Compiler.test_customize_compiler_with_msvc_pythonN)Ú__name__Ú
__module__Ú__qualname__r   ÚmarkÚskipifr   r   r   r!   r'   r)   r   r   r   r   r	   
   s    




r	   )Ú	distutilsr   Údistutils.errorsr   Údistutils.utilr   r   r   Ú r   r   r	   r   r   r   r   Ú<module>   s    