Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
B

ÖWÙíÓ_•„ã@s€dZddlZddlmZddlmZddlmZmZGdd„dƒZ	Gdd	„d	eƒZ
d
d„Zddd
„Zedde
eddd„ƒZdS)z Results of coverage measurement.éN)ÚSimpleReprMixin)ÚConfigError)ÚcontractÚ	nice_pairc@s¦eZdZdZdd„Zddd„Zdd„Zed	d
dd„ƒZed	d
d
d„ƒZ	ed	d
dd„ƒZ
ed	d
dd„ƒZdd„Zdd„Z
edd
dd„ƒZedd
dd„ƒZdS)ÚAnalysisz(The results of analyzing a FileReporter.c

s(|ˆ_|ˆ_|ˆjjƒˆ_ˆj ¡ˆ_ˆj ¡ˆ_ˆj ˆj¡pBg}ˆj |¡}|ˆ_ˆjˆjˆ_	ˆj 
¡rØtˆj ¡ƒˆ_
ˆj ¡ˆ_ˆj ¡ˆ_ˆ ¡}ˆ ¡}t‡fdd„| ¡Dƒƒ}tdd„| ¡Dƒƒ}	n gˆ_
iˆ_tƒˆ_d}}}	t|dtˆjƒtˆjƒtˆj	ƒ|||	dˆ_dS)Nc3s$|]\}}|ˆjkrt|ƒVqdS)N)ÚmissingÚlen)Ú.0ÚkÚv)Úself©ú/build/wlanpi-profiler-7IIg1Q/wlanpi-profiler-1.0.11/debian/wlanpi-profiler/opt/wlanpi-profiler/lib/python3.7/site-packages/coverage/results.pyú	<genexpr>#sz$Analysis.__init__.<locals>.<genexpr>css|]\}}t|ƒVqdS)N)r)r	r
rr
r
rr$sré)Ú	precisionÚn_filesÚn_statementsÚ
n_excludedÚ	n_missingÚ
n_branchesÚn_partial_branchesÚn_missing_branches)ÚdataÚ
file_reporterÚfilenameÚlinesÚ
statementsZexcluded_linesÚexcludedZtranslate_linesÚexecutedrÚhas_arcsÚsortedÚarcsÚ_arc_possibilitiesÚexit_countsZno_branch_linesÚ	no_branchÚ_total_branchesÚmissing_branch_arcsÚsumÚitemsÚsetÚNumbersrZnumbers)
rrrrZfile_mapperrrÚmbarrr
)rrÚ__init__s<
zAnalysis.__init__FcCs0|r| ¡r| ¡ ¡}nd}t|j|j|dS)z¯The missing line numbers, formatted nicely.

        Returns a string like "1-2, 5-11, 13-14".

        If `branches` is true, includes the missing branch arcs also.

        N)r")r r'r)Úformat_linesrr)rZbranchesr"r
r
rÚmissing_formatted6szAnalysis.missing_formattedcCs
|j ¡S)z"Were arcs measured in this result?)rr )rr
r
rr EszAnalysis.has_arcszlist(tuple(int, int)))ÚreturnscCs|jS)z.Returns a sorted list of the arcs in the code.)r#)rr
r
rÚarc_possibilitiesIszAnalysis.arc_possibilitiescCs&|j |j¡pg}|j |¡}t|ƒS)z@Returns a sorted list of the arcs actually executed in the code.)rr"rrZtranslate_arcsr!)rrr
r
rÚ
arcs_executedNszAnalysis.arcs_executedcs,ˆ ¡}ˆ ¡‰‡‡fdd„|Dƒ}t|ƒS)z9Returns a sorted list of the unexecuted arcs in the code.c3s6|].}|ˆkr|dˆjkr|dˆjkr|VqdS)rrN)r%r)r	Úp)rrr
rr[sz(Analysis.arcs_missing.<locals>.<genexpr>)r1r2r!)rÚpossiblerr
)rrrÚarcs_missingUszAnalysis.arcs_missingcs*| ¡‰| ¡}‡fdd„|Dƒ}t|ƒS)zAReturns a sorted list of the executed arcs missing from the code.c3sB|]:}|ˆkr|d|dkr|ddks6|ddkr|VqdS)rrNr
)r	Úe)r4r
rrmsz,Analysis.arcs_unpredicted.<locals>.<genexpr>)r1r2r!)rrZunpredictedr
)r4rÚarcs_unpredictedbszAnalysis.arcs_unpredictedcCsdd„|j ¡DƒS)z<Returns a list of line numbers that have more than one exit.cSsg|]\}}|dkr|‘qS)rr
)r	Úl1Úcountr
r
rú
<listcomp>vsz*Analysis._branch_lines.<locals>.<listcomp>)r$r))rr
r
rÚ
_branch_linestszAnalysis._branch_linescCstdd„|j ¡DƒƒS)z"How many total branches are there?css|]}|dkr|VqdS)rNr
)r	r9r
r
rrzsz+Analysis._total_branches.<locals>.<genexpr>)r(r$Úvalues)rr
r
rr&xszAnalysis._total_brancheszdict(int: list(int))cCsJ| ¡}t| ¡ƒ}t t¡}x&|D]\}}||kr$|| |¡q$W|S)zgReturn arcs that weren't executed from branch lines.

        Returns {l1:[l2a,l2b,...], ...}

        )r5r*r;ÚcollectionsÚdefaultdictÚlistÚappend)rrZbranch_linesr,r8Úl2r
r
rr'|s
zAnalysis.missing_branch_arcszdict(int: tuple(int, int))cCsH| ¡}i}x6| ¡D]*}|j|}t||ƒ}|||f||<qW|S)zGet stats about branches.

        Returns a dict mapping line numbers to a tuple:
        (total_exits, taken_exits).
        )r'r;r$r)rZmissing_arcsÚstatsÚlnumÚexitsrr
r
rÚbranch_stats‹s
zAnalysis.branch_statsN)F)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r-r/r rr1r2r5r7r;r&r'rEr
r
r
rr
s&

rc@s~eZdZdZddd„Zdd„Zedd„ƒZed	d
„ƒZedd„ƒZ	ed
d„ƒZ
dd„Zdd„Zedd„ƒZ
dd„Zdd„ZdS)r+zœThe numerical results of measuring coverage.

    This holds the basic statistics from `Analysis`, and is used to roll
    up statistics across files.

    rc		Cshd|krdksnt‚||_dd||_d|j|_||_||_||_||_||_||_	||_
dS)Nré
gð?gY@)ÚAssertionErrorÚ
_precisionÚ_near0Ú_near100rrrrrrr)	rrrrrrrrrr
r
rr-¤szNumbers.__init__cCs$|j|j|j|j|j|j|j|jgS)z:Return a list for __init__(*args) to recreate this object.)rLrrrrrrr)rr
r
rÚ	init_argsµszNumbers.init_argscCs|j|jS)z*Returns the number of executed statements.)rr)rr
r
rÚ
n_executed½szNumbers.n_executedcCs|j|jS)z(Returns the number of executed branches.)rr)rr
r
rÚn_executed_branchesÂszNumbers.n_executed_branchescCs*|jdkr"|j\}}d||}nd}|S)z/Returns a single percentage value for coverage.rgY@)rÚ
ratio_covered)rÚ	numeratorÚdenominatorZpc_covr
r
rÚ
pc_coveredÇs


zNumbers.pc_coveredcCs| |j¡S)aReturns the percent covered, as a string, without a percent sign.

        Note that "0" is only returned when the value is truly zero, and "100"
        is only returned when the value is truly 100.  Rounding can never
        result in either "0" or "100".

        )Údisplay_coveredrU)rr
r
rÚpc_covered_strÑs	zNumbers.pc_covered_strcCs^d|kr|jkr"nn|j}n.|j|kr8dkrDnn|j}nt||jƒ}d|j|fS)zþReturn a displayable total percentage, as a string.

        Note that "0" is only returned when the value is truly zero, and "100"
        is only returned when the value is truly 100.  Rounding can never
        result in either "0" or "100".

        rédz%.*f)rMrNÚroundrL)rZpcr
r
rrVÜszNumbers.display_coveredcCs d}|jdkr|d|j7}|S)z/How many characters wide can pc_covered_str be?érr)rL)rÚwidthr
r
rÚpc_str_widthìs
zNumbers.pc_str_widthcCs |j|j}|j|j}||fS)z:Return a numerator and denominator for the coverage ratio.)rPrQrr)rrSrTr
r
rrRószNumbers.ratio_coveredcCsrt|jd}|j|j|_|j|j|_|j|j|_|j|j|_|j|j|_|j|j|_|j|j|_|S)N)r)	r+rLrrrrrrr)rÚotherÚnumsr
r
rÚ__add__úszNumbers.__add__cCs|dkst‚|S)Nr)rK)rr]r
r
rÚ__radd__	szNumbers.__radd__N)rrrrrrrr)rFrGrHrIr-rOÚpropertyrPrQrUrWrVr\rRr_r`r
r
r
rr+œs

r+cCs†t|ƒ}t|ƒ}g}d}d}xR|D]J}|t|ƒkr4P|||krV|d7}|sP|}|}q"|r"| ||f¡d}q"W|r‚| ||f¡|S)z,Produce a list of ranges for `format_lines`.Nrr)r!rr@)rrÚpairsÚstartZlidxZstmtÚendr
r
rÚ_line_rangess&
rec
Cs˜dd„t||ƒDƒ}|r|t|ƒ}xZ|D]R\}}xHt|ƒD]<}||kr8||kr8|dkrX|nd}| ||›d|›f¡q8Wq&Wd dd„t|ƒDƒ¡}	|	S)	a¿Nicely format a list of line numbers.

    Format a list of line numbers for printing by coalescing groups of lines as
    long as the lines represent consecutive statements.  This will coalesce
    even if there are gaps between statements.

    For example, if `statements` is [1,2,3,4,5,10,11,12,13,14] and
    `lines` is [1,2,5,10,11,13,14] then the result will be "1-2, 5-11, 13-14".

    Both `lines` and `statements` can be any iterable. All of the elements of
    `lines` must be in `statements`, and all of the values must be positive
    integers.

    If `arcs` is provided, they are (start,[end,end,end]) pairs that will be
    included in the output as long as start isn't in `lines`.

    cSsg|]}|dt|ƒf‘qS)r)r)r	Úpairr
r
rr:9sz format_lines.<locals>.<listcomp>rÚexitz->z, css|]}|dVqdS)éÿÿÿÿNr
)r	Útr
r
rrBszformat_lines.<locals>.<genexpr>)rer!r@Újoin)
rrr"Z
line_itemsZ
line_exitsÚlinerDÚexÚdestÚretr
r
rr.'s r.Únumber)ÚtotalÚ
fail_underrr0cCsLd|krdks*nd|›d}t|ƒ‚|dkr>|dkr>dSt||ƒ|kS)a'Determine if a total should fail due to fail-under.

    `total` is a float, the coverage measurement total. `fail_under` is the
    fail_under setting to compare with. `precision` is the number of digits
    to consider after the decimal point.

    Returns True if the total should fail.

    rgY@zfail_under=z' is invalid. Must be between 0 and 100.T)rrY)rprqrÚmsgr
r
rÚshould_fail_underFsrs)N)rIr=Zcoverage.debugrZcoverage.exceptionsrZ
coverage.miscrrrr+rer.ÚintÚboolrsr
r
r
rÚ<module>ss