o
    !gl                     @   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    