Your IP : 3.139.236.144


Current Path : /opt/alt/alt-nodejs6/root/lib/node_modules/npm/node_modules/node-gyp/gyp/
Upload File :
Current File : //opt/alt/alt-nodejs6/root/lib/node_modules/npm/node_modules/node-gyp/gyp/gyptest.pyc

�
�Rac@s�dZddlZddlZddlZddlZdefd��YZdefd��YZeej�e_eej	�e_	d�Z
d�Zdd	�Z
ed
kr�eje
��ndS(s*
gyptest.py -- test runner for GYP tests.
i����Nt
CommandRunnercBskeZdZeZeZid�Zd�Zdd�Z	ddd�Z
ddd�Zdddd�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-nodejs6/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-nodejs6/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-nodejs6/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-nodejs6/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	tj}|tj
kr�d	}n!|d	kr�tj}n	tj}tj|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-nodejs6/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-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pytrunns	
N(
R
t
__module__t__doc__tTrueRR RRRR	RR2R3(((s_/opt/alt/alt-nodejs6/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-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyRyscCs!|jj|�|jj�dS(N(R8RR(Rtarg((s_/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyR{scCst|j|�S(N(tgetattrR8(Rtattr((s_/opt/alt/alt-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyt__getattr__~s(R
R4RRR<(((s_/opt/alt/alt-nodejs6/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-nodejs6/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-nodejs6/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
dddddd
�|jdddddddd�|jdddddgdd�|jdddddd�|jdddddd�|jddddd�|jddddgdd�|jd d!dddd"�|j|d#�\}}|jrstj|j�n|j	r�g|j	D]}tj	j
|�^q�}tjj|�}|tjtj
d$tj
d$<n|s|js�tjjd%�d#Sd&g}ng}x�|D]�}tj	j|�rN|jttj	j|���qttj	j|��s�tj|Id'IJtjd#�n|j|�qW|jr�x|D]}	|	GHq�Wtjd(�n|jt_|jt_t�}
tj	j
d)�tj
d*<|js,tjjd+tj
d*�ng}g}g}
|j r\|j j!d,�}nyi	d-gd.6d-gd/6d-gd06d-gd16d2gd36d2d4gd56d-d4gd66d-d4gd76d-d4d8d9gd:6tj"}x
|D]}|tj
d;<|jstjjd<|�ng}x!|j#D]}|d|g7}qW|r`|jr`tjjd=|�nx{|D]s}	|
j$tj%|	g|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,tmaketaix5tfreebsd7tfreebsd8topenbsd5tmsvstcygwintninjaRtlinux2tlinux3txcodesxcode-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(tdescriptiontteststfmt((s_/opt/alt/alt-nodejs6/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@tbasenametexitRRtlisttquietRRtno_execR RtformatR"R*t
gyp_optionR3t
executabletpassed(RkRLtparsertoptsRR1t
extra_pathRfR9RTtcrR~tfailedt	no_resulttformat_listR{tgyp_optionstoptiontstatusRh((s_/opt/alt/alt-nodejs6/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-nodejs6/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/gyptest.pyt<module>	sh			
~

?>