Current File : //usr/local/apps/python3/lib/python3.11/distutils/tests/__pycache__/test_config_cmd.cpython-311.pyc
�

�Ke�����dZddlZddlZddlZddlZddlmZmZmZddl	m
Z
mZddlm
Z
ddlmZGd�de
je
jej��Zd	�Zed
kree����dSdS)z#Tests for distutils.command.config.�N)�run_unittest�missing_compiler_executable�requires_subprocess)�	dump_file�config)�support)�logc���eZdZd�Z�fd�Z�fd�Zd�Zeje	j
dkd��e��d�����Zd�Z
d	�Z�xZS)
�ConfigTestCasec�h�|���D]}|j�|���dS�N)�
splitlines�_logs�append)�self�msg�args�lines    �I/usr/local/apps/python3/lib/python3.11/distutils/tests/test_config_cmd.py�_infozConfigTestCase._infos>���N�N�$�$�	$�	$�D��J���d�#�#�#�#�	$�	$�c����tt|�����g|_tj|_|jt_ttj
��|_dSr
)�superr�setUprr	�info�old_logr�dict�	sysconfig�_CONFIG_VARS�old_config_vars�r�	__class__s �rrzConfigTestCase.setUpsQ���
�n�d�#�#�)�)�+�+�+���
��x����:���#�I�$:�;�;����rc���|jt_tj���tj�|j��tt|���
��dSr
)rr	rrr�clear�updater rr�tearDownr!s �rr&zConfigTestCase.tearDowns]����<�����$�$�&�&�&���%�%�d�&:�;�;�;�
�n�d�#�#�,�,�.�.�.�.�.rc��tj�t��ddz}t	|��}	t|�����}|���n#|���wxYwt|d��|�	t|j
��|dz��dS)Nrz.pyzI am the header�)�os�path�splitext�__file__�open�len�	readlines�closer�assertEqualr)r�	this_file�f�numliness    r�test_dump_filezConfigTestCase.test_dump_file#s����G�$�$�X�.�.�q�1�E�9�	���O�O��	��1�;�;�=�=�)�)�H�
�G�G�I�I�I�I��A�G�G�I�I�I�I�����)�.�/�/�/�����T�Z���(�1�*�5�5�5�5�5s�!A4�4B
�win32zcan't test on Windowsc�,�tdg��}|�|�d|z��|���\}}t|��}|���|j}tjdd�dkr6d|jd�	��vr|�d��|�
dd	�
��}|�|d��|�
dd	�
��}|�|d��dS)
N�preprocessorzThe %r command is not found��aix�xlcrzAxlc: The -E option overrides the -P, -o, and -qsyntaxonly options�xxxz	/* xxx */)�pattern�body�_configtestr()r�skipTest�create_distr�_check_compiler�compiler�sys�platformr8�lower�
search_cppr1)r�cmd�pkg_dir�distrC�matchs      r�test_search_cppzConfigTestCase.test_search_cpp.s��*�>�*:�;�;���?��M�M�7�#�=�>�>�>��(�(�*�*�
����T�l�l���������<���<�����u�$�$��(�2G��2J�2P�2P�2R�2R�)R�)R��M�M�]�^�^�^����u�;��?�?�������"�"�"����}�;��G�G�������"�"�"�"�"rc��|���\}}t|��}dtjz|_d|_dtjz|_|���|�|jddg��|�|jdg��|�|jddg��dS)Nzone%stwo�onezthree%sfour�two�three�four)	rArr)�pathsep�include_dirs�	libraries�library_dirs�ensure_finalizedr1)rrIrJrHs    r�test_finalize_optionsz$ConfigTestCase.test_finalize_optionsBs����(�(�*�*�
����T�l�l��%��
�2�����
�(�2�:�5�������������)�E�5�>�:�:�:��������0�0�0�����)�G�V�+<�=�=�=�=�=rc�b�|���}tj�|d��}tj�|d��}|�|d��|�|d��||fD]4}|�tj�|�����5|���\}}t|��}|�	||��||fD]4}|�
tj�|�����5dS)NrNrOr<)�mkdtempr)r*�join�
write_file�
assertTrue�existsrAr�_clean�assertFalse)r�tmp_dir�f1�f2r3rIrJrHs        r�
test_cleanzConfigTestCase.test_cleanPs
���,�,�.�.��
�W�\�\�'�5�
)�
)��
�W�\�\�'�5�
)�
)������E�"�"�"�����E�"�"�"��b��	/�	/�A��O�O�B�G�N�N�1�-�-�.�.�.�.��(�(�*�*�
����T�l�l���
�
�2�r�����b��	0�	0�A����R�W�^�^�A�.�.�/�/�/�/�	0�	0r)�__name__�
__module__�__qualname__rrr&r5�unittest�skipIfrDrErrLrWrc�
__classcell__)r"s@rrrs��������$�$�$�<�<�<�<�<�/�/�/�/�/�	6�	6�	6��X�_�S�\�W�,�.E�F�F�����#�#���G�F�#�$>�>�>�0�0�0�0�0�0�0rrc�X�tj���t��Sr
)rg�
TestLoader�loadTestsFromTestCaser�rr�
test_suiterncs���� � �6�6�~�F�F�Fr�__main__)�__doc__rgr)rDr�test.supportrrr�distutils.command.configrr�distutils.testsr�	distutilsr	�LoggingSilencer�TempdirManager�TestCaserrnrdrmrr�<module>rxs'��)�)�����	�	�	�	�
�
�
�
���������������7�6�6�6�6�6�6�6�#�#�#�#�#�#�������S0�S0�S0�S0�S0�W�,��+��&�S0�S0�S0�jG�G�G��z����L�����������r