U
    aÊ¹jÁ
  ã                   @   sz   d Z ddlZddlZddlmZ ddlmZmZmZm	Z	m
Z
 ddlmZ ddlZejdd�dd	„ ƒZG d
d„ dejƒZdS )z$Tests for distutils.cygwinccompiler.é    N)Ú	sysconfig)ÚCONFIG_H_NOTOKÚCONFIG_H_OKÚCONFIG_H_UNCERTAINÚcheck_config_hÚ	get_msvcr)ÚsupportT)Zautousec                 C   s>   | j }tj | ¡ d¡|_| td|j¡ | t	dt	j
¡ d S )Nzpython.hÚget_config_h_filenameÚversion)ÚinstanceÚosÚpathÚjoinÚmkdtempÚpython_hÚsetattrr   Ú_get_config_h_filenameÚsysr
   )ÚrequestZmonkeypatchZdistutils_managed_tempdirÚself© r   úo/var/www/html/bwave/python/venv/lib/python3.8/site-packages/setuptools/_distutils/tests/test_cygwinccompiler.pyÚstuff   s    r   c                   @   sl   e Zd Zdd„ Zej d¡ej d¡dd„ ƒƒZej d¡dd„ ƒZd	d
„ Z	dd„ Z
ej d¡dd„ ƒZdS )ÚTestCygwinCCompilerc                 C   s   | j S ©N)r   ©r   r   r   r   r      s    z*TestCygwinCCompiler._get_config_h_filenamezsys.platform != "cygwin"z,not os.path.exists("/usr/lib/libbash.dll.a")c                 C   sZ   ddl m} |ƒ }d}| dg|¡}|d k	s0t‚tj |¡s@t‚|d|d›d�ksVt‚d S )Nr   ©ÚCygwinCCompilerÚbashz/usr/libz/usr/lib/libÚsz.dll.a)Údistutils.cygwinccompilerr   Zfind_library_fileÚAssertionErrorr   r   Úexists)r   r   ÚcompilerZ	link_nameZlinkable_filer   r   r   Útest_find_library_file   s    z*TestCygwinCCompiler.test_find_library_filec                 C   s(   ddl m} |ƒ }| d¡g ks$t‚d S )Nr   r   z/foo)r    r   Zruntime_library_dir_optionr!   ©r   r   r#   r   r   r   Útest_runtime_library_dir_option*   s    z3TestCygwinCCompiler.test_runtime_library_dir_optionc                 C   st   dt _tƒ d tkst‚dt _tƒ d tks0t‚|  | jd¡ tƒ d tksPt‚|  | jd¡ tƒ d tkspt‚d S )NzX2.6.1 (r261:67515, Dec  6 2008, 16:42:21) 
[GCC 4.0.1 (Apple Computer, Inc. build 5370)]r   zsomething without the *CC wordZxxxzxxx __GNUC__ xxx)	r   r
   r   r   r!   r   Ú
write_filer   r   r   r   r   r   Útest_check_config_h1   s    ÿz'TestCygwinCCompiler.test_check_config_hc                 C   s   t ƒ g kst‚d S r   )r   r!   r   r   r   r   Útest_get_msvcrI   s    z"TestCygwinCCompiler.test_get_msvcrc                 C   s$   ddl m} |ƒ }|jd k	s t‚d S )Nr   r   )r    r   Zdll_librariesr!   r%   r   r   r   Útest_dll_libraries_not_noneL   s    z/TestCygwinCCompiler.test_dll_libraries_not_noneN)Ú__name__Ú
__module__Ú__qualname__r   ÚpytestÚmarkZskipifr$   r&   r(   r)   r*   r   r   r   r   r      s   





r   )Ú__doc__r   r   Ú	distutilsr   r    r   r   r   r   r   Zdistutils.testsr   r.   Zfixturer   ZTempdirManagerr   r   r   r   r   Ú<module>   s   

