
    Ohl                     X    d dl mZ d dlmZ d dlmZmZ d dlZddlm	Z	m
Z
  G d d      Zy)	    )	sysconfig)DistutilsPlatformError)is_mingwsplit_quotedN   )cygwinerrorsc                      e Zd Zej                  j                   e        d      d        Zej                  j                   e        d      d        Zej                  j                   e        d      d        Z	ej                  j                   e        d      d        Z
ej                  j                  d      d        Zy	)
TestMinGW32Compilerznot on mingw)reasonc                 N    t        j                         }|j                  dk(  sJ y )Nmingw32)r   MinGW32Compilercompiler_typeselfcompilers     /mnt/c/Users/Administrator/Desktop/help_/test_env/lib/python3.12/site-packages/setuptools/_distutils/compilers/C/tests/test_mingw.pytest_compiler_typez&TestMinGW32Compiler.test_compiler_type   s$    ))+%%222    c                 x   |j                  dd       |j                  dd       t        j                         }|j                  t	        d      k(  sJ |j
                  t	        d      k(  sJ |j                  t	        d      k(  sJ |j                  t	        d      k(  sJ |j                  t	        d      k(  sJ y )	NCCccCXXzc++zcc -O -Wallzcc -shared -O -Wallzc++ -O -Wallz
cc -shared)	setenvr   r   r   r   compiler_socompiler_cxx
linker_exe	linker_so)r   monkeypatchr   s      r   test_set_executablesz(TestMinGW32Compiler.test_set_executables   s    4&5%())+  L$????##|4I'JJJJ$$^(DDDD""l4&8888!!\,%????r   c                     t        j                         }t        j                  t              5  |j                  d       d d d        y # 1 sw Y   y xY w)Nz/usr/lib)r   r   pytestraisesr   runtime_library_dir_optionr   s     r   test_runtime_library_dir_optionz3TestMinGW32Compiler.test_runtime_library_dir_option   s@    ))+]]12 	<//
;	< 	< 	<s   A		Ac                     |j                  t        dd        t        j                  t        j
                        5  t        j                          d d d        y # 1 sw Y   y xY w)Nis_cygwinccc                      y)NT )_s    r   <lambda>z9TestMinGW32Compiler.test_cygwincc_error.<locals>.<lambda>%   s    r   )setattrr   r#   r$   r	   Errorr   )r   r    s     r   test_cygwincc_errorz'TestMinGW32Compiler.test_cygwincc_error#   sE    FM>B]]6<<( 	%""$	% 	% 	%s   AA#zsys.platform == "cygwin"c                 V    t        j                         }t        j                  |       y )N)r   r   r   customize_compilerr   s     r   (test_customize_compiler_with_msvc_pythonz<TestMinGW32Compiler.test_customize_compiler_with_msvc_python*   s     
 ))+$$X.r   N)__name__
__module____qualname__r#   markskipifr   r   r!   r&   r/   r2   r*   r   r   r   r   
   s    [[HJ~>3 ?3 [[HJ~>
@ ?
@ [[HJ~>< ?<
 [[HJ~>% ?% [[23/ 4/r   r   )	distutilsr   distutils.errorsr   distutils.utilr   r   r#    r   r	   r   r*   r   r   <module>r<      s     3 1  &/ &/r   