aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/tests.statusparagraphs.cpp
diff options
context:
space:
mode:
authorCurtis.Bezault <curtbezault@gmail.com>2019-07-23 15:29:49 -0700
committerCurtis.Bezault <curtbezault@gmail.com>2019-07-23 15:29:49 -0700
commit62ec13ba36146f01bfaccbfd5ad22141d6cb061b (patch)
treebe0099257bca99ea991b599acaa5afb541ce1fd0 /toolsrc/src/tests.statusparagraphs.cpp
parent2f2a45595fa925edeace250b694d70095c42b5fa (diff)
parent3b808a48ce2fafab82bd7b53642a11a08b21c481 (diff)
downloadvcpkg-62ec13ba36146f01bfaccbfd5ad22141d6cb061b.tar.gz
vcpkg-62ec13ba36146f01bfaccbfd5ad22141d6cb061b.zip
Merge build.cpp
Diffstat (limited to 'toolsrc/src/tests.statusparagraphs.cpp')
-rw-r--r--toolsrc/src/tests.statusparagraphs.cpp115
1 files changed, 0 insertions, 115 deletions
diff --git a/toolsrc/src/tests.statusparagraphs.cpp b/toolsrc/src/tests.statusparagraphs.cpp
deleted file mode 100644
index fa0d54fac..000000000
--- a/toolsrc/src/tests.statusparagraphs.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-#include "tests.pch.h"
-
-#include <tests.utils.h>
-
-using namespace Microsoft::VisualStudio::CppUnitTestFramework;
-
-using namespace vcpkg;
-using namespace vcpkg::Paragraphs;
-
-namespace UnitTest1
-{
- class StatusParagraphsTests : public TestClass<StatusParagraphsTests>
- {
- TEST_METHOD(find_installed)
- {
- auto pghs = parse_paragraphs(R"(
-Package: ffmpeg
-Version: 3.3.3
-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)); }));
-
- auto it = status_db.find_installed(unsafe_pspec("ffmpeg", Triplet::X64_WINDOWS));
- Assert::IsTrue(it != status_db.end());
- }
-
- TEST_METHOD(find_not_installed)
- {
- auto pghs = parse_paragraphs(R"(
-Package: ffmpeg
-Version: 3.3.3
-Architecture: x64-windows
-Multi-Arch: same
-Description:
-Status: purge ok not-installed
-)");
- Assert::IsTrue(!!pghs);
- if (!pghs) return;
-
- StatusParagraphs status_db(Util::fmap(
- *pghs.get(), [](RawParagraph& rpgh) { return std::make_unique<StatusParagraph>(std::move(rpgh)); }));
-
- auto it = status_db.find_installed(unsafe_pspec("ffmpeg", Triplet::X64_WINDOWS));
- Assert::IsTrue(it == status_db.end());
- }
-
- TEST_METHOD(find_with_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: purge ok not-installed
-)");
- Assert::IsTrue(!!pghs);
- if (!pghs) return;
-
- StatusParagraphs status_db(Util::fmap(
- *pghs.get(), [](RawParagraph& rpgh) { return std::make_unique<StatusParagraph>(std::move(rpgh)); }));
-
- 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());
- }
- };
-}