Your IP : 216.73.216.213


Current Path : /opt/alt/python36/lib64/python3.6/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/distutils/tests/__pycache__/test_build_clib.cpython-36.pyc

3

� fC�@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�Zeje	j
d	kd
�dd��Zd
S)�BuildCLibTestCasecCs�|j�\}}t|�}|jt|jd�|jt|jddg�|jt|jd
dg�|jt|jdd
g�|jt|jdifdg�difddd	ifg}|j|�dS)N�foo�foo1�foo2��name�another/name�another�okZgood)rr
)r
r)r
r
)rr)rr)�create_distr�assertRaisesrZcheck_library_list)�self�pkg_dir�dist�cmdZlibs�r�D/opt/alt/python36/lib64/python3.6/distutils/tests/test_build_clib.py�test_check_library_dists





z)BuildCLibTestCase.test_check_library_distcCs�|j�\}}t|�}difg|_|jt|j�dddifg|_|jt|j�ddddgifg|_|j|j�ddg�ddd	ifg|_|j|j�ddg�ddd
ifddddgifg|_|j|j�ddddg�dS)Nr
�sourcesr�a�bZname2�c�d)rr)rr)rr�	librariesrrZget_source_files�assertEqual)rrrrrrr�test_get_source_files/s
z'BuildCLibTestCase.test_get_source_filescCs�|j�\}}t|�}Gdd�d�}|�|_dddifg}|jt|j|�ddt�ifg}|j|�ddt�ifg}|j|�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|j�\}}t|�}d|_|j�|j|jdg�d|_|j�|j|jg�d|j_|jt|j�dS)Nzone-dirZWONTWORK)	rrZinclude_dirsZfinalize_optionsr Zdistributionrrr)rrrrrrr�test_finalize_optionsZsz'BuildCLibTestCase.test_finalize_optionsZwin32zcan't test on WindowscCs�|j�\}}t|�}tjj|d�}|j|d�dd|gifg|_tjj|d�}tj|�||_||_t	�}|dk	r�|j
d|�|j�|jdtj
|��dS)Nzfoo.czint main(void) { return 1;}
r	rZbuildzThe %r command is not foundzlibfoo.a)rr�os�path�joinZ
write_filer�mkdir�
build_temprZskipTestZrunZassertIn�listdir)rrrrZfoo_cr2Zccmdrrr�test_runis
zBuildCLibTestCase.test_runN)r%r&r'rr!r,r-�unittestZskipIf�sys�platformr4rrrrr
s
rcCs
tjt�S)N)r5Z	makeSuiterrrrr�
test_suite�sr8�__main__)�__doc__r5r.r6Ztest.supportrrZdistutils.command.build_clibrZdistutils.errorsrZdistutils.testsrZdistutils.spawnrZTempdirManagerZLoggingSilencerZTestCaserr8r%rrrr�<module>st