Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.149.245.123
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : bisect_cmd.pyo
�
>��cc@s�dZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZd�Z
d�Zd�Zd�Zdd�Zd	�Zd
�Zedkr�e�ndS(s�
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
i����(tprint_functionNc	CsGt|d��2}x|D]}t|d|�qW|j�WdQXdS(Ntwtfile(topentprinttflush(tfilenametteststfptname((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pytwrite_tests s
cCs5|s
dStdt|�|f�t||�|S(NsWrite %s tests into %s(RtlenR
(RR((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pytwrite_output's

cCs
dj|�S(Nt (tjoin(targs((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pytformat_shell_args/scCs�tjdddg}|j|j�tj|dtjdt�}y|j�d}Wn+|j	j
�|j�|j��nX|j�}|r�t
|�}td||f�tj|�n|j�}|S(Ns-mttests--list-caseststdouttuniversal_newlinesis1Failed to list tests: %s failed with exit code %s(tsyst
executabletextendt	test_argst
subprocesstPopentPIPEtTruetcommunicateRtclosetkilltwaitRRtexitt
splitlines(RtcmdtprocRtexitcodeR((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pyt
list_cases3s(		


cCs�tj�}z�t||�tjddd|g}|j|j�tdt|��t	j
|�}y|j�}Wn|j�|j��nX|SWdt
jj|�r�t
j|�nXdS(Ns-mRs--matchfiles+ %s(ttempfiletmktempR
RRRRRRRRRRtostpathtexiststunlink(RRt
huntrleaksttmpR"R#R$((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pyt	run_testsJs 


c	Cs�tj�}|jdddd�|jdddd�|jdd	d
tdddd
�|jddd
tdddd�|j�\}}||_|S(Ns-is--inputthelpsUTest names produced by --list-tests written into a file. If not set, run --list-testss-os--outputsResult of the bisections-ns--max-teststtypetdefaultis:Maximum number of tests to stop the bisection (default: 1)s-Ns
--max-iterids5Maximum number of bisection iterations (default: 100)(targparsetArgumentParsertadd_argumenttinttparse_known_argsR(tparserRR((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pyt
parse_args_s	cCs�t�}|jrLt|j��&}g|D]}|j�^q+}WdQXnt|�}tdt|��tdt|j��td|j	|j
f�t|j|�}t�t
j
�}d}yx�t|�|j	kr�||j
kr�t|�}t|dd�}tj||�}td|t|�t|�f�t�t||�}	td|t|�f�td|	�|	r�td	�|}t|j|�}n
td
�t�|d7}q�WWn)tk
r�t�td�t�nXtdt|��x|D]}
td
|
�qWt�|rKtd|�ntjt
j
�|�}t|�|j	kr�td|tjd|�f�tjd�n td|tjd|�f�dS(NsStart bisection with %s testssTest arguments: %ssxBisection will stop when getting %s or less tests (-n/--max-tests option), or after %s iterations (-N/--max-iter option)iis![+] Iteration %s: run %s tests/%ssran %s tests/%sR s"Tests failed: use this new subtests5Tests succeeded: skip this subtest, try a new subbsetsBisection interrupted!sTests (%s):s* %ssOutput written into %ss+Bisection completed in %s iterations and %stsecondss+Bisection failed after %s iterations and %s(R8tinputRtstripR%RRRRt	max_teststmax_iterRtoutputttimetmaxtrandomtsampleR.tKeyboardInterrupttmathtceiltdatetimet	timedeltaRR (RRtlineRR>t
start_timet	iterationtntesttsubtestsR$Rtdt((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pytmainss`		('





t__main__(t__doc__t
__future__RR2RFtos.pathR(RDRARRR&R?R
RRR%tNoneR.R8RNt__name__(((s6/usr/local/python-2.7/lib/python2.7/test/bisect_cmd.pyt<module>s&						A
© 2025 GrazzMean