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_unixccompiler.cpython-35.pyc



��Yf�@s�dZddlZddlZddlZddlmZmZddlmZddl	m
Z
Gdd�dej�Zdd	�Z
ed
kr�ee
��dS)z"Tests for distutils.unixccompiler.�N)�EnvironmentVarGuard�run_unittest)�	sysconfig)�
UnixCCompilerc@s�eZdZdd�Zdd�Zejejdkd�dd��Z	ej
ejd	kd
�dd��Zej
ejd	kd
�d
d��ZdS)�UnixCCompilerTestCasecCs>tj|_tj|_Gdd�dt�}|�|_dS)Nc@seZdZdd�ZdS)z4UnixCCompilerTestCase.setUp.<locals>.CompilerWrappercSs
|jd�S)Nz/foo)Zruntime_library_dir_option)�self�r�G/opt/alt/python35/lib64/python3.5/distutils/tests/test_unixccompiler.py�	rpath_foosz>UnixCCompilerTestCase.setUp.<locals>.CompilerWrapper.rpath_fooN)�__name__�
__module__�__qualname__r
rrrr	�CompilerWrappersr)�sys�platform�_backup_platformr�get_config_var�_backup_get_config_varr�cc)rrrrr	�setUpszUnixCCompilerTestCase.setUpcCs|jt_|jt_dS)N)rrrrrr)rrrr	�tearDownszUnixCCompilerTestCase.tearDown�win32zcan't test on WindowscCs@dt_|j|jj�d�dt_tj}dd�}|t_|j|jj�ddg�dd�}|t_|j|jj�ddg�d	d�}|t_|j|jj�ddg�|t_d
t_|j|jj�ddg�d
t_|j|jj�ddg�dt_dd�}|t_|j|jj�d�dt_dd�}|t_|j|jj�d�dt_dd�}|t_|j|jj�d�dt_dd�}|t_|j|jj�d�dt_dd�}|t_|j|jj�d�dS)N�darwinz-L/foozhp-uxcSsdS)NZxxxr)�vrrr	�gcv&sz=UnixCCompilerTestCase.test_runtime_libdir_option.<locals>.gcvz+scSsdS)N�gccr)rrrr	r+sz-Wl,+scSsdS)Nzg++r)rrrr	r0sZirix646z-rpathz/fooZosf1V5ZbarcSs$|dkrdS|dkr dSdS)N�CCr�GNULD�yesr)rrrr	rAsz-Wl,--enable-new-dtags,-R/foocSs$|dkrdS|dkr dSdS)Nrrr�nor)rrrr	rKsz
-Wl,-R/foocSs$|dkrdS|dkr dSdS)Nrzx86_64-pc-linux-gnu-gcc-4.4.2rrr)rrrr	rVscSs$|dkrdS|dkr dSdS)Nrrrrr)rrrr	r`sz-R/foocSs$|dkrdS|dkr dSdS)Nrrrrr)rrrr	rjs)rr�assertEqualrr
rr)rZold_gcvrrrr	�test_runtime_libdir_optionsL																			z0UnixCCompilerTestCase.test_runtime_libdir_optionrztest only relevant for OS Xc
Csgdd�}|t_t��(}d|d<|d=tj|j�WdQRX|j|jjdd�dS)NcSs|dkrdSdS)N�LDSHAREDz*gcc-4.2 -bundle -undefined dynamic_lookup zgcc-4.2r)rrrr	rvszAUnixCCompilerTestCase.test_osx_cc_overrides_ldshared.<locals>.gcv�my_ccrr"r)rrr�customize_compilerrr �	linker_so)rr�envrrr	�test_osx_cc_overrides_ldsharedrs	
z4UnixCCompilerTestCase.test_osx_cc_overrides_ldsharedc
Csjdd�}|t_t��+}d|d<d|d<tj|j�WdQRX|j|jjdd�dS)	NcSs|dkrdSdS)Nr"z*gcc-4.2 -bundle -undefined dynamic_lookup zgcc-4.2r)rrrr	r�sz=UnixCCompilerTestCase.test_osx_explicit_ldshared.<locals>.gcvr#rzmy_ld -bundle -dynamicr"rZmy_ld)rrrr$rr r%)rrr&rrr	�test_osx_explicit_ldshared�s	

z0UnixCCompilerTestCase.test_osx_explicit_ldsharedN)
rrr
rr�unittestZskipIfrrr!Z
skipUnlessr'r(rrrr	r
s
'Z'rcCs
tjt�S)N)r)Z	makeSuiterrrrr	�
test_suite�sr*�__main__)�__doc__�osrr)Ztest.supportrrZ	distutilsrZdistutils.unixccompilerrZTestCaserr*rrrrr	�<module>s�