Compose the ordered candidate list to try compiling.
(ctx: SequentialCompileContext)
| 62 | |
| 63 | |
| 64 | def _resolve_compile_candidates(ctx: SequentialCompileContext) -> list[str]: |
| 65 | """Compose the ordered candidate list to try compiling.""" |
| 66 | compile_target = ctx.meson_test_name |
| 67 | targets_to_try: list[str] = [compile_target] if compile_target else [] |
| 68 | if ctx.fallback_test_name and ctx.fallback_test_name != compile_target: |
| 69 | targets_to_try.append(ctx.fallback_test_name) |
| 70 | |
| 71 | fuzzy = ctx.fuzzy_candidates |
| 72 | if ctx.test_name and not fuzzy: |
| 73 | fuzzy = get_fuzzy_test_candidates(ctx.build_dir, ctx.test_name) |
| 74 | for c in fuzzy: |
| 75 | if c not in targets_to_try: |
| 76 | targets_to_try.append(c) |
| 77 | |
| 78 | # Path-qualified variants for disambiguation: "tests/<name>", "tests/profile/<name>" |
| 79 | path_qualified: list[str] = [] |
| 80 | for candidate in targets_to_try: |
| 81 | if candidate and "/" not in candidate: |
| 82 | for prefix in ["tests/", "tests/profile/"]: |
| 83 | qualified = f"{prefix}{candidate}" |
| 84 | if qualified not in targets_to_try and qualified not in path_qualified: |
| 85 | path_qualified.append(qualified) |
| 86 | targets_to_try.extend(path_qualified) |
| 87 | return targets_to_try |
| 88 | |
| 89 | |
| 90 | def _print_compile_failure( |
no test coverage detected