diff options
Diffstat (limited to 'toolsrc/src/vcpkg-test/plan.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg-test/plan.cpp | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/toolsrc/src/vcpkg-test/plan.cpp b/toolsrc/src/vcpkg-test/plan.cpp index 594c9783b..d3d4310e9 100644 --- a/toolsrc/src/vcpkg-test/plan.cpp +++ b/toolsrc/src/vcpkg-test/plan.cpp @@ -19,7 +19,6 @@ using Test::make_status_feature_pgh; using Test::make_status_pgh; using Test::MockCMakeVarProvider; using Test::PackageSpecMap; -using Test::unsafe_pspec; /// <summary> /// Assert that the given action an install of given features from given package. @@ -27,7 +26,7 @@ using Test::unsafe_pspec; static void features_check(Dependencies::InstallPlanAction& plan, std::string pkg_name, std::vector<std::string> expected_features, - const Triplet& triplet = Triplet::X86_WINDOWS) + Triplet triplet = Triplet::X86_WINDOWS) { const auto& feature_list = plan.feature_list; @@ -53,7 +52,7 @@ static void features_check(Dependencies::InstallPlanAction& plan, /// </summary> static void remove_plan_check(Dependencies::RemovePlanAction& plan, std::string pkg_name, - const Triplet& triplet = Triplet::X86_WINDOWS) + Triplet triplet = Triplet::X86_WINDOWS) { REQUIRE(plan.spec.triplet().to_string() == triplet.to_string()); REQUIRE(pkg_name == plan.spec.name()); @@ -381,8 +380,7 @@ TEST_CASE ("basic feature test 8", "[plan]") std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = - PackageSpec::from_name_and_triplet("a", Triplet::X64_WINDOWS).value_or_exit(VCPKG_LINE_INFO); + status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); PackageSpecMap spec_map(Triplet::X64_WINDOWS); auto spec_a_64 = FullPackageSpec{spec_map.emplace("a", "b", {{"a1", ""}}), {"core"}}; @@ -464,8 +462,7 @@ TEST_CASE ("install default features test 2", "[plan]") { std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; status_paragraphs.push_back(make_status_pgh("a")); - status_paragraphs.back()->package.spec = - PackageSpec::from_name_and_triplet("a", Triplet::X64_WINDOWS).value_or_exit(VCPKG_LINE_INFO); + status_paragraphs.back()->package.spec = PackageSpec("a", Triplet::X64_WINDOWS); // Add a port "a" of which "core" is already installed, but we will // install the default features "explicitly" @@ -610,8 +607,7 @@ TEST_CASE ("do not install default features of existing dependency", "[plan]") std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; // "b[core]" is already installed status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = - PackageSpec::from_name_and_triplet("b", Triplet::X64_WINDOWS).value_or_exit(VCPKG_LINE_INFO); + status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); // Install "a" (without explicit feature specification) auto install_specs = FullPackageSpec::from_string("a", Triplet::X64_WINDOWS); @@ -632,8 +628,7 @@ TEST_CASE ("install default features of dependency test 3", "[plan]") { std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs; status_paragraphs.push_back(make_status_pgh("b")); - status_paragraphs.back()->package.spec = - PackageSpec::from_name_and_triplet("b", Triplet::X64_WINDOWS).value_or_exit(VCPKG_LINE_INFO); + status_paragraphs.back()->package.spec = PackageSpec("b", Triplet::X64_WINDOWS); // Add a port "a" which depends on the core of "b", which was already // installed explicitly @@ -945,7 +940,7 @@ TEST_CASE ("basic remove scheme", "[plan]") pghs.push_back(make_status_pgh("a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({unsafe_pspec("a")}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 1); REQUIRE(remove_plan.at(0).spec.name() == "a"); @@ -958,7 +953,7 @@ TEST_CASE ("recurse remove scheme", "[plan]") pghs.push_back(make_status_pgh("b", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({unsafe_pspec("a")}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -973,7 +968,7 @@ TEST_CASE ("features depend remove scheme", "[plan]") pghs.push_back(make_status_feature_pgh("b", "0", "a")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({unsafe_pspec("a")}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"a", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "b"); @@ -989,7 +984,7 @@ TEST_CASE ("features depend remove scheme once removed", "[plan]") pghs.push_back(make_status_feature_pgh("opencv", "vtk", "vtk")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = Dependencies::create_remove_plan({unsafe_pspec("expat")}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"expat", Triplet::X86_WINDOWS}}, status_db); REQUIRE(remove_plan.size() == 3); REQUIRE(remove_plan.at(0).spec.name() == "opencv"); @@ -1006,8 +1001,7 @@ TEST_CASE ("features depend remove scheme once removed x64", "[plan]") pghs.push_back(make_status_feature_pgh("opencv", "vtk", "vtk", "x64")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = - Dependencies::create_remove_plan({unsafe_pspec("expat", Triplet::from_canonical_name("x64"))}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"expat", Triplet::from_canonical_name("x64")}}, status_db); REQUIRE(remove_plan.size() == 3); REQUIRE(remove_plan.at(0).spec.name() == "opencv"); @@ -1022,8 +1016,7 @@ TEST_CASE ("features depend core remove scheme", "[plan]") pghs.push_back(make_status_pgh("cpr", "curl[core]", "", "x64")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = - Dependencies::create_remove_plan({unsafe_pspec("curl", Triplet::from_canonical_name("x64"))}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"curl", Triplet::from_canonical_name("x64")}}, status_db); REQUIRE(remove_plan.size() == 2); REQUIRE(remove_plan.at(0).spec.name() == "cpr"); @@ -1038,8 +1031,7 @@ TEST_CASE ("features depend core remove scheme 2", "[plan]") pghs.push_back(make_status_feature_pgh("curl", "b", "curl[a]", "x64")); StatusParagraphs status_db(std::move(pghs)); - auto remove_plan = - Dependencies::create_remove_plan({unsafe_pspec("curl", Triplet::from_canonical_name("x64"))}, status_db); + auto remove_plan = Dependencies::create_remove_plan({{"curl", Triplet::from_canonical_name("x64")}}, status_db); REQUIRE(remove_plan.size() == 1); REQUIRE(remove_plan.at(0).spec.name() == "curl"); |
