diff options
| author | Curtis.Bezault <curtbezault@gmail.com> | 2019-07-23 15:29:49 -0700 |
|---|---|---|
| committer | Curtis.Bezault <curtbezault@gmail.com> | 2019-07-23 15:29:49 -0700 |
| commit | 62ec13ba36146f01bfaccbfd5ad22141d6cb061b (patch) | |
| tree | be0099257bca99ea991b599acaa5afb541ce1fd0 /toolsrc/src/vcpkg-tests/util.cpp | |
| parent | 2f2a45595fa925edeace250b694d70095c42b5fa (diff) | |
| parent | 3b808a48ce2fafab82bd7b53642a11a08b21c481 (diff) | |
| download | vcpkg-62ec13ba36146f01bfaccbfd5ad22141d6cb061b.tar.gz vcpkg-62ec13ba36146f01bfaccbfd5ad22141d6cb061b.zip | |
Merge build.cpp
Diffstat (limited to 'toolsrc/src/vcpkg-tests/util.cpp')
| -rw-r--r-- | toolsrc/src/vcpkg-tests/util.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg-tests/util.cpp b/toolsrc/src/vcpkg-tests/util.cpp new file mode 100644 index 000000000..54102f1aa --- /dev/null +++ b/toolsrc/src/vcpkg-tests/util.cpp @@ -0,0 +1,47 @@ +#include <vcpkg-tests/catch.h> +#include <vcpkg-tests/util.h> + +#include <vcpkg/statusparagraph.h> + +#include <memory> + +namespace vcpkg::Test +{ + std::unique_ptr<vcpkg::StatusParagraph> make_status_pgh(const char* name, + const char* depends, + const char* default_features, + const char* triplet) + { + 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}, + {"Default-Features", default_features}, + {"Status", "install ok installed"}}); + } + + std::unique_ptr<StatusParagraph> make_status_feature_pgh(const char* name, + const char* feature, + const char* depends, + const char* triplet) + { + 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"}}); + } + + PackageSpec unsafe_pspec(std::string name, Triplet t) + { + auto m_ret = PackageSpec::from_name_and_triplet(name, t); + REQUIRE(m_ret.has_value()); + return m_ret.value_or_exit(VCPKG_LINE_INFO); + } + +} |
