MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / get_coverage

Function get_coverage

experiments/analyze_statistics.py:18–33  ·  view source on GitHub ↗
(profdata_path, cov_so_path)

Source from the content-addressed store, hash-verified

16PRICE_OUTPUT_PER_1M = 0.42 # output (completion) tokens
17
18def get_coverage(profdata_path, cov_so_path):
19 cmd = [
20 "llvm-cov", "export",
21 "--summary-only",
22 f"-instr-profile={profdata_path}",
23 cov_so_path
24 ]
25 result = subprocess.run(cmd, capture_output=True, text=True)
26 if result.returncode != 0:
27 return 0
28 try:
29 data = json.loads(result.stdout)
30 branches = data["data"][0]["totals"]["branches"]["covered"]
31 return branches
32 except (KeyError, IndexError, json.JSONDecodeError):
33 return 0
34
35
36def process_coverage(project, statistics_dir):

Callers 1

process_coverageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected