a  ze @sdZddlZddlZddlZddlmZmZddlmZm Z ddl m Z ddl m Z Gddde je jejZd d Zed kreedS) z#Tests for distutils.command.config.N) run_unittestmissing_compiler_executable) dump_fileconfig)support)logcsbeZdZddZfddZfddZddZee j d kd d d Z d dZ ddZ ZS)ConfigTestCasecGs|D]}|j|qdSN) splitlines_logsappend)selfmsgargslinerS/opt/bitninja-python-dojo/embedded/lib/python3.9/distutils/tests/test_config_cmd.py_infos zConfigTestCase._infocs(tt|g|_tj|_|jt_dSr )superrsetUpr rinfoold_logrr  __class__rrrszConfigTestCase.setUpcs|jt_tt|dSr )rrrrrtearDownrrrrrszConfigTestCase.tearDowncCsdtjtdd}t|}zt|}W|n |0t|d| t|j |ddS)Nrz.pyzI am the header) ospathsplitext__file__openlen readlinescloser assertEqualr )r Z this_filefZnumlinesrrrtest_dump_files zConfigTestCase.test_dump_filewin32zcan't test on WindowscCstdg}|dur |d||\}}t|}||j}tjdddkrpd|jd vrp|d|j dd d }| |d|j d d d }| |d dS) N preprocessorzThe %r command is not foundZaixZxlcrzAxlc: The -E option overrides the -P, -o, and -qsyntaxonly optionsxxxz /* xxx */)patternbodyZ _configtestr) rZskipTest create_distrZ_check_compilercompilersysplatformr)lowerZ search_cppr%)r cmdpkg_dirdistr/matchrrrtest_search_cpp(s  $  zConfigTestCase.test_search_cppcCsr|\}}t|}dtj|_d|_dtj|_|||jddg||jdg||jddgdS)Nzone%stwoonez three%sfourtwoZthreeZfour) r.rrpathsepZ include_dirsZ librariesZ library_dirsZensure_finalizedr%)r r4r5r3rrrtest_finalize_options;s   z$ConfigTestCase.test_finalize_optionscCs|}tj|d}tj|d}||d||d||fD]}|tj|qD|\}}t|}| ||||fD]}| tj|qdS)Nr8r9r+) mkdtemprrjoinZ write_fileZ assertTrueexistsr.rZ_cleanZ assertFalse)r Ztmp_dirf1f2r&r4r5r3rrr test_cleanIs      zConfigTestCase.test_clean)__name__ __module__ __qualname__rrrr'unittestZskipIfr0r1r7r;rA __classcell__rrrrr s    rcCs ttSr )rEZ makeSuiterrrrr test_suite\srG__main__)__doc__rErr0Z test.supportrrZdistutils.command.configrrZdistutils.testsrZ distutilsrZLoggingSilencerZTempdirManagerZTestCaserrGrBrrrrs  Q