Skip to content

Commit

Permalink
Revert no-longer-necessary test changes now that expected is move-ass…
Browse files Browse the repository at this point in the history
…ignable.
  • Loading branch information
BillyONeal committed May 25, 2022
1 parent 2963e03 commit 79b5b65
Show file tree
Hide file tree
Showing 5 changed files with 254 additions and 391 deletions.
86 changes: 31 additions & 55 deletions src/vcpkg-test/dependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2114,35 +2114,23 @@ TEST_CASE ("respect supports expression", "[versionplan]")
vp.emplace("a", {"1", 1});
MockCMakeVarProvider var_provider;
var_provider.dep_info_vars[{"a", toplevel_spec().triplet()}]["VCPKG_CMAKE_SYSTEM_NAME"] = "";

{
auto install_plan = create_versioned_install_plan(vp, bp, {{"a", {}}}, var_provider);
CHECK(install_plan.has_value());
var_provider.dep_info_vars[{"a", toplevel_spec().triplet()}]["VCPKG_CMAKE_SYSTEM_NAME"] = "Linux";
}

{
auto install_plan = create_versioned_install_plan(vp, bp, {{"a", {}}}, var_provider);
CHECK_FALSE(install_plan.has_value());
}

auto install_plan = create_versioned_install_plan(vp, bp, {{"a", {}}}, var_provider);
CHECK(install_plan.has_value());
var_provider.dep_info_vars[{"a", toplevel_spec().triplet()}]["VCPKG_CMAKE_SYSTEM_NAME"] = "Linux";
install_plan = create_versioned_install_plan(vp, bp, {{"a", {}}}, var_provider);
CHECK_FALSE(install_plan.has_value());
SECTION ("override")
{
// override from non supported to supported version
MockOverlayProvider oprovider;
{
auto install_plan = create_versioned_install_plan(
vp, bp, oprovider, var_provider, {Dependency{"a"}}, {DependencyOverride{"a", "1", 1}}, toplevel_spec());
CHECK(install_plan.has_value());
}

install_plan = create_versioned_install_plan(
vp, bp, oprovider, var_provider, {Dependency{"a"}}, {DependencyOverride{"a", "1", 1}}, toplevel_spec());
CHECK(install_plan.has_value());
// override from supported to non supported version
bp.v["a"] = {"1", 1};
{
auto install_plan = create_versioned_install_plan(
vp, bp, oprovider, var_provider, {Dependency{"a"}}, {DependencyOverride{"a", "1", 0}}, toplevel_spec());
CHECK_FALSE(install_plan.has_value());
}
install_plan = create_versioned_install_plan(
vp, bp, oprovider, var_provider, {Dependency{"a"}}, {DependencyOverride{"a", "1", 0}}, toplevel_spec());
CHECK_FALSE(install_plan.has_value());
}
}

Expand All @@ -2164,44 +2152,32 @@ TEST_CASE ("respect supports expressions of features", "[versionplan]")

MockCMakeVarProvider var_provider;
var_provider.dep_info_vars[{"a", toplevel_spec().triplet()}]["VCPKG_CMAKE_SYSTEM_NAME"] = "";
{
auto install_plan = create_versioned_install_plan(vp, bp, {{"a", {"x"}}}, var_provider);
CHECK(install_plan.has_value());
}

auto install_plan = create_versioned_install_plan(vp, bp, {{"a", {"x"}}}, var_provider);
CHECK(install_plan.has_value());
var_provider.dep_info_vars[{"a", toplevel_spec().triplet()}]["VCPKG_CMAKE_SYSTEM_NAME"] = "Linux";

{
auto install_plan = create_versioned_install_plan(vp, bp, {{"a", {"x"}}}, var_provider);
CHECK_FALSE(install_plan.has_value());
}

install_plan = create_versioned_install_plan(vp, bp, {{"a", {"x"}}}, var_provider);
CHECK_FALSE(install_plan.has_value());
SECTION ("override")
{
// override from non supported to supported version
MockOverlayProvider oprovider;
{
auto install_plan = create_versioned_install_plan(vp,
bp,
oprovider,
var_provider,
{Dependency{"a", {"x"}}},
{DependencyOverride{"a", "1", 1}},
toplevel_spec());
CHECK(install_plan.has_value());
}

install_plan = create_versioned_install_plan(vp,
bp,
oprovider,
var_provider,
{Dependency{"a", {"x"}}},
{DependencyOverride{"a", "1", 1}},
toplevel_spec());
CHECK(install_plan.has_value());
// override from supported to non supported version
bp.v["a"] = {"1", 1};
{
auto install_plan = create_versioned_install_plan(vp,
bp,
oprovider,
var_provider,
{Dependency{"a", {"x"}}},
{DependencyOverride{"a", "1", 0}},
toplevel_spec());
CHECK_FALSE(install_plan.has_value());
}
install_plan = create_versioned_install_plan(vp,
bp,
oprovider,
var_provider,
{Dependency{"a", {"x"}}},
{DependencyOverride{"a", "1", 0}},
toplevel_spec());
CHECK_FALSE(install_plan.has_value());
}
}
Loading

0 comments on commit 79b5b65

Please sign in to comment.