[M6] preserve every probe's scratch under last-failure/<pkg>/

This commit is contained in:
2026-05-15 13:43:16 +00:00
parent c46f3aa1f0
commit 8b396bcd0f
6 changed files with 79 additions and 72 deletions

View File

@@ -41,7 +41,7 @@ auto make_request(const std::filesystem::path& parent) -> VerifyLinkRequest {
.version_spec = "*",
.components = {},
.overlay_path = parent / "overlay.sqlite",
.scratch_root = parent / "scratch",
.scratch_path = parent / "scratch" / "01-conan",
};
}
@@ -101,7 +101,8 @@ TEST_CASE("verify_link rolls the provisional row back when the build fails",
REQUIRE(rec.error().code == cargoxx::util::ErrorCode::LinkdbUnknownPackage);
}
TEST_CASE("verify_link cleans up its scratch project", "[resolver][verify_link]") {
TEST_CASE("verify_link preserves its scratch project for inspection",
"[resolver][verify_link]") {
auto parent = fresh_dir();
auto req = make_request(parent);
std::filesystem::path captured;
@@ -111,6 +112,7 @@ TEST_CASE("verify_link cleans up its scratch project", "[resolver][verify_link]"
return cargoxx::util::Result<void>{};
});
REQUIRE_FALSE(captured.empty());
REQUIRE_FALSE(std::filesystem::exists(captured));
REQUIRE(captured == req.scratch_path);
REQUIRE(std::filesystem::exists(captured / "Cargoxx.toml"));
REQUIRE(std::filesystem::exists(captured / "src" / "main.cpp"));
}