aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/test_install_plan.cpp
diff options
context:
space:
mode:
authorDaniel Shaw <t-dansha@microsoft.com>2017-07-25 21:29:31 -0700
committerRobert Schumacher <roschuma@microsoft.com>2017-08-16 15:10:50 -0700
commit307b761df4197bf9cf1b69652808530e6219a868 (patch)
tree40dc026ac1522df8268865703e1182b9036a029b /toolsrc/src/test_install_plan.cpp
parentbd7cd7f56d5d9fdfeb1f57810a2ea77bf4d7e31a (diff)
downloadvcpkg-307b761df4197bf9cf1b69652808530e6219a868.tar.gz
vcpkg-307b761df4197bf9cf1b69652808530e6219a868.zip
partial end to end feature packages hdf5
added vcpkg feature package support to other commands remove comments change qualifier bracket to parens added features to qualified dependencies
Diffstat (limited to 'toolsrc/src/test_install_plan.cpp')
-rw-r--r--toolsrc/src/test_install_plan.cpp50
1 files changed, 45 insertions, 5 deletions
diff --git a/toolsrc/src/test_install_plan.cpp b/toolsrc/src/test_install_plan.cpp
index d02af5662..347998723 100644
--- a/toolsrc/src/test_install_plan.cpp
+++ b/toolsrc/src/test_install_plan.cpp
@@ -347,13 +347,13 @@ namespace UnitTest1
spec_map.get_package_spec(
{{{"Source", "a"}, {"Version", "1.3"}, {"Build-Depends", ""}},
{{"Feature", "1"}, {"Description", "the first feature for a"}, {"Build-Depends", "b[1]"}},
- {{"Feature", "2"}, {"Description", "the first feature for a"}, {"Build-Depends", "b[2]"}},
- {{"Feature", "3"}, {"Description", "the first feature for a"}, {"Build-Depends", "a[2]"}}}),
+ {{"Feature", "2"}, {"Description", "the second feature for a"}, {"Build-Depends", "b[2]"}},
+ {{"Feature", "3"}, {"Description", "the third feature for a"}, {"Build-Depends", "a[2]"}}}),
{"3"}};
auto spec_b = FullPackageSpec{spec_map.get_package_spec({
{{"Source", "b"}, {"Version", "1.3"}, {"Build-Depends", ""}},
- {{"Feature", "1"}, {"Description", "the first feature for a"}, {"Build-Depends", ""}},
- {{"Feature", "2"}, {"Description", "the first feature for a"}, {"Build-Depends", ""}},
+ {{"Feature", "1"}, {"Description", "the first feature for b"}, {"Build-Depends", ""}},
+ {{"Feature", "2"}, {"Description", "the second feature for b"}, {"Build-Depends", ""}},
})};
auto install_plan = Dependencies::create_feature_install_plan(
@@ -434,7 +434,7 @@ namespace UnitTest1
{"1"}};
auto install_plan = Dependencies::create_feature_install_plan(
- spec_map.map, {spec_b, spec_x}, StatusParagraphs(std::move(status_paragraphs)));
+ spec_map.map, {spec_b}, StatusParagraphs(std::move(status_paragraphs)));
Assert::AreEqual(size_t(5), install_plan.size());
remove_plan_check(&install_plan[0], "x");
@@ -523,5 +523,45 @@ namespace UnitTest1
features_check(&install_plan[6], "a", {"one", "core"});
features_check(&install_plan[7], "c", {"core"});
}
+
+ TEST_METHOD(default_features_test)
+ {
+ using Pgh = std::unordered_map<std::string, std::string>;
+
+ std::vector<std::unique_ptr<StatusParagraph>> status_paragraphs;
+
+ PackageSpecMap spec_map(Triplet::X86_WINDOWS);
+
+ auto spec_a = FullPackageSpec{
+ spec_map.get_package_spec(
+ {{{"Source", "a"}, {"Version", "1.3"}, {"Default-Features", "1, 2"}, {"Build-Depends", ""}},
+ {{"Feature", "1"}, {"Description", "the first feature for a"}, {"Build-Depends", "b[2]"}},
+ {{"Feature", "2"}, {"Description", "the second feature for a"}, {"Build-Depends", ""}},
+ {{"Feature", "3"}, {"Description", "the third feature for a"}, {"Build-Depends", ""}}}),
+ {""}};
+ auto spec_b = FullPackageSpec{
+ spec_map.get_package_spec({
+ {{"Source", "b"}, {"Version", "1.3"}, {"Default-Features", "1, 2"}, {"Build-Depends", ""}},
+ {{"Feature", "1"}, {"Description", "the first feature for b"}, {"Build-Depends", "c[1]"}},
+ {{"Feature", "2"}, {"Description", "the second feature for b"}, {"Build-Depends", ""}},
+ }),
+ {""}};
+
+ auto spec_c = FullPackageSpec{
+ spec_map.get_package_spec({
+ {{"Source", "c"}, {"Version", "1.3"}, {"Default-Features", "2"}, {"Build-Depends", ""}},
+ {{"Feature", "1"}, {"Description", "the first feature for c"}, {"Build-Depends", ""}},
+ {{"Feature", "2"}, {"Description", "the second feature for c"}, {"Build-Depends", ""}},
+ }),
+ {""}};
+
+ auto install_plan = Dependencies::create_feature_install_plan(
+ spec_map.map, {spec_a}, StatusParagraphs(std::move(status_paragraphs)));
+
+ Assert::AreEqual(size_t(3), install_plan.size());
+ features_check(&install_plan[0], "c", {"core", "1", "2"});
+ features_check(&install_plan[1], "b", {"core", "1", "2"});
+ features_check(&install_plan[2], "a", {"core", "1", "2"});
+ }
};
} \ No newline at end of file