[M6] codegen: dev_recipes, [build].include_dirs, baseline warnings, catch_discover_tests
This commit is contained in:
@@ -78,7 +78,7 @@ TEST_CASE("flake_nix always emits the shared nixos-unstable nixpkgs input",
|
||||
Manifest m{pkg("hello"), {}, {}};
|
||||
DiscoveredLayout layout{};
|
||||
Lockfile lock{1, {root_pkg("hello", "0.1.0")}};
|
||||
GenerateInputs in{m, layout, lock, {}, "/tmp/hello"};
|
||||
GenerateInputs in{m, layout, lock, {}, {}, "/tmp/hello"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
REQUIRE(out.find("description = \"hello\";") != std::string::npos);
|
||||
@@ -96,7 +96,7 @@ TEST_CASE("flake_nix emits a per-pinned-dep nixpkgs input", "[codegen][flake]")
|
||||
dep_pkg("fmt", "10.2.1", "abc123def456"),
|
||||
}};
|
||||
std::vector<Recipe> recipes = {recipe("fmt_10")};
|
||||
GenerateInputs in{m, layout, lock, recipes, "/tmp/app"};
|
||||
GenerateInputs in{m, layout, lock, recipes, {}, "/tmp/app"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
// Per-dep input attribute
|
||||
@@ -117,7 +117,7 @@ TEST_CASE("flake_nix uses shared `pkgs` for unpinned deps",
|
||||
DiscoveredLayout layout{};
|
||||
Lockfile lock{1, {root_pkg("app", "0.1.0"), dep_pkg("fmt", "*", std::nullopt)}};
|
||||
std::vector<Recipe> recipes = {recipe("fmt_10")};
|
||||
GenerateInputs in{m, layout, lock, recipes, "/tmp/app"};
|
||||
GenerateInputs in{m, layout, lock, recipes, {}, "/tmp/app"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
REQUIRE(out.find("pkgs.fmt_10") != std::string::npos);
|
||||
@@ -133,7 +133,7 @@ TEST_CASE("flake_nix mixes pinned and unpinned deps", "[codegen][flake]") {
|
||||
dep_pkg("zlib", "*", std::nullopt),
|
||||
}};
|
||||
std::vector<Recipe> recipes = {recipe("fmt_10"), recipe("zlib")};
|
||||
GenerateInputs in{m, layout, lock, recipes, "/tmp/app"};
|
||||
GenerateInputs in{m, layout, lock, recipes, {}, "/tmp/app"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
REQUIRE(out.find("pkgs_nixpkgs_fmt_10_2_1.fmt_10") != std::string::npos);
|
||||
@@ -145,7 +145,7 @@ TEST_CASE("flake_nix emits an empty buildInputs list when there are no deps",
|
||||
Manifest m{pkg("hello"), {}, {}};
|
||||
DiscoveredLayout layout{};
|
||||
Lockfile lock{1, {root_pkg("hello", "0.1.0")}};
|
||||
GenerateInputs in{m, layout, lock, {}, "/tmp/hello"};
|
||||
GenerateInputs in{m, layout, lock, {}, {}, "/tmp/hello"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
REQUIRE(out.find("buildInputs = [\n ];") != std::string::npos);
|
||||
@@ -162,7 +162,7 @@ TEST_CASE("flake_nix dedupes deps that share input + attr",
|
||||
dep_pkg("boost", "1.84.0", "rev42"),
|
||||
}};
|
||||
std::vector<Recipe> recipes = {recipe("boost"), recipe("boost")};
|
||||
GenerateInputs in{m, layout, lock, recipes, "/tmp/app"};
|
||||
GenerateInputs in{m, layout, lock, recipes, {}, "/tmp/app"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
auto first = out.find("pkgs_nixpkgs_boost_1_84_0.boost");
|
||||
@@ -180,7 +180,7 @@ TEST_CASE("flake_nix produces deterministic output", "[codegen][flake]") {
|
||||
dep_pkg("spdlog", "*", std::nullopt),
|
||||
}};
|
||||
std::vector<Recipe> recipes = {recipe("fmt_10"), recipe("spdlog")};
|
||||
GenerateInputs in{m, layout, lock, recipes, "/tmp/app"};
|
||||
GenerateInputs in{m, layout, lock, recipes, {}, "/tmp/app"};
|
||||
|
||||
REQUIRE(flake_nix(in) == flake_nix(in));
|
||||
}
|
||||
@@ -189,7 +189,7 @@ TEST_CASE("flake_nix output ends with a newline", "[codegen][flake]") {
|
||||
Manifest m{pkg("hello"), {}, {}};
|
||||
DiscoveredLayout layout{};
|
||||
Lockfile lock{1, {root_pkg("hello", "0.1.0")}};
|
||||
GenerateInputs in{m, layout, lock, {}, "/tmp/hello"};
|
||||
GenerateInputs in{m, layout, lock, {}, {}, "/tmp/hello"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
REQUIRE_FALSE(out.empty());
|
||||
@@ -205,7 +205,7 @@ TEST_CASE("flake_nix sanitizes hyphens and dots in dep names",
|
||||
dep_pkg("range-v3", "0.12.0", "rev123"),
|
||||
}};
|
||||
std::vector<Recipe> recipes = {recipe("range-v3")};
|
||||
GenerateInputs in{m, layout, lock, recipes, "/tmp/app"};
|
||||
GenerateInputs in{m, layout, lock, recipes, {}, "/tmp/app"};
|
||||
|
||||
auto out = flake_nix(in);
|
||||
REQUIRE(out.find("nixpkgs_range_v3_0_12_0.url = "
|
||||
|
||||
Reference in New Issue
Block a user