File: //opt/python38/lib/python3.8/distutils/tests/__pycache__/test_config_cmd.cpython-38.opt-2.pyc
U
�i�_� � @ s� d dl Z d dlZd dlZd dlmZmZ d dlmZmZ d dl m
Z
d dlmZ G dd� de
j
e
je j�Zdd � Zed
kr�ee� � dS )� N)�run_unittest�missing_compiler_executable)� dump_file�config)�support)�logc sb e Zd Zdd� Z� fdd�Z� fdd�Zdd� Ze�e j
d kd
�dd� �Zd
d� Zdd� Z
� ZS )�ConfigTestCasec G s |� � D ]}| j�|� qd S �N)�
splitlines�_logs�append)�self�msg�args�line� r �>/opt/python38/lib/python3.8/distutils/tests/test_config_cmd.py�_info s zConfigTestCase._infoc s( t t| ��� g | _tj| _| jt_d S r )�superr �setUpr r �info�old_logr �r
�� __class__r r r s zConfigTestCase.setUpc s | j t_tt| ��� d S r )r r r r r �tearDownr r r r r s zConfigTestCase.tearDownc C s\ t j�t�d d }t|�}zt|�� �}W 5 |�� X t|d� | � t| j
�|d � d S )Nr z.pyzI am the header� )�os�path�splitext�__file__�open�close�len� readlinesr �assertEqualr )r
Z this_file�fZnumlinesr r r �test_dump_file s
zConfigTestCase.test_dump_file�win32zcan't test on Windowsc C s� dd l }tdg�}|d k r(| �d| � | �� \}}t|�}|�� |j}tjd d� dkrxd|j d �
� krx| �d� |jdd d
�}| �|d� |jdd d
�}| �|d� d S )
Nr �preprocessorzThe %r command is not found� ZaixZxlczAxlc: The -E option overrides the -P, -o, and -qsyntaxonly options�xxxz /* xxx */)�patternZbodyZ_configtestr )
�shutilr ZskipTest�create_distr Z_check_compiler�compiler�sys�platformr) �lowerZ
search_cppr% )r
r- �cmd�pkg_dir�distr/ �matchr r r �test_search_cpp( s
$
zConfigTestCase.test_search_cppc C sr | � � \}}t|�}dtj |_d|_dtj |_|�� | �|jddg� | �|jdg� | �|jddg� d S )Nzone%stwo�onezthree%sfour�twoZthreeZfour) r. r r �pathsepZinclude_dirsZ librariesZlibrary_dirsZensure_finalizedr% )r
r4 r5 r3 r r r �test_finalize_options<