U
    ui                     @   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 td S )Nr   Mingw32CCompilerZmingw32)distutils.cygwinccompilerr
   compiler_typeAssertionErrorselfr
   compiler r   S/tmp/pip-unpacked-wheel-9osl9suo/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<t|jtdksNt|jtd	ks`t|jtdksrt|j	td
kst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   r   compiler_socompiler_cxx
linker_exe	linker_so)r   monkeypatchr
   r   r   r   r   test_set_executables   s    z)TestMingw32CCompiler.test_set_executablesc              	   C   s6   ddl m} | }tt |d W 5 Q R X 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   s@   dd l }||jddd  tt |j  W 5 Q R X d S )Nr   Zis_cygwinccc                 S   s   dS )NTr   )_r   r   r   <lambda>+       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   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   distutils.errorsr   r   distutils.utilr   r   r   r   r   r   r   r   <module>   s   