
    e]                         d Z ddlZddlZddlZddlZddlmZmZ ddlm	Z	m
Z
 ddlmZ ddlmZ  G d dej        ej        ej                  Zed	k    r ej                     dS dS )
z#Tests for distutils.command.config.    N)missing_compiler_executablerequires_subprocess)	dump_fileconfig)support)logc                        e Zd Zd Z fdZ fdZd Z ej        e	j
        dk    d           e            d                         Zd Zd	 Z xZS )
ConfigTestCasec                 h    |                                 D ]}| j                            |           d S N)
splitlines_logsappend)selfmsgargslines       1  /home/conda/feedstock_root/build_artifacts/python-split_1708115622739/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.11/distutils/tests/test_config_cmd.py_infozConfigTestCase._info   s>    NN$$ 	$ 	$DJd####	$ 	$    c                     t          t          |                                            g | _        t          j        | _        | j        t          _        t          t          j
                  | _        d S r   )superr
   setUpr   r   infoold_logr   dict	sysconfig_CONFIG_VARSold_config_varsr   	__class__s    r   r   zConfigTestCase.setUp   sQ    nd##))+++
x:#I$:;;r   c                     | j         t          _        t          j                                         t          j                            | j                   t          t          |           
                                 d S r   )r   r   r   r   r   clearupdater   r   r
   tearDownr    s    r   r%   zConfigTestCase.tearDown   s]    <$$&&&%%d&:;;;nd##,,.....r   c                    t           j                            t                    d         dz   }t	          |          }	 t          |                                          }|                                 n# |                                 w xY wt          |d           | 	                    t          | j
                  |dz              d S )Nr   z.pyzI am the header   )ospathsplitext__file__openlen	readlinescloser   assertEqualr   )r   	this_filefnumliness       r   test_dump_filezConfigTestCase.test_dump_file#   s    G$$X..q1E9	OO	1;;==))HGGIIIIAGGIIII).///TZ(1*55555s   !A4 4B
win32zcan't test on Windowsc                 ,   t          dg          }||                     d|z             |                                 \  }}t          |          }|                                 |j        }t          j        d d         dk    r6d|j        d         	                                v r|                     d           |
                    dd	
          }|                     |d           |
                    dd	
          }|                     |d           d S )NpreprocessorzThe %r command is not found   aixxlcr   zAxlc: The -E option overrides the -P, -o, and -qsyntaxonly optionsxxxz	/* xxx */)patternbody_configtestr'   )r   skipTestcreate_distr   _check_compilercompilersysplatformr7   lower
search_cppr0   )r   cmdpkg_dirdistrB   matchs         r   test_search_cppzConfigTestCase.test_search_cpp.   s    *>*:;;?MM7#=>>>((**Tll<<u$$(2G2J2P2P2R2R)R)RMM]^^^ u;??"""};GG"""""r   c                    |                                  \  }}t          |          }dt          j        z  |_        d|_        dt          j        z  |_        |                                 |                     |j        ddg           |                     |j        dg           |                     |j        ddg           d S )Nzone%stwoonezthree%sfourtwothreefour)	r@   r   r(   pathsepinclude_dirs	librarieslibrary_dirsensure_finalizedr0   )r   rH   rI   rG   s       r   test_finalize_optionsz$ConfigTestCase.test_finalize_optionsB   s     ((**Tll%
2(2:5)E5>:::000)GV+<=====r   c                 b   |                                  }t          j                            |d          }t          j                            |d          }|                     |d           |                     |d           ||fD ]4}|                     t          j                            |                     5|                                 \  }}t          |          }|	                    ||           ||fD ]4}| 
                    t          j                            |                     5d S )NrM   rN   r;   )mkdtempr(   r)   join
write_file
assertTrueexistsr@   r   _cleanassertFalse)r   tmp_dirf1f2r2   rH   rI   rG   s           r   
test_cleanzConfigTestCase.test_cleanP   s   ,,..W\\'5))W\\'5))E"""E"""b 	/ 	/AOOBGNN1--....((**Tll

2rb 	0 	0ARW^^A..////	0 	0r   )__name__
__module____qualname__r   r   r%   r4   unittestskipIfrC   rD   r   rK   rV   rb   __classcell__)r!   s   @r   r
   r
      s        $ $ $< < < < </ / / / /	6 	6 	6 X_S\W,.EFF# #  GF#$> > >0 0 0 0 0 0 0r   r
   __main__)__doc__rf   r(   rC   r   test.supportr   r   distutils.command.configr   r   distutils.testsr   	distutilsr   LoggingSilencerTempdirManagerTestCaser
   rc   main r   r   <module>rt      s    ) )  				 



            7 6 6 6 6 6 6 6 # # # # # #      S0 S0 S0 S0 S0W,+&S0 S0 S0j zHMOOOOO r   