diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-11-11 19:47:56 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-11-11 19:47:56 -0800 |
| commit | ecd21d6cb429a91076c0fc1bb3c6d4af447343e8 (patch) | |
| tree | 31fd9fb1c803686339d0ce12c9a9d9eda0703e7c /toolsrc/src/tests.plan.cpp | |
| parent | 492b9448a7d91e801f4eed9f4eba1be0f888a73c (diff) | |
| download | vcpkg-ecd21d6cb429a91076c0fc1bb3c6d4af447343e8.tar.gz vcpkg-ecd21d6cb429a91076c0fc1bb3c6d4af447343e8.zip | |
[vcpkg-tests] Use PCH.
[vcpkg-update] Fix feature packages with update command.
Fixes #2003.
Diffstat (limited to 'toolsrc/src/tests.plan.cpp')
| -rw-r--r-- | toolsrc/src/tests.plan.cpp | 60 |
1 files changed, 2 insertions, 58 deletions
diff --git a/toolsrc/src/tests.plan.cpp b/toolsrc/src/tests.plan.cpp index 9cf3cfd8e..122a4ffef 100644 --- a/toolsrc/src/tests.plan.cpp +++ b/toolsrc/src/tests.plan.cpp @@ -1,41 +1,11 @@ -#include <CppUnitTest.h> -#include <vcpkg/dependencies.h> +#include "tests.pch.h" -#include <vcpkg/base/util.h> +#include <tests.utils.h> using namespace Microsoft::VisualStudio::CppUnitTestFramework; using namespace vcpkg; -namespace Microsoft::VisualStudio::CppUnitTestFramework -{ - template<> - inline std::wstring ToString<vcpkg::Dependencies::InstallPlanType>(const vcpkg::Dependencies::InstallPlanType& t) - { - switch (t) - { - case Dependencies::InstallPlanType::ALREADY_INSTALLED: return L"ALREADY_INSTALLED"; - case Dependencies::InstallPlanType::BUILD_AND_INSTALL: return L"BUILD_AND_INSTALL"; - case Dependencies::InstallPlanType::INSTALL: return L"INSTALL"; - case Dependencies::InstallPlanType::EXCLUDED: return L"EXCLUDED"; - case Dependencies::InstallPlanType::UNKNOWN: return L"UNKNOWN"; - default: return ToString(static_cast<int>(t)); - } - } - - template<> - inline std::wstring ToString<vcpkg::Dependencies::RequestType>(const vcpkg::Dependencies::RequestType& t) - { - switch (t) - { - case Dependencies::RequestType::AUTO_SELECTED: return L"AUTO_SELECTED"; - case Dependencies::RequestType::USER_REQUESTED: return L"USER_REQUESTED"; - case Dependencies::RequestType::UNKNOWN: return L"UNKNOWN"; - default: return ToString(static_cast<int>(t)); - } - } -} - namespace UnitTest1 { static std::unique_ptr<SourceControlFile> make_control_file( @@ -96,32 +66,6 @@ namespace UnitTest1 Assert::AreEqual(pkg_name.c_str(), plan.spec.name().c_str()); } - static std::unique_ptr<StatusParagraph> make_status_pgh(const char* name, - const char* depends = "", - const char* triplet = "x86-windows") - { - using Pgh = std::unordered_map<std::string, std::string>; - return std::make_unique<StatusParagraph>(Pgh{{"Package", name}, - {"Version", "1"}, - {"Architecture", triplet}, - {"Multi-Arch", "same"}, - {"Depends", depends}, - {"Status", "install ok installed"}}); - } - static std::unique_ptr<StatusParagraph> make_status_feature_pgh(const char* name, - const char* feature, - const char* depends = "", - const char* triplet = "x86-windows") - { - using Pgh = std::unordered_map<std::string, std::string>; - return std::make_unique<StatusParagraph>(Pgh{{"Package", name}, - {"Version", "1"}, - {"Feature", feature}, - {"Architecture", triplet}, - {"Multi-Arch", "same"}, - {"Depends", depends}, - {"Status", "install ok installed"}}); - } struct PackageSpecMap { std::unordered_map<std::string, SourceControlFile> map; |
