HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/distutils/tests/__pycache__/test_build_clib.cpython-38.pyc
U

�i�_C�@s�dZddlZddlZddlZddlmZmZddlmZddl	m
Z
ddlmZddl
mZGdd	�d	ejejej�Zd
d�Zedkr�ee��dS)
z'Tests for distutils.command.build_clib.�N)�run_unittest�missing_compiler_executable)�
build_clib)�DistutilsSetupError)�support)�find_executablec@sFeZdZdd�Zdd�Zdd�Zdd�Ze�e	j
d	kd
�dd��Zd
S)�BuildCLibTestCasecCs�|��\}}t|�}|�t|jd�|�t|jddg�|�t|jddg�|�t|jddg�|�t|jdifd	g�difdd
difg}|�|�dS)N�foo�foo1�foo2)�r
)�namer)r
r
)zanother/namerr
)Zanotherr�okZgood)�create_distr�assertRaisesrZcheck_library_list)�self�pkg_dir�dist�cmdZlibs�r�>/opt/python38/lib/python3.8/distutils/tests/test_build_clib.py�test_check_library_dists*
�
�
��
��z)BuildCLibTestCase.test_check_library_distcCs�|��\}}t|�}difg|_|�t|j�dddifg|_|�t|j�ddddgifg|_|�|��ddg�dddifg|_|�|��ddg�dddifdddd	gifg|_|�|��dddd	g�dS)
Nr
�sourcesr�a�b)rrZname2�c�d)rr�	librariesrrZget_source_files�assertEqual�rrrrrrr�test_get_source_files/s
�z'BuildCLibTestCase.test_get_source_filescCs�|��\}}t|�}Gdd�d�}|�|_dddifg}|�t|j|�ddt�ifg}|�|�ddt�ifg}|�|�dS)Nc@seZdZdd�ZeZdS)z<BuildCLibTestCase.test_build_libraries.<locals>.FakeCompilerc_sdS�Nr)�args�kwrrr�compileJszDBuildCLibTestCase.test_build_libraries.<locals>.FakeCompiler.compileN)�__name__�
__module__�__qualname__r$Zcreate_static_librrrr�FakeCompilerIsr(r
rZnotvalid)rrZcompilerrrZbuild_libraries�list�tuple)rrrrr(�librrr�test_build_librariesEs
z&BuildCLibTestCase.test_build_librariescCsh|��\}}t|�}d|_|��|�|jdg�d|_|��|�|jg�d|j_|�t|j�dS)Nzone-dirZWONTWORK)	rrZinclude_dirsZfinalize_optionsrZdistributionrrrrrrr�test_finalize_optionsZsz'BuildCLibTestCase.test_finalize_options�win32zcan't test on WindowscCs�|��\}}t|�}tj�|d�}|�|d�dd|gifg|_tj�|d�}t�|�||_||_t	�}|dk	r�|�
d|�|��|�dt�
|��dS)Nzfoo.czint main(void) { return 1;}
r	rZbuildzThe %r command is not foundzlibfoo.a)rr�os�path�joinZ
write_filer�mkdir�
build_temprZskipTest�runZassertIn�listdir)rrrrZfoo_cr3Zccmdrrr�test_runis
zBuildCLibTestCase.test_runN)r%r&r'rr r,r-�unittestZskipIf�sys�platformr6rrrrr
srcCs
t�t�Sr!)r7Z	makeSuiterrrrr�
test_suite�sr:�__main__)�__doc__r7r/r8Ztest.supportrrZdistutils.command.build_clibrZdistutils.errorsrZdistutils.testsrZdistutils.spawnrZTempdirManagerZLoggingSilencerZTestCaserr:r%rrrr�<module>s�v