o
    Zh                     @   sF   d dl mZ d dlmZmZ d dlmZmZ d dlZG dd dZ	dS )    )	sysconfig)CCompilerErrorDistutilsPlatformError)is_mingwsplit_quotedNc                   @   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 )TestMingw32CCompilerznot on mingw)reasonc                 C   s$   ddl m} | }|jdksJ d S )Nr   Mingw32CCompilerZmingw32)distutils.cygwinccompilerr
   Zcompiler_typeselfr
   compiler r   f/var/www/html/lang_env/lib/python3.10/site-packages/setuptools/_distutils/tests/test_mingwccompiler.pytest_compiler_type	   s   z'TestMingw32CCompiler.test_compiler_typec                 C   s   ddl m} |dd |dd | }|jtdksJ |jtdks'J |jtd	ks0J |jtdks9J |jtd
ksBJ d S )Nr   r	   CCccCXXzc++zcc -O -Wallzcc -shared -O -Wallzc++ -O -Wallz
cc -shared)	r   r
   Zsetenvr   r   Zcompiler_soZcompiler_cxxZ
linker_exeZ	linker_so)r   monkeypatchr
   r   r   r   r   test_set_executables   s   z)TestMingw32CCompiler.test_set_executablesc                 C   sL   ddl m} | }tt |d W d    d S 1 sw   Y  d S )Nr   r	   z/usr/lib)r   r
   pytestraisesr   Zruntime_library_dir_optionr   r   r   r   test_runtime_library_dir_option   s
   "z4TestMingw32CCompiler.test_runtime_library_dir_optionc                 C   sV   dd l }||jddd  tt |j  W d    d S 1 s$w   Y  d S )Nr   Zis_cygwinccc                 S   s   dS )NTr   )_r   r   r   <lambda>+   s    z:TestMingw32CCompiler.test_cygwincc_error.<locals>.<lambda>)r   setattrZcygwinccompilerr   r   r   r
   )r   r   	distutilsr   r   r   test_cygwincc_error'   s
   "z(TestMingw32CCompiler.test_cygwincc_errorzsys.platform == "cygwin"c                 C   s    ddl m} | }t| d S )Nr   r	   )r   r
   r   Zcustomize_compilerr   r   r   r   (test_customize_compiler_with_msvc_python0   s   z=TestMingw32CCompiler.test_customize_compiler_with_msvc_pythonN)__name__
__module____qualname__r   markZskipifr   r   r   r   r   r   r   r   r   r   r      s    




r   )
r   r   Zdistutils.errorsr   r   Zdistutils.utilr   r   r   r   r   r   r   r   <module>   s
    