MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / profile_controls

Function profile_controls

tests/test_coverage_children.py:291–316  ·  view source on GitHub ↗
(case, suite_dir, tool, environment, witnesses)

Source from the content-addressed store, hash-verified

289
290
291def profile_controls(case, suite_dir, tool, environment, witnesses):
292 profiles = sorted(suite_dir.glob("*.profraw"))
293 if not profiles or len(profiles) > 64:
294 raise Infrastructure("unexpected finite profile inventory")
295 results = []
296 for index, raw in enumerate(profiles):
297 if not regular_nonempty(raw):
298 raise Infrastructure("profile is not regular/nonempty: " + str(raw))
299 merged = case / ("profile-%02d.profdata" % index)
300 record = run_process(case, "merge-%02d" % index,
301 [tool, "merge", "--instr", "--output=" + str(merged), str(raw)], environment)
302 require_process(record)
303 if not regular_nonempty(merged):
304 raise Infrastructure("matching profdata produced no valid indexed profile")
305 item = {"raw": str(raw), "merged": str(merged), "valid": True}
306 if raw.name in witnesses:
307 function = witnesses[raw.name]
308 shown = run_process(case, "count-%02d" % index,
309 [tool, "show", "--counts", "--function=" + function, str(merged)], environment)
310 require_process(shown)
311 item["function"] = function
312 item["function_count"] = exact_positive_count(read_log(case, shown, "stdout"), function)
313 results.append(item)
314 if set(witnesses) - {Path(item["raw"]).name for item in results}:
315 raise Infrastructure("expected genuine child profile is absent")
316 return results
317
318
319def reducer_worker():

Callers 1

run_caseFunction · 0.85

Calls 8

strFunction · 0.85
require_processFunction · 0.85
exact_positive_countFunction · 0.85
read_logFunction · 0.85
setFunction · 0.85
InfrastructureClass · 0.70
regular_nonemptyFunction · 0.70
run_processFunction · 0.70

Tested by

no test coverage detected