B t `É"ã@s~ddlZddlZddlZddlZddlZddlmZddlm Z ej   d¡rVdZ dZ ndZ dZ e dfdd „Z de fd d „ZdS) éN)ÚTestCase)ÚdirnameÚwinFÚlinuxTc Csôt|ƒttfkr|g}tjdd}|jddddddd |jd d d d gdd |jddddddd |jdddddd |jddddddd |jdddd|ddd |jd d!dd"dd#d |jd$dd%dd&d |jd'dd(dd)d |jd*d+d,d-d.d |jd/dd0dd1d | |¡\}}|dkr0tj  ¡}|j rHtj   |j ¡|_ |j dkr`t |¡n t |j ¡t ¡}td2|fƒtd3kr¬tj  tjd4¡} tj  | d5¡} ntj  tjd6¡} tj  | d7¡} tj  | ¡rà| g} nd7g} td3krtjdd8…d9kr|  d:¡| |d;kr8tj | | d;d<¡g¡|d;<|jrt|  d=¡|jr\|  d¡|jrt|  d>|j¡|jr†|  d¡|jr˜|  d?¡|jrÚ|   d$d@g¡|j!rÚtj   t"j!¡} tj  | ¡sÚt#dAƒ‚|j$r|  dB¡|  dC|ddD¡g} d}dE|kr(t% &| dEd<¡¡}n&g}x |j'D]}|  t% &|¡¡q4W|s\dFdGg}xº|D]²}g}dH|kr‚g}d}g} PdI|krždJ|krž|dK}xV|D]N\}}|s¶q¤|rÈ| |¡n| dL|f¡|dMkr¤|dNkr¤d-}q¤W|rb|  dOdP |¡f¡qbW|   | ¡| rZtdQt(| ƒd8kr>dRndSdT | dNdd8…¡fƒ|rz|  dU¡dV|dW<dV|dX<t)ƒ}t(|ƒdNkrš| *|¡nHxF|dNd…D]6}dY|ksÀdZ|krÒ| *t+ +|¡¡n | ,|¡q¨W|   t|ƒ¡td[dT d\d]„| Dƒ¡fƒd}tj -d^¡rFddl.}|j/| |d_}| 0¡|j1}nª|j rztj2 3d`|j ¡t4j.j5| ||j da\}}nv|rÎtj -d3¡r¢tjdd8…dbksÎd}tj6 7¡tj2 7¡t 8| d| |¡n"tj2 7¡t4j.j5| |tj2dc\}}|S)dNzrun [OPTIONS] )Úusagez-vz --verboseÚ store_trueÚverboseFzVerbose output)ÚactionÚdestÚdefaultÚhelpz--catz --categoryÚappendÚcatzSpecify the test category.z--covz --coverageÚcoveragez.Enable the computation of coverage informationz --cover-eraseÚ cover_erasez&Erase any previous coverage data filesz-dz--dirÚstoreÚdirz7Top-level source directory where the tests are applied.z-pz --packageÚpkgrz"Limit the coverage to this packagez-oz--outputÚoutputzRedirect output to a filez--with-doctestÚdoctestsz*Run tests included in Sphinx documentationz --doc-dirÚdocdirz3Top-level source directory for Sphinx documentationz --no-xunitÚ store_falseÚxunitTzDisable the nose XUnit pluginz --dry-runÚdryrunz-Dry run: collect but do not execute the testszRunning tests in directory %srZScriptsz nosetests.exeÚbinÚ nosetestsé)ééz--traverse-namespaceÚPATHÚz--with-coveragez--cover-package=%sz--collect-onlyz--doctest-extension=.rstz4Invalid documentation directory, path does not existz --with-xunitz--xunit-file=TEST-z.xmlZPYUTILIB_UNITTEST_CATEGORY))Zsmokeé))Z pyutilib_thr)Úallr!)Úfragiler!)r#r))r#rz(not %s)Z performancer!z--eval-attr=%sz and z ... for test categor%s: %sÚyZiesú z--with-testdataÚ1ZNOSE_WITH_TESTDATAZNOSE_WITH_FORCED_GCÚ*ú?zRunning... %s css&|]}d|kr|n d|dVqdS)r%ú"N©)Ú.0Úxr*r*ú9/tmp/pip-unpacked-wheel-cqckmaqz/pyutilib/dev/runtests.pyú íszrun..Újava)Úenvz#Redirecting output to file '%s' ...)r0Úoutfile))ré)ré)r0Zostream)9ÚtypeÚlistÚtupleÚoptparseÚ OptionParserÚ add_optionÚ parse_argsÚosÚenvironÚcopyrÚpathÚabspathrÚchdirÚgetcwdÚprintÚplatformÚjoinÚsysÚ exec_prefixÚexistsÚ version_infor ÚpathsepÚgetrrrrrrÚextendrÚ_optionsÚ ValueErrorrrZparse_categoriesrÚlenÚsetÚupdateÚglobÚaddÚ startswithÚ subprocessÚPopenÚwaitÚ returncodeÚstdoutÚwriteÚpyutilibÚrunÚstderrÚflushÚexecvpe)ÚpackageÚbasedirÚargvÚuse_execr0ÚparserÚoptionsÚargsZCWDZbinDirrÚcmdrÚattrZ_with_performanceZ _categoriesr,Z _category_setÚ_attrsZ _categoryÚ_valueÚtargetsÚargÚrcrTÚpÚ_r*r*r-r[sh                           r[cCs8|dkrtj}tjjjdttttj  t ¡ƒƒƒ||dS)NrZ)rb) rErarZÚdevZruntestsr[rr;r>r?Ú__file__)rarbr*r*r-ÚrunPyUtilibTests srq)r;rErQr7Zpyutilib.subprocessrZZ pyutilib.thrÚos.pathrrCrSrbr[rqr*r*r*r-Ús   x