a  zeã@s°dZddlZddlZddlZddlmZddlmZddlm Z ddl m Z m Z m Z mZmZmZddlmZGdd „d eƒZGd d „d ejejƒZd d „Zedkr¬eeƒƒdS)z$Tests for distutils.cygwinccompiler.éN)ÚBytesIO)Ú run_unittest)Úcygwinccompiler)Úcheck_config_hÚ CONFIG_H_OKÚCONFIG_H_NOTOKÚCONFIG_H_UNCERTAINÚ get_versionsÚ get_msvcr)Úsupportc@seZdZdZdd„ZdS)Ú FakePopenNcCsD| ¡d|_|jj}|j|vr2t||jƒ|_nt |d¡|_dS)NrÚr)ÚsplitÚcmdÚ test_classÚ_exesrÚstdoutÚosÚpopen)ÚselfrÚshellrZexes©rúX/opt/bitninja-python-dojo/embedded/lib/python3.9/distutils/tests/test_cygwinccompiler.pyÚ__init__s  zFakePopen.__init__)Ú__name__Ú __module__Ú __qualname__rrrrrrr sr csPeZdZ‡fdd„Z‡fdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z ‡Z S)ÚCygwinCCompilerTestCasecsttt|ƒ ¡tj|_tj | ¡d¡|_ ddl m }|j |_ |j|_ tj|_|jt_i|_tj|_|t_tt_dS)Nzpython.hr©Ú sysconfig)ÚsuperrÚsetUpÚsysÚversionrÚpathÚjoinÚmkdtempÚpython_hÚ distutilsrÚget_config_h_filenameÚold_get_config_h_filenameÚ_get_config_h_filenamerÚfind_executableÚold_find_executableÚ_find_executablerÚPopenÚ old_popenr r©rr©Ú __class__rrr!s zCygwinCCompilerTestCase.setUpcs>|jt_ddlm}|j|_|jt_|j t_ t t |ƒ  ¡dS)Nrr)r#r"r(rr*r)r-rr,r0r/r rÚtearDownr1r2rrr4-s  z CygwinCCompilerTestCase.tearDowncCs|jS©N)r'©rrrrr+5sz.CygwinCCompilerTestCase._get_config_h_filenamecCs||jvr|SdSr5)r)rÚnamerrrr.8s z(CygwinCCompilerTestCase._find_executablecCstdt_| tƒdt¡dt_| tƒdt¡| |jd¡| tƒdt¡| |jd¡| tƒdt¡dS)NúX2.6.1 (r261:67515, Dec 6 2008, 16:42:21) [GCC 4.0.1 (Apple Computer, Inc. build 5370)]rzsomething without the *CC wordZxxxzxxx __GNUC__ xxx) r"r#Ú assertEqualrrrZ write_filer'rr6rrrÚtest_check_config_h=sz+CygwinCCompilerTestCase.test_check_config_hcCsÞ| tƒd¡d|jd<tƒ}| t|dƒd¡d|jd<tƒ}| |dd¡d|jd<tƒ}| t|d ƒd ¡d |jd<tƒ}| |d d¡d |jd <tƒ}| t|dƒd ¡d|jd <tƒ}| |dd¡dS)N)NNNs#gcc (GCC) 3.4.5 (mingw special) FSFZgccrz3.4.5svery strange outputsGNU ld version 2.17.50 20060824Zldéz2.17.50s@(#)PROGRAM:ld PROJECT:ld64-77s GNU dllwrap 2.17.50 20060824 FSFZdllwrapés Cheese Wrap)r9r rÚstr)rÚresrrrÚtest_get_versionsTs&      z)CygwinCCompilerTestCase.test_get_versionscCs‚dt_| tƒd¡dt_| tƒdg¡dt_| tƒdg¡dt_| tƒdg¡dt_| tƒd g¡d t_| tt¡dS) Nr8zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1300 32 bits (Intel)]Zmsvcr70zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bits (Intel)]Zmsvcr71zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1400 32 bits (Intel)]Zmsvcr80zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1500 32 bits (Intel)]Zmsvcr90zF2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1999 32 bits (Intel)])r"r#r9r Z assertRaisesÚ ValueErrorr6rrrÚtest_get_msvcrvsz&CygwinCCompilerTestCase.test_get_msvcr) rrrr!r4r+r.r:r?rAÚ __classcell__rrr2rrs  "rcCs t t¡Sr5)ÚunittestZ makeSuiterrrrrÚ test_suite–srDÚ__main__)Ú__doc__rCr"rÚiorZ test.supportrr(rZdistutils.cygwinccompilerrrrrr r Zdistutils.testsr Úobjectr ZTempdirManagerZTestCaserrDrrrrrÚs      ÿz