python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
bisect_cmd.cpython-311.opt-1.pyc

edZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dZdZdZ
dZdZddZd	Zd
ZedkredSdS)
a
Command line tool to bisect failing CPython tests.

Find the test_os test method which alters the environment:

    ./python -m test.bisect_cmd --fail-env-changed test_os

Find a reference leak in "test_os", write the list of failing tests into the
"bisect" file:

    ./python -m test.bisect_cmd -o bisect -R 3:3 test_os

Load an existing list of tests from a file using -i option:

    ./python -m test --list-cases -m FileTests test_os > tests
    ./python -m test.bisect_cmd -i tests test_os
Nct|d5}|D]}t|||ddddS#1swxYwYdS)Nw)file)openprintflush)filenametestsfpnames    C/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/bisect_cmd.pywrite_testsrs	
h			!	!D$R     



s+A		A
A
cr|sdStdt|d|t|||S)NzWriting z tests into )rlenr)r	r
s  r
write_outputr&sE	EE



HH
=>>>%   Oc,d|S)N )join)argss r
format_shell_argsr.s88D>>rctjg}|tj|tj|SN)sys
executableextend
subprocess_args_from_interpreter_flags"_optim_args_from_interpreter_flags)cmds r

python_cmdr!2sG>
CJJz688999JJz<>>???Jrczt}|gd||jtj|tjd}|j}|r8t|}td|d|tj
||j}|S)N)-mtestz--list-casesT)stdoutuniversal_newlineszFailed to list tests: z failed with exit code )
r!r	test_argsrrunPIPE
returncoderrrexitr%
splitlines)rr procexitcoder
s     r

list_casesr/9s
,,CJJ---...JJt~>#!+-1333DH$$
hh 	!	!	!K""$$ELrctj}	t||t}|ddd|g||jt
dt|ztj	|}|j
tj
|rtj|SS#tj
|rtj|wwxYw)Nr#r$z--matchfilez+ %s)tempfilemktemprr!rr'rrrr(r*ospathexistsunlink)rr

huntrleakstmpr r-s      r
	run_testsr9Js
/

CCll

D&-5666

4>"""
f(---...~c""
7>>#	IcNNNN	27>>#	IcNNNN	sB
C6D
cDtj}|ddd|ddd|dd	td
d|d
dtdd|\}}||_|S)Nz-iz--inputzUTest names produced by --list-tests written into a file. If not set, run --list-tests)helpz-oz--outputzResult of the bisectionz-nz--max-testsz:Maximum number of tests to stop the bisection (default: 1))typedefaultr;z-Nz
--max-iterdz5Maximum number of bisection iterations (default: 100))argparseArgumentParseradd_argumentintparse_known_argsr')parserrr's   r

parse_argsrFZs

$
&
&F
iIJJJj6888
m#q,---lc.///
--//OD)DNKrc
dt}d|jvs	d|jvrtdt|jr9t	|j5}d|D}dddn#1swxYwYnt|}tdt
|ztdt|jztd|jd|j	d	t|j|}ttj
}d
}	t
||jkr4||j	kr(t
|}t|dzd
}tj||}td|d
t
|dt
|tt#||}td|dt
|td||r'td|}t|j|}ntdt|d
z
}t
||jkr||j	k(n;#t$$r.ttdtYnwxYwtdt
|z|D]}	td|	zt|rtd|zt'jtj
|z
}
t
||jkr>td|dt+j|
t/jd
dStd|dt+j|
dS)Nz-wz
--verbose2z;WARNING: -w/--verbose2 option should not be used to bisect!c6g|]}|S)strip).0lines  r

<listcomp>zmain.<locals>.<listcomp>vs 111dTZZ\\111rzStart bisection with %s testszTest arguments: %sz!Bisection will stop when getting z1 or less tests (-n/--max-tests option), or after z" iterations (-N/--max-iter option)r<z[+] Iteration z: run z tests/zran r+z*Tests failed: continuing with this subtestz;Tests succeeded: skipping this subtest, trying a new subsetzBisection interrupted!zTests (%s):z* %szOutput written into %szBisection completed in z iterations and )secondszBisection failed after )rFr'rinputrr/rr	max_testsmax_iterroutputtime	monotonicmaxrandomsampler9KeyboardInterruptmathceildatetime	timedeltarr+)rrr
rS
start_time	iterationntestsubtestsr.r$dts           r
mainrcns<<Dt~!?!?
KLLL
z!
$*

	211b111E	2	2	2	2	2	2	2	2	2	2	2	2	2	2	24  	
)CJJ
6777	
!24>!B!B
BCCC	E^^^T]]],---$+u
-
-F	GGG!!JI%jj4>))i4=.H.HJJE
A&&E}UE22HEYYH



s5zzz;
<
<
<GGG x00HEuuuc%jjj9:::&(###
UBCCC %dk599STTTGGGNI)%jj4>))i4=.H.H*

&'''


-#e**
$%%%
ftm	GGG
1
&/000	
4>##j0	1	1B
5zzT^##
H.r::::<	=	=	=
H.r::::<	=	=	=	=	=s%
A22A69A6)E
I775J/.J/__main__r)__doc__r@r\os.pathr3rZrWrrr1rTrrrr!r/r9rFrc__name__rIrr
<module>rhs
$







"



 (A=A=A=HzDFFFFFr