Your IP : 216.73.216.213
3
��2aC � @ s� d dl Z d dlZd dlZd dlmZmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
G dd� dejeje j�Zd d
� Zedkr�ee� � dS )� N)�run_unittest�missing_compiler_executable)�
build_clib)�DistutilsSetupError)�support)�find_executablec @ sF e Zd Zdd� Zdd� Zdd� Zdd� Zeje j
d kd
�dd� �Zd
S )�BuildCLibTestCasec C s� | j � \}}t|�}| jt|jd� | jt|jddg� | jt|jd
dg� | jt|jdd
g� | jt|jdi fdg� di fddd ifg}|j|� d S )N�foo�foo1�foo2� �name�another/name�another�okZgood)r r
)r
r )r
r
)r r )r r )�create_distr �assertRaisesr Zcheck_library_list)�self�pkg_dir�dist�cmdZlibs� r �4/opt/alt/python36/lib64/python3.6/test_build_clib.py�test_check_library_dist s
z)BuildCLibTestCase.test_check_library_distc C s� | j � \}}t|�}di fg|_| jt|j� dddifg|_| jt|j� ddddgifg|_| j|j� ddg� ddd ifg|_| j|j� ddg� ddd
ifddddgifg|_| j|j� ddddg� d S )Nr
�sourcesr �a�bZname2�c�d)r r )r r )r r � librariesr r Zget_source_files�assertEqual)r r r r r r r �test_get_source_files/ s
z'BuildCLibTestCase.test_get_source_filesc C s� | j � \}}t|�}G dd� d�}|� |_dddifg}| jt|j|� ddt� ifg}|j|� ddt� ifg}|j|� d S )Nc @ s e Zd Zdd� ZeZdS )z<BuildCLibTestCase.test_build_libraries.<locals>.FakeCompilerc _ s d S )Nr )�args�kwr r r �compileJ s zDBuildCLibTestCase.test_build_libraries.<locals>.FakeCompiler.compileN)�__name__�
__module__�__qualname__r$ Zcreate_static_libr r r r �FakeCompilerI s r( r
r Znotvalid)r r Zcompilerr r Zbuild_libraries�list�tuple)r r r r r( �libr r r �test_build_librariesE s
z&BuildCLibTestCase.test_build_librariesc C sh | j � \}}t|�}d|_|j� | j|jdg� d |_|j� | j|jg � d|j_| jt|j� d S )Nzone-dirZWONTWORK) r r Zinclude_dirsZfinalize_optionsr Zdistributionr r r )r r r r r r r �test_finalize_optionsZ s z'BuildCLibTestCase.test_finalize_options�win32zcan't test on Windowsc C s� | j � \}}t|�}tjj|d�}| j|d� dd|gifg|_tjj|d�}tj|� ||_||_t � }|d k r�| j
d| � |j� | jdtj
|�� d S )Nzfoo.czint main(void) { return 1;}
r r ZbuildzThe %r command is not foundzlibfoo.a)r r �os�path�joinZ
write_filer �mkdir�
build_tempr ZskipTestZrunZassertIn�listdir)r r r r Zfoo_cr3 Zccmdr r r �test_runi s
zBuildCLibTestCase.test_runN)r% r&