
    wg
                         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        Z G d	 d
ej                         Zy)z$Tests for distutils.cygwinccompiler.    N)	sysconfig)CONFIG_H_NOTOKCONFIG_H_OKCONFIG_H_UNCERTAINcheck_config_h	get_msvcr)supportT)autousec                    | j                   }t        j                  j                  |j	                         d      |_        |j                  t        d|j                         |j                  t        dt        j                         y )Nzpython.hget_config_h_filenameversion)instanceospathjoinmkdtemppython_hsetattrr   _get_config_h_filenamesysr   )requestmonkeypatchdistutils_managed_tempdirselfs       u/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_cygwinccompiler.pystuffr      sX    DGGLL<DM	#:D<W<WXY4    c                       e Zd Zd Zej
                  j                  d      ej
                  j                  d      d               Zej
                  j                  d      d        Zd Z	d Z
ej
                  j                  d      d        Zy	)
TestCygwinCCompilerc                     | j                   S N)r   r   s    r   r   z*TestCygwinCCompiler._get_config_h_filename   s    }}r   zsys.platform != "cygwin"z,not os.path.exists("/usr/lib/libbash.dll.a")c                     ddl m}  |       }d}|j                  dg|      }|J t        j                  j                  |      sJ |d|ddk(  sJ y )Nr   CygwinCCompilerbashz/usr/libz/usr/lib/libsz.dll.a)distutils.cygwinccompilerr%   find_library_filer   r   exists)r   r%   compiler	link_namelinkable_files        r   test_find_library_filez*TestCygwinCCompiler.test_find_library_file   sc     	>"$	 22J<K(((ww~~m,,,,ym6 BBBBr   c                 J    ddl m}  |       }|j                  d      g k(  sJ y )Nr   r$   z/foo)r(   r%   runtime_library_dir_optionr   r%   r+   s      r   test_runtime_library_dir_optionz3TestCygwinCCompiler.test_runtime_library_dir_option*   s&    ="$226:b@@@r   c                 P   dt         _        t               d   t        k(  sJ dt         _        t               d   t        k(  sJ | j                  | j                  d       t               d   t        k(  sJ | j                  | j                  d       t               d   t        k(  sJ y )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 wordxxxzxxx __GNUC__ xxx)r   r   r   r   r   
write_filer   r   r"   s    r   test_check_config_hz'TestCygwinCCompiler.test_check_config_h1   s    7 	
 "k111 7 "&8888 	u-"n444 	'9:"k111r   c                 "    t               g k(  sJ y r!   )r   r"   s    r   test_get_msvcrz"TestCygwinCCompiler.test_get_msvcrI   s    {b   r   c                 :    ddl m}  |       }|j                  J y )Nr   r$   )r(   r%   dll_librariesr1   s      r   test_dll_libraries_not_nonez/TestCygwinCCompiler.test_dll_libraries_not_noneL   s    ="$%%111r   N)__name__
__module____qualname__r   pytestmarkskipifr.   r2   r6   r8   r;    r   r   r   r      s     [[23[[FGC H 4C [[23A 4A20! [[232 42r   r   )__doc__r   r   	distutilsr   r(   r   r   r   r   r   distutils.testsr	   r?   fixturer   TempdirManagerr   rB   r   r   <module>rH      sT    * 	 
   $  5 572'00 72r   