ó oüRac@sÇdZddlZddlZddlZddlZdefd„ƒYZdefd„ƒYZeejƒe_eej ƒe_ d„Z d„Z dd „Z ed krÃeje ƒƒndS( s* gyptest.py -- test runner for GYP tests. iÿÿÿÿNt CommandRunnercBskeZdZeZeZid„Zd„Zdd„Z ddd„Z ddd„Z dddd„Z RS(sZ Executor class for commands, including "commands" implemented by Python functions. cCs|j|ƒdS(N(tsubst_dictionary(tselft dictionary((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyt__init__scCs ||_dS(N(t_subst_dictionary(RR((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyRscCsG|dkr|j}n|rCy||}WqCtk r?qCXn|S(sC Substitutes (via the format operator) the values in the specified dictionary into the specified command. The command can be an (action, string) tuple. In all cases, we perform substitution on strings and don't worry if something isn't a string. (It's probably a Python function to be executed.) N(tNoneRt TypeError(RtstringR((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytsubsts   cCs×|js dSt|ƒtdƒkra|d}|d}d|jdjtt|ƒƒf}nt|ƒtgƒkr‹dj|ƒ}n|j|ƒ}|jdƒs¶|d7}ntj j |ƒtj j ƒdS(Niis%s(%s)s, t s (( tverbosettypet__name__tjointmaptreprR tendswithtsyststdouttwritetflush(RtcommandRtstderrtfunctargsts((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytdisplay0s   ( c Cs¹|js dSt|ƒtdƒkrs|j|ƒ}tj|ƒ}|ddkrstjft|dƒ}qsnt|ƒtd ƒkr©|d}|d}||ŒS|tj krÁd }n t j }|tj krâd }n!|d krút j}n t j }t j|dtjdkd|d|ƒ} | jƒ|d krX| j jƒ|_ n(|tj k r€|j| j jƒƒn|d tj fkr®|j| j jƒƒn| jSd S( s$ Executes a single command. ittcditshelltwin32RRN((tactiveR R tshlextsplittostchdirttupleRRRt subprocesstPIPERtSTDOUTtPopentplatformtwaittreadRt returncode( RRRRtcmdargsRRtsubouttsuberrtp((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytexecuteBs>               cCs5|dkr|}n|j|ƒ|j|||ƒS(s5 Runs a single command, displaying it first. N(RRR2(RRRRR((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytrunns   N( R t __module__t__doc__tTrueR R RRRR RR2R3(((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyRs   ,t UnbufferedcBs#eZd„Zd„Zd„ZRS(cCs ||_dS(N(tfp(RR8((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyRyscCs!|jj|ƒ|jjƒdS(N(R8RR(Rtarg((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyR{scCst|j|ƒS(N(tgetattrR8(Rtattr((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyt __getattr__~s(R R4RRR<(((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyR7xs  cCs|jdƒo|jdƒS(Ntgyptests.py(t startswithR(tf((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyt is_test_name…scCsŽg}xwtj|ƒD]f\}}}d|krA|jdƒn|jg|D]'}t|ƒrNtjj||ƒ^qNƒqW|jƒ|S(Ns.svn(R#twalktremovetextendR@tpathRtsort(t directorytresulttroottdirstfilesR?((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytfind_all_gyptest_files‰s ? c Cs<|dkrtj}nd}tjd|ƒ}|jddddddƒ|jd d dd d ddd ƒ|jdddd d dddƒ|jddddd gddƒ|jddddddƒ|jddddddƒ|jdddddƒ|jdddd gddƒ|jd d!dddd"ƒ|j|d#ƒ\}}|jrstj|jƒn|j rØg|j D]}tj j |ƒ^q†}tj j |ƒ}|tj tj d$tj d$tjd?tjƒ}|d@kr·| j| ƒqg|rÍ| j| ƒqg| j| ƒqgWqÜW|js*dA„}|j&r |dB| ƒn|dC| ƒ|dD| ƒn| r4d#Sd(SdS(ENs+gyptest.py [-ahlnq] [-f formats] [test ...]tusages-as--alltactiont store_truethelps run all testss-Cs--chdirtstoretdefaults chdir to the specified directorys-fs--formatRs$run tests with the specified formatss-Gs --gyp_optiontappends&Add -G options to the gyp command lines-ls--listslist available tests and exits-ns --no-execs'no execute, just print the command lines--passedsreport passed testss--pathsadditional $PATH directorys-qs--quiets%quiet, don't print test command linesitPATHsSpecify -a to get all tests. ttestsis not a valid gyp test name.istest/libt PYTHONPATHsPYTHONPATH=%s t,tmaketaix5tfreebsd7tfreebsd8topenbsd5tmsvstcygwintninjaRtlinux2tlinux3txcodes xcode-ninjatdarwintTESTGYP_FORMATsTESTGYP_FORMAT=%s sExtra Gyp options: %s RRicSs}|ryt|ƒdkr/tjjd|ƒn&d}tjj||t|ƒfƒtjjddj|ƒdƒndS(Nis %s the following test: s %s the following %d tests: s s s (tlenRRRR(t descriptiontteststfmt((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytreportýs  tPassedtFailedsNo result from('RRtargvtoptparset OptionParsert add_optiont parse_argsR$R#RDtabspathtpathsepRtenvirontallRRtisdirRCRKtnormpathR@tbasenametexitRRtlisttquietRR tno_execR RtformatR"R*t gyp_optionR3t executabletpassed(RkRLtparsertoptsRR1t extra_pathRfR9RTtcrR~tfailedt no_resultt format_listR{t gyp_optionstoptiontstatusRh((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytmain“s¾    ("   "                           t__main__(R5R#RlR&RtobjectRR7RRR@RKRR‰R Rw(((s_/opt/alt/alt-nodejs9/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyt s    h   ~