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

�i1�@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZddlm
Z
Gdd�de
je
jej�Zd	d
�ZedkrHee��dSdS)z'Tests for distutils.command.build_clib.�N)�run_unittest�missing_compiler_executable)�
build_clib)�DistutilsSetupError)�supportcsbeZdZ�fdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Ze	�
ejd
kd�dd��Z
�ZS)�BuildCLibTestCasecst���ttj�|_dS�N)�super�setUp�dict�	sysconfig�_CONFIG_VARS�_backup_CONFIG_VARS��self��	__class__��</usr/local/lib/python3.10/distutils/tests/test_build_clib.pyr
s
zBuildCLibTestCase.setUpcs&t���tj��tj�|j�dSr)r	�tearDownrr
�clear�updaterrrrrrs

zBuildCLibTestCase.tearDowncCs�|��\}}t|�}|�t|jd�|�t|jddg�|�t|jddg�|�t|jddg�|�t|jdifd	g�difdd
difg}|�|�dS)N�foo�foo1�foo2)�r)�namer)rr)zanother/namerr)Zanotherr�okZgood)�create_distr�assertRaisesrZcheck_library_list)r�pkg_dir�dist�cmdZlibsrrr�test_check_library_dists*
�
�
��
��z)BuildCLibTestCase.test_check_library_distcCs�|��\}}t|�}difg|_|�t|j�dddifg|_|�t|j�ddddgifg|_|�|��ddg�dddifg|_|�|��ddg�dddifdddd	gifg|_|�|��gd
��dS)Nr�sourcesr�a�b)r%r&Zname2�c�d)r%r&r'r()rr�	librariesrrZget_source_files�assertEqual�rr r!r"rrr�test_get_source_files8s
�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_sdSrr)�args�kwrrr�compileSszDBuildCLibTestCase.test_build_libraries.<locals>.FakeCompiler.compileN)�__name__�
__module__�__qualname__r/Zcreate_static_librrrr�FakeCompilerRsr3rr$Znotvalid)rrZcompilerrrZbuild_libraries�list�tuple)rr r!r"r3�librrr�test_build_librariesNs
z&BuildCLibTestCase.test_build_librariescCsh|��\}}t|�}d|_|��|�|jdg�d|_|��|�|jg�d|j_|�t|j�dS)Nzone-dirZWONTWORK)	rrZinclude_dirsZfinalize_optionsr*Zdistributionr)rrr+rrr�test_finalize_optionscsz'BuildCLibTestCase.test_finalize_options�win32zcan't test on WindowscCs�|��\}}t|�}tj�|d�}|�|d�dd|gifg|_tj�|d�}t�|�||_||_t	�}|dur@|�
d|�|��|�dt�
|��dS)Nzfoo.czint main(void) { return 1;}
rr$ZbuildzThe %r command is not foundzlibfoo.a)rr�os�path�joinZ
write_filer)�mkdir�
build_temprZskipTest�runZassertIn�listdir)rr r!r"Zfoo_cr>Zccmdrrr�test_runrs
zBuildCLibTestCase.test_run)r0r1r2r
rr#r,r7r8�unittestZskipIf�sys�platformrA�
__classcell__rrrrr
srcCs
t�t�Sr)rBZ	makeSuiterrrrr�
test_suite�s
rF�__main__)�__doc__rBr:rCrZtest.supportrrZdistutils.command.build_clibrZdistutils.errorsrZdistutils.testsrZTempdirManagerZLoggingSilencerZTestCaserrFr0rrrr�<module>s"��