class GcovCoverageParser:
"""
- Accepts a parsed json produced by gcov --json-format -- typically,
- representing a single C++ test and produces a list
- of CoverageRecord(s).
+ Accepts a parsed json produced by gcov --json-format -- typically,
+ representing a single C++ test and produces a list
+ of CoverageRecord(s).
"""
def __init__(self, llvm_coverage: Dict[str, Any]) -> None:
@staticmethod
def _skip_coverage(path: str) -> bool:
"""
- Returns True if file path should not be processed.
- This is repo-specific and only makes sense for the current state of
- ovrsource.
+ Returns True if file path should not be processed.
+ This is repo-specific and only makes sense for the current state of
+ ovrsource.
"""
if "third-party" in path:
return True
class LlvmCoverageParser:
"""
- Accepts a parsed json produced by llvm-cov export -- typically,
- representing a single C++ test and produces a list
- of CoverageRecord(s).
+ Accepts a parsed json produced by llvm-cov export -- typically,
+ representing a single C++ test and produces a list
+ of CoverageRecord(s).
"""
@staticmethod
def _skip_coverage(path: str) -> bool:
"""
- Returns True if file path should not be processed.
- This is repo-specific and only makes sense for the current state of
- ovrsource.
+ Returns True if file path should not be processed.
+ This is repo-specific and only makes sense for the current state of
+ ovrsource.
"""
if "/third-party/" in path:
return True
segments: List[LlvmCoverageSegment],
) -> Tuple[List[int], List[int]]:
"""
- Stateful parsing of coverage segments.
+ Stateful parsing of coverage segments.
"""
covered_lines: Set[int] = set()
uncovered_lines: Set[int] = set()
def parse_segments(raw_segments: List[List[int]]) -> List[LlvmCoverageSegment]:
"""
- Creates LlvmCoverageSegment from a list of lists in llvm export json.
- each segment is represented by 5-element array.
+ Creates LlvmCoverageSegment from a list of lists in llvm export json.
+ each segment is represented by 5-element array.
"""
ret: List[LlvmCoverageSegment] = []
for raw_segment in raw_segments:
)
-def raise_no_test_found_exception(cpp_binary_folder: str, python_binary_folder: str) -> NoReturn:
+def raise_no_test_found_exception(
+ cpp_binary_folder: str, python_binary_folder: str
+) -> NoReturn:
raise RuntimeError(
f"No cpp and python tests found in folder **{cpp_binary_folder} and **{python_binary_folder}**"
)