[M8] cargoxx-git dependencies: { git = ..., rev = ... } deps

This commit is contained in:
2026-05-17 18:31:13 +00:00
parent e6c39914b3
commit 09f151ad82
12 changed files with 310 additions and 28 deletions

View File

@@ -142,6 +142,33 @@ TEST_CASE("write round-trips cargoxx-path source fields", "[lockfile]") {
REQUIRE(round_trip(l) == l);
}
TEST_CASE("write round-trips cargoxx-git source fields", "[lockfile]") {
Lockfile l{
.version = 1,
.packages = {
LockfilePackage{
.name = "mylib",
.version = "*",
.dependencies = {},
.nixpkgs_attr = std::nullopt,
.nixpkgs_rev = std::nullopt,
.linkdb_source = "cargoxx-git",
.find_package = "mylib CONFIG REQUIRED",
.targets = {"mylib::mylib"},
.pkg_config_module = std::nullopt,
.brute_force_libs = {},
.brute_force_includes = {},
.source_kind = "cargoxx-git",
.source_path = std::nullopt,
.source_git_url = "https://gitea.example/me/mylib",
.source_git_commit = "0123456789012345678901234567890123456789",
.source_git_sha256 = "sha256-abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123=",
},
},
};
REQUIRE(round_trip(l) == l);
}
TEST_CASE("Lockfile::nixpkgs_rev returns the shared rev", "[lockfile]") {
Lockfile l{
.version = 1,