
    e                         d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	m
Z
mZmZmZmZ ddlmZ  G d de          Z G d	 d
ej        ej                  Zedk    r ej                     dS dS )z$Tests for distutils.cygwinccompiler.    N)BytesIO)cygwinccompiler)check_config_hCONFIG_H_OKCONFIG_H_NOTOKCONFIG_H_UNCERTAINget_versions	get_msvcr)supportc                       e Zd ZdZd ZdS )	FakePopenNc                     |                                 d         | _        | j        j        }| j        |v r!t	          || j                           | _        d S t          j        |d          | _        d S )Nr   r)splitcmd
test_class_exesr   stdoutospopen)selfr   shellr   exess        6  /home/conda/feedstock_root/build_artifacts/python-split_1708115622739/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/distutils/tests/test_cygwinccompiler.py__init__zFakePopen.__init__   s\    99;;q>$8t!$tx.11DKKK(3,,DKKK    )__name__
__module____qualname__r   r    r   r   r   r      s(        J- - - - -r   r   c                   F     e Zd Z fdZ fdZd Zd Zd Zd Zd Z	 xZ
S )CygwinCCompilerTestCasec                    t          t          |                                            t          j        | _        t
          j                            |                                 d          | _	        ddl
m} |j        | _        | j        |_        t          j        | _        | j        t          _        i | _        t          j        | _        | t,          _        t,          t          _        d S )Nzpython.hr   	sysconfig)superr"   setUpsysversionr   pathjoinmkdtemppython_h	distutilsr%   get_config_h_filenameold_get_config_h_filename_get_config_h_filenamer   find_executableold_find_executable_find_executabler   Popen	old_popenr   r   r   r%   	__class__s     r   r'   zCygwinCCompilerTestCase.setUp   s    %t,,22444{T\\^^Z@@'''''')2)H&*.*E	'#2#B *.*?'
(.#	 )r   c                     | j         t          _         ddlm} | j        |_        | j        t          _        | j	        t          _
        t          t          |                                            d S )Nr   r$   )r)   r(   r.   r%   r0   r/   r3   r   r2   r6   r5   r&   r"   tearDownr7   s     r   r:   z CygwinCCompilerTestCase.tearDown,   sa    l''''''*.*H	'*.*B' $%t,,5577777r   c                     | j         S N)r-   r   s    r   r1   z.CygwinCCompilerTestCase._get_config_h_filename4   s
    }r   c                     || j         v r|S d S r<   )r   )r   names     r   r4   z(CygwinCCompilerTestCase._find_executable7   s    4:Ktr   c                 
   dt           _        |                     t                      d         t                     dt           _        |                     t                      d         t
                     |                     | j        d           |                     t                      d         t                     |                     | j        d           |                     t                      d         t                     d S )NX2.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)   assertEqualr   r   r   
write_filer-   r   r=   s    r   test_check_config_hz+CygwinCCompilerTestCase.test_check_config_h<   s    B 	))!,k::: 7 	))!,.@AAA 	u---))!,n=== 	'9:::))!,k:::::r   c                    |                      t                      d           d| j        d<   t                      }|                      t          |d                   d           d| j        d<   t                      }|                      |d         d            d| j        d<   t                      }|                      t          |d	                   d
           d| j        d<   t                      }|                      |d	         d            d| j        d<   t                      }|                      t          |d                   d
           d| j        d<   t                      }|                      |d         d            d S )N)NNNs#   gcc (GCC) 3.4.5 (mingw special)
FSFgccr   z3.4.5s   very strange outputs   GNU ld version 2.17.50 20060824ld   z2.17.50s   @(#)PROGRAM:ld  PROJECT:ld64-77s    GNU dllwrap 2.17.50 20060824
FSFdllwrap   s   Cheese Wrap)rC   r	   r   str)r   ress     r   test_get_versionsz)CygwinCCompilerTestCase.test_get_versionsS   s[    	);<<< D
5nnSVg...
 3
5nnQ&&& >
4nnSVi000=
4nnQ&&& !E
9nnSVi000 .
9nnQ&&&&&r   c                 2   dt           _        |                     t                      d            dt           _        |                     t                      dg           dt           _        |                     t                      dg           dt           _        |                     t                      dg           dt           _        |                     t                      d	g           d
t           _        |                     t
          t                     d S )NrA   zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1300 32 bits (Intel)]msvcr70zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bits (Intel)]msvcr71zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1400 32 bits (Intel)]msvcr80zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1500 32 bits (Intel)]msvcr90zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1999 32 bits (Intel)])r(   r)   rC   r
   assertRaises
ValueErrorr=   s    r   test_get_msvcrz&CygwinCCompilerTestCase.test_get_msvcru   s    Jd+++6yk2226yk2226yk2226yk2226*i00000r   )r   r   r   r'   r:   r1   r4   rE   rN   rV   __classcell__)r8   s   @r   r"   r"      s        * * * * *8 8 8 8 8    
; ; ;. '  '  'D1 1 1 1 1 1 1r   r"   __main__)__doc__unittestr(   r   ior   r.   r   distutils.cygwinccompilerr   r   r   r   r	   r
   distutils.testsr   objectr   TempdirManagerTestCaser"   r   mainr    r   r   <module>rb      s:   * *  



 				       % % % % % %2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 $ # # # # #
- 
- 
- 
- 
- 
- 
- 
-x1 x1 x1 x1 x1g4&/x1 x1 x1t zHMOOOOO r   