[M5+] nix-cmake-scan walks the dev output for multi-output packages

This commit is contained in:
2026-05-10 13:29:45 +00:00
parent 1604b1d5a8
commit 54da546ebc
5 changed files with 80 additions and 8 deletions

View File

@@ -53,3 +53,29 @@ TEST_CASE("parse_nix_eval_json fails on a non-object root",
REQUIRE_FALSE(r.has_value());
REQUIRE(r.error().code == ErrorCode::ResolutionNetworkError);
}
TEST_CASE("parse_nix_eval_json captures dev_path when present",
"[resolver][nixpkgs]") {
constexpr std::string_view input = R"({
"version": "21.1.8",
"path": "/nix/store/abc-llvm-21.1.8",
"dev_path": "/nix/store/def-llvm-21.1.8-dev"
})";
auto r = parse_nix_eval_json("libllvm", input);
REQUIRE(r.has_value());
REQUIRE(r->out_path == "/nix/store/abc-llvm-21.1.8");
REQUIRE(r->dev_path == "/nix/store/def-llvm-21.1.8-dev");
}
TEST_CASE("parse_nix_eval_json leaves dev_path empty for single-output packages",
"[resolver][nixpkgs]") {
constexpr std::string_view input = R"({
"version": "2.12.2",
"path": "/nix/store/xyz-hello-2.12.2",
"dev_path": ""
})";
auto r = parse_nix_eval_json("hello", input);
REQUIRE(r.has_value());
REQUIRE(r->out_path == "/nix/store/xyz-hello-2.12.2");
REQUIRE(r->dev_path.empty());
}