
    ?wgh
                         d Z ddlZddlZddlmZ ddlmZmZ ddlm	Z	m
Z
 ddlZddlZddlZ ej                  d      d        Ze
j                    G d	 d
e
j"                               Zy)z#Tests for distutils.command.config.    N)log)config	dump_file)missing_compiler_executablesupportT)autousec                 l    | j                   }g |_        |j                  t        d|j                         y )Ninfo)instance_logssetattrr   _info)requestmonkeypatchselfs      b/var/www/horilla/myenv/lib/python3.12/site-packages/setuptools/_distutils/tests/test_config_cmd.pyinfo_logr      s*    DDJVTZZ0    c                   f    e Zd Zd Zd Zej                  j                  d      d        Zd Z	d Z
y)
TestConfigc                 d    |j                         D ]  }| j                  j                  |        y )N)
splitlinesr   append)r   msgargslines       r   r   zTestConfig._info   s*    NN$ 	$DJJd#	$r   c                    t        j                  t              j                  d      }|j	                  d      5 }t        j                  |      }d d d        t        |d       t        | j                        dz   k(  sJ y # 1 sw Y   3xY w)Nz.pyzutf-8)encodingzI am the header   )
pathPath__file__with_suffixopenmore_itertoolsilenr   lenr   )r   	this_filefnumliness       r   test_dump_filezTestConfig.test_dump_file   sw    IIh'33E:	^^W^- 	.%**1-H	. 	)./4::(Q,...		. 	.s   BBzplatform.system() == "Windows"c                    t        dg      }|| j                  d|d       | j                         \  }}t        |      }|j	                          |j
                  }t        j                  d d dk(  r0d|j                  d   j                         v r| j                  d       |j                  d	d
      }|dk(  sJ |j                  dd
      }|dk(  sJ y )NpreprocessorzThe z 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platformr-   lower
search_cpp)r   cmdpkg_dirdistr8   matchs         r   test_search_cppzTestConfig.test_search_cpp#   s    )>*:;?MMD'<=>((*Tl<<<<u$(2G2G2J2P2P2R)RMMS
 u;?zz};Gzzr   c                 B   | j                         \  }}t        |      }dt        j                   d|_        d|_        dt        j                   d|_        |j                          |j                  ddgk(  sJ |j
                  dgk(  sJ |j                  ddgk(  sJ y )Nonetwothreefour)r6   r   ospathsepinclude_dirs	librarieslibrary_dirsensure_finalized)r   r>   r?   r=   s       r   test_finalize_optionsz TestConfig.test_finalize_options8   s     ((*Tl C0"2::,d3E5>111}}'''GV#4444r   c                    | j                         }t        j                  j                  |d      }t        j                  j                  |d      }| j	                  |d       | j	                  |d       ||fD ]#  }t        j                  j                  |      r#J  | j                         \  }}t        |      }|j                  ||       ||fD ]#  }t        j                  j                  |      s#J  y )NrC   rD   r1   )	mkdtemprG   r    join
write_fileexistsr6   r   _clean)r   tmp_dirf1f2r)   r>   r?   r=   s           r   
test_cleanzTestConfig.test_cleanF   s    ,,.WW\\'5)WW\\'5)E"E"b 	%A77>>!$$$	% ((*Tl

2rb 	)Aww~~a(((	)r   N)__name__
__module____qualname__r   r+   pytestmarkskipifrA   rM   rW    r   r   r   r      s:    $/ [[89 :(5)r   r   )__doc__rG   r9   distutils._logr   distutils.command.configr   r   distutils.testsr   r   r%   r    r[   fixturer   combine_markersTempdirManagerr   r^   r   r   <module>rf      si    ) 	 
  6 @    1 1 	A)'' A) A)r   