aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/tests.statusparagraphs.cpp
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-02-16 21:32:07 -0800
committerGitHub <noreply@github.com>2018-02-16 21:32:07 -0800
commit7ed5eb18ec729b74cfae216653be34420cd19a98 (patch)
treef3161a31a224c778b2051963789f54b312e28bd7 /toolsrc/src/tests.statusparagraphs.cpp
parent0822a28059badbb18f301b414222e869845087fb (diff)
parentf1ce125a28c98fd5a87bf509ac965b06c219d8f3 (diff)
downloadvcpkg-7ed5eb18ec729b74cfae216653be34420cd19a98.tar.gz
vcpkg-7ed5eb18ec729b74cfae216653be34420cd19a98.zip
Merge pull request #2817 from Squareys/fix-build-with-feature-deps
* [vcpkg] Add find/find_installed/is_installed for FeatureSpec Signed-off-by: Squareys <squareys@googlemail.com> * [vcpkg] Fix build command for packages that depend of features Signed-off-by: Squareys <squareys@googlemail.com>
Diffstat (limited to 'toolsrc/src/tests.statusparagraphs.cpp')
-rw-r--r--toolsrc/src/tests.statusparagraphs.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/toolsrc/src/tests.statusparagraphs.cpp b/toolsrc/src/tests.statusparagraphs.cpp
index 0d5324a8c..fa0d54fac 100644
--- a/toolsrc/src/tests.statusparagraphs.cpp
+++ b/toolsrc/src/tests.statusparagraphs.cpp
@@ -77,6 +77,39 @@ Status: purge ok not-installed
auto it = status_db.find_installed(unsafe_pspec("ffmpeg", Triplet::X64_WINDOWS));
Assert::IsTrue(it != status_db.end());
+
+ // Feature "openssl" is not installed and should not be found
+ auto it1 = status_db.find_installed({unsafe_pspec("ffmpeg", Triplet::X64_WINDOWS), "openssl"});
+ Assert::IsTrue(it1 == status_db.end());
+ }
+
+ TEST_METHOD(find_for_feature_packages)
+ {
+ auto pghs = parse_paragraphs(R"(
+Package: ffmpeg
+Version: 3.3.3
+Architecture: x64-windows
+Multi-Arch: same
+Description:
+Status: install ok installed
+
+Package: ffmpeg
+Feature: openssl
+Depends: openssl
+Architecture: x64-windows
+Multi-Arch: same
+Description:
+Status: install ok installed
+)");
+ Assert::IsTrue(!!pghs);
+ if (!pghs) return;
+
+ StatusParagraphs status_db(Util::fmap(
+ *pghs.get(), [](RawParagraph& rpgh) { return std::make_unique<StatusParagraph>(std::move(rpgh)); }));
+
+ // Feature "openssl" is installed and should therefore be found
+ auto it = status_db.find_installed({unsafe_pspec("ffmpeg", Triplet::X64_WINDOWS), "openssl"});
+ Assert::IsTrue(it != status_db.end());
}
};
}