[&Ů?dZddlmZddlZddlZddlZddlmZmZm Z m Z ddl m Z ddl mZddlmZmZddlmZe rdd lmZdd ZGddZdS)zLCOV reporting for coverage.py.) annotationsN)IOIterableOptional TYPE_CHECKING) FileReporter)get_analysis_to_report)AnalysisNumbers)TMorf)Coveragelinestrreturnctj|d}t j|ddS)z9Produce a hash of a source line for use in the LCOV file.zutf-8ascii=)hashlibmd5encodedigestbase64 b64encodedecoderstrip)rhasheds /srv/buildsys-work-dir/castor/build_node/builder-2/WGSG1/unpkd_srcs/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/coverage/lcovreport.py line_hashrsV [W-- . . 5 5 7 7F  F # # * *7 3 3 : :3 ? ??c.eZdZdZdZddZdd ZddZdS) LcovReporterz-A reporter for writing LCOV coverage reports.z LCOV reportcoverager rNonecZ||_t|jjj|_dSN)r"r config precisiontotal)selfr"s r__init__zLcovReporter.__init__"s$  T]1;<< rmorfsOptional[Iterable[TMorf]]outfileIO[str]floatc|j|p tj}t |j|D]\}}|||||jjo |jjS)zRenders the full lcov report. `morfs` is a list of modules or filenames outfile is the file object to write the file into. ) r"get_datasysstdoutr get_lcovr( n_statements pc_covered)r)r+r-franalysiss rreportzLcovReporter.report&sq    'SZ24=%HH 1 1LB MM"h 0 0 0 0z&@4:+@@rr7rr8r c |xj|jz c_|d|d|d|}t |jD]S}|r$|dz t|krn8||dz }nd}|d|dt|dTt |j D]:}|sJ||dz }|d|dt|d;|d |jj d|d |jj d| }|} tt |D]\} } tt || D]4\} } t%| d } |d | d | d | d5tt | | t|| D]4\} } t%| d } |d | d | d | d5|r|}t)d|D}|t)d|Dz }|d|d|d|d|ddS)zProduces the lcov data for a single file. This currently supports both line and branch coverage, however function coverage is not supported. zTN: zSF: zDA:z,1,z,0,zLF:zLH:rzBRDA:,z,- )startz,1 c3 K|] \}}|V dSr%.0tks r z(LcovReporter.get_lcov..ys&::DAqa::::::rc3&K|] \}}||z V dSr%rArBs rrFz(LcovReporter.get_lcov..zs*DDdaAEDDDDDDrzBRF:zBRH:zend_of_record N)r(numberswriterelative_filenamesource splitlinessortedexecutedlenrmissingr5 n_executedmissing_branch_arcsexecuted_branch_arcs enumerate branch_statskeysmaxhas_arcssumvalues)r)r7r8r- source_linescoveredrmissed missing_arcs executed_arcs block_numberblock_line_number branch_number line_numberrUbrfbrhs rr4zLcovReporter.get_lcov6s h&&  g 6B0022666777yy{{--// h/00 A AG 19L 1 111E#GAI. MM???IdOO??? @ @ @ @X-.. @ @F  <q)D MM>>>9T??>>> ? ? ? ? =H,9===>>> ;H,7;;;<<< 3355  5577 /8 8((**//11 2 20 0  X X +L+/8|$5677// X X* {"+q11  VkVVLVV=VVVWWWW /8}%6788,'89::/// X X* {"+q11  VkVVLVV=VVVWWWW  X      *#0022L::L$7$7$9$9:::::CDDl.A.A.C.CDDDDDDC MM.... ) ) ) MM.... ) ) ) '(((((rN)r"r rr#)r+r,r-r.rr/)r7rr8r r-r.rr#)__name__ __module__ __qualname____doc__ report_typer*r9r4rArrr!r!se77K====AAAA H)H)H)H)H)H)rr!)rrrr)ri __future__rrrr2typingrrrrcoverage.pluginrcoverage.report_corer coverage.resultsr r coverage.typesr r"r rr!rArrrqs&%""""""  888888888888((((((777777........ "!!!!!!@@@@ a)a)a)a)a)a)a)a)a)a)r