��Qc@s�dZddlZddlZddlZddlmZddlmZddlm Z ddl
mZddlm
Z
dejejejfd ��YZd
�Zedkr�ee��ndS(s'Tests for distutils.command.build_clib.i�N(trun_unittest(t
build_clib(tDistutilsSetupError(tsupport(tfind_executabletBuildCLibTestCasecBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs�|j�\}}t|�}|jt|jd�|jt|jddg�|jt|jd
dg�|jt|jdd
g�|jt|jdifdg�difdidd 6fg}|j|�dS(Ntfootfoo1tfoo2itnamesanother/nametanothertgoodtok(iR(snameR(snameR(sanother/nameR(R
R(tcreate_distRtassertRaisesRtcheck_library_list(tselftpkg_dirtdisttcmdtlibs((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyttest_check_library_dists
cCs4|j�\}}t|�}difg|_|jt|j�didd6fg|_|jt|j�diddgd6fg|_|j|j�ddg�did d6fg|_|j|j�ddg�did
d6fdiddgd6fg|_|j|j�ddddg�dS(NR itsourcestatbtname2tctd(RR(RR(R
Rt librariesRRtget_source_filestassertEqual(RRRR((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyttest_get_source_files/scCs�|j�\}}t|�}ddd��Y}|�|_didd6fg}|jt|j|�dit�d6fg}|j|�dit�d6fg}|j|�dS(NtFakeCompilercBseZd�ZeZRS(c_sdS(N((targstkw((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pytcompileJs(t__name__t
__module__R#tcreate_static_lib(((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyR Is R tnotvalidR((R
RtcompilerRRtbuild_librariestlistttuple(RRRRR tlib((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyttest_build_librariesEs
cCs�|j�\}}t|�}d|_|j�|j|jdg�d|_|j�|j|jg�d|j_|jt |j�dS(Nsone-dirtWONTWORK(
R
Rtinclude_dirstfinalize_optionsRtNonetdistributionRRR(RRRR((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyttest_finalize_optionsZs
c
CsItjdkrdS|j�\}}t|�}tjj|d�}|j|d�di|gd6fg|_tjj|d�}tj |�||_
||_ddlm}dd l
m}|�}||�xC|jj�D]2} | dkrq�t| d
�dkr�Sq�|j�|jdtj|�k�dS(Ntwin32sfoo.csint main(void) { return 1;}
RRtbuildi�(tnew_compiler(tcustomize_compilerislibfoo.a(tsystplatformR
Rtostpathtjoint
write_fileRtmkdirt
build_temptdistutils.ccompilerR6tdistutils.sysconfigR7texecutablestvaluesR1Rtrunt
assertTruetlistdir(
RRRRtfoo_cR?R6R7R(tccmd((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyttest_runis,
(R$R%RRR-R3RI(((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyR
s
cCs
tjt�S(N(tunittestt makeSuiteR(((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyt
test_suite�st__main__(t__doc__RJR:R8ttest.test_supportRtdistutils.command.build_clibRtdistutils.errorsRtdistutils.testsRtdistutils.spawnRtTempdirManagertLoggingSilencertTestCaseRRLR$(((s5/sys/lib/python2.7/distutils/tests/test_build_clib.pyt<module>s
|