U
    aÊ¹jš  ã                   @   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   ún/var/www/html/bwave/python/venv/lib/python3.8/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<t‚|jtdƒksNt‚|jtd	ƒks`t‚|jtdƒksrt‚|j	td
ƒks„t‚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   