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_config_cmd.cpython-310.opt-1.pyc
o

�i�@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	m
Z
ddlmZddl
mZGdd�dejejej�Zd	d
�ZedkrJee��dSdS)z#Tests for distutils.command.config.�N)�run_unittest�missing_compiler_executable)�	dump_file�config)�support)�logcsbeZdZdd�Z�fdd�Z�fdd�Zdd�Ze�e	j
d	kd
�dd��Zd
d�Zdd�Z
�ZS)�ConfigTestCasecGs|��D]}|j�|�qdS�N)�
splitlines�_logs�append)�self�msg�args�line�r�</usr/local/lib/python3.10/distutils/tests/test_config_cmd.py�_infos�zConfigTestCase._infocs4tt|���g|_tj|_|jt_tt	j
�|_dSr	)�superr�setUprr�info�old_logr�dict�	sysconfig�_CONFIG_VARS�old_config_vars�r
��	__class__rrrs
zConfigTestCase.setUpcs2|jt_tj��tj�|j�tt	|��
�dSr	)rrrrr�clear�updaterrr�tearDownrrrrr!s
zConfigTestCase.tearDowncCsdtj�t�dd}t|�}zt|���}W|��n|��wt|d�|�	t|j
�|d�dS)Nrz.pyzI am the header�)�os�path�splitext�__file__�open�len�	readlines�closer�assertEqualr)r
Z	this_file�fZnumlinesrrr�test_dump_file!s
zConfigTestCase.test_dump_file�win32zcan't test on WindowscCs�tdg�}|dur|�d|�|��\}}t|�}|��|j}tjdd�dkr8d|jd�	�vr8|�d�|j
dd	d
�}|�|d�|j
dd	d
�}|�|d�dS)
N�preprocessorzThe %r command is not found�ZaixZxlcrzAxlc: The -E option overrides the -P, -o, and -qsyntaxonly options�xxxz	/* xxx */)�pattern�bodyZ_configtestr")rZskipTest�create_distrZ_check_compiler�compiler�sys�platformr/�lowerZ
search_cppr+)r
�cmd�pkg_dir�distr5�matchrrr�test_search_cpp,s
$
zConfigTestCase.test_search_cppcCsr|��\}}t|�}dtj|_d|_dtj|_|��|�|jddg�|�|jdg�|�|jddg�dS)Nzone%stwo�onezthree%sfour�twoZthreeZfour)	r4rr#�pathsepZinclude_dirsZ	librariesZlibrary_dirsZensure_finalizedr+)r
r:r;r9rrr�test_finalize_options?sz$ConfigTestCase.test_finalize_optionscCs�|��}tj�|d�}tj�|d�}|�|d�|�|d�||fD]}|�tj�|��q"|��\}}t|�}|�	||�||fD]}|�
tj�|��qBdS)Nr>r?r1)�mkdtempr#r$�joinZ
write_fileZ
assertTrue�existsr4rZ_cleanZassertFalse)r
Ztmp_dir�f1�f2r,r:r;r9rrr�
test_cleanMs�zConfigTestCase.test_clean)�__name__�
__module__�__qualname__rrr!r-�unittestZskipIfr6r7r=rArG�
__classcell__rrrrrs
rcCs
t�t�Sr	)rKZ	makeSuiterrrrr�
test_suite`s
rM�__main__)�__doc__rKr#r6rZtest.supportrrZdistutils.command.configrrZdistutils.testsrZ	distutilsrZLoggingSilencerZTempdirManagerZTestCaserrMrHrrrr�<module>s"�T�