HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/distutils/tests/__pycache__/test_cygwinccompiler.cpython-310.pyc
o

�i�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZm
Z
mZmZmZddlmZGdd	�d	e�ZGd
d�dejej�Zdd
�ZedkrXee��dSdS)z$Tests for distutils.cygwinccompiler.�N)�BytesIO)�run_unittest)�cygwinccompiler)�check_config_h�CONFIG_H_OK�CONFIG_H_NOTOK�CONFIG_H_UNCERTAIN�get_versions�	get_msvcr)�supportc@seZdZdZdd�ZdS)�	FakePopenNcCsF|��d|_|jj}|j|vrt||j�|_dSt�|d�|_dS)Nr�r)�split�cmd�
test_class�_exesr�stdout�os�popen)�selfr�shellrZexes�r�A/usr/local/lib/python3.10/distutils/tests/test_cygwinccompiler.py�__init__s

zFakePopen.__init__)�__name__�
__module__�__qualname__rrrrrrrsrcsPeZdZ�fdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�CygwinCCompilerTestCasecsttt|���tj|_tj�|��d�|_	ddl
m}|j|_
|j|_tj|_|jt_i|_tj|_|t_tt_dS)Nzpython.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�rr��	__class__rrr!s
zCygwinCCompilerTestCase.setUpcs>|jt_ddlm}|j|_|jt_|j	t_
tt|��
�dS)Nrr)r#r"r(rr*r)r-rr,r0r/r r�tearDownr1r2rrr4-sz CygwinCCompilerTestCase.tearDowncCs|jS�N)r'�rrrrr+5sz.CygwinCCompilerTestCase._get_config_h_filenamecCs||jvr|SdSr5)r)r�namerrrr.8s
z(CygwinCCompilerTestCase._find_executablecCstdt_|�t�dt�dt_|�t�dt�|�|jd�|�t�dt�|�|jd�|�t�dt�dS)N�X2.6.1 (r261:67515, Dec  6 2008, 16:42:21) 
[GCC 4.0.1 (Apple Computer, Inc. build 5370)]rzsomething without the *CC wordZxxxzxxx __GNUC__ xxx)	r"r#�assertEqualrrrZ
write_filer'rr6rrr�test_check_config_h=sz+CygwinCCompilerTestCase.test_check_config_hcCs�|�t�d�d|jd<t�}|�t|d�d�d|jd<t�}|�|dd�d|jd<t�}|�t|d	�d
�d|jd<t�}|�|d	d�d|jd
<t�}|�t|d�d
�d|jd
<t�}|�|dd�dS)N)NNNs#gcc (GCC) 3.4.5 (mingw special)
FSFZgccrz3.4.5svery strange outputsGNU ld version 2.17.50 20060824Zld�z2.17.50s@(#)PROGRAM:ld  PROJECT:ld64-77s GNU dllwrap 2.17.50 20060824
FSFZdllwrap�sCheese Wrap)r9r	r�str)r�resrrr�test_get_versionsTs&





z)CygwinCCompilerTestCase.test_get_versionscCs�dt_|�t�d�dt_|�t�dg�dt_|�t�dg�dt_|�t�dg�dt_|�t�d	g�d
t_|�tt�dS)Nr8zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1300 32 bits (Intel)]Zmsvcr70zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bits (Intel)]Zmsvcr71zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1400 32 bits (Intel)]Zmsvcr80zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1500 32 bits (Intel)]Zmsvcr90zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1999 32 bits (Intel)])r"r#r9r
ZassertRaises�
ValueErrorr6rrr�test_get_msvcrvsz&CygwinCCompilerTestCase.test_get_msvcr)rrrr!r4r+r.r:r?rA�
__classcell__rrr2rrs"rcCs
t�t�Sr5)�unittestZ	makeSuiterrrrr�
test_suite�s
rD�__main__)�__doc__rCr"r�iorZtest.supportrr(rZdistutils.cygwinccompilerrrrrr	r
Zdistutils.testsr�objectrZTempdirManagerZTestCaserrDrrrrr�<module>s" 
�z�