Your IP : 216.73.216.213


Current Path : /opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/distutils/tests/__pycache__/test_build_clib.cpython-35.opt-2.pyc



���]r�@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZGdd�de
j
e
jej�Zd	d
�Zedkr�ee��dS)�N)�run_unittest)�
build_clib)�DistutilsSetupError)�support)�find_executablec@sgeZdZdd�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)rr	)rr
)rr	)r
r
)rr
)�create_distr�assertRaisesrZcheck_library_list)�self�pkg_dir�dist�cmdZlibs�r�4/opt/alt/python35/lib64/python3.5/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@s"eZdZdd�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�FakeCompilerIsr'rrZnotvalid)rr�compilerrrZbuild_libraries�list�tuple)rrrrr'�librrr�test_build_librariesEs
z&BuildCLibTestCase.test_build_librariescCs�|j�\}}t|�}d|_|j�|j|jdg�d|_|j�|j|jg�d|j_|jt|j�dS)Nzone-dirZWONTWORK)	rrZinclude_dirsZfinalize_optionsrZdistributionrrr)rrrrrrr�test_finalize_optionsZs	
	
z'BuildCLibTestCase.test_finalize_options�win32zcan't test on Windowsc
Cs@|j�\}}t|�}tjj|d�}|j|d�dd|gifg|_tjj|d�}tj|�||_||_ddl	m
}ddlm}|�}||�xQ|j
j�D]@}	|	dkr�q�t|	d�dkr�|jd	|	d�q�W|j�|jd
tj|��dS)Nzfoo.czint main(void) { return 1;}
rrZbuildr)�new_compiler)�customize_compilerzThe %r command is not foundzlibfoo.a)rr�os�path�joinZ
write_filer�mkdir�
build_tempZdistutils.ccompilerr/Zdistutils.sysconfigr0Zexecutables�valuesrZskipTest�runZassertIn�listdir)
rrrrZfoo_cr5r/r0r(Zccmdrrr�test_runis(
			

zBuildCLibTestCase.test_runN)r$r%r&rr r,r-�unittestZskipIf�sys�platformr9rrrrr
s
rcCs
tjt�S)N)r:Z	makeSuiterrrrr�
test_suite�sr=�__main__)r:r1r;Ztest.supportrZdistutils.command.build_clibrZdistutils.errorsrZdistutils.testsrZdistutils.spawnrZTempdirManagerZLoggingSilencerZTestCaserr=r$rrrr�<module>s|