| 194 | |
| 195 | |
| 196 | def positive(context, case, missing=False): |
| 197 | tests = TESTS + ([MISSING] if missing else []) |
| 198 | registry = context.registry(case, tests=tests) |
| 199 | process, destination = context.collect(case, registry, poison=True) |
| 200 | require(process["exit"] == 0, "format2 native positive exited %r (missing integration on baseline)" % process["exit"]) |
| 201 | rows, ids, _ = bundle(context, destination, registry, tests, "passed", 0) |
| 202 | for test in ["*"] + TESTS: |
| 203 | require(rows[(SUITE + ":" + test).encode()][0] == [b"row_evidence_missing"], |
| 204 | "positive native row has unexpected/missing evidence reasons") |
| 205 | hit_ids = {number for key, number in ids.items() if key[0] == FUNCTION} |
| 206 | require(bool(hit_ids.intersection(rows[(SUITE + ":*").encode()][1])), "actual setup hit lost in v2") |
| 207 | if missing: |
| 208 | require(rows[(SUITE + ":" + MISSING).encode()] == ([b"row_evidence_missing", b"missing_parent"], []), |
| 209 | "missing expected parent row must remain explicit and empty") |
| 210 | raw = retained_profiles(destination) |
| 211 | children = [path for path in raw if re.fullmatch(r"_setup\.child\.[0-9]+\.profraw", path.name)] |
| 212 | require(len(children) == 1, "native raw setup evidence not retained") |
| 213 | exact_native_hits(context, raw, rows, ids, case.name) |
| 214 | return {"bundle": str(destination), "rows": len(rows), "native_setup_hit": True, |
| 215 | "all_rows_incomplete": True, "missing_row": missing} |
| 216 | |
| 217 | |
| 218 | def failed_native(context, case): |