aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/vcpkg-test
diff options
context:
space:
mode:
Diffstat (limited to 'toolsrc/include/vcpkg-test')
-rw-r--r--toolsrc/include/vcpkg-test/util.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg-test/util.h b/toolsrc/include/vcpkg-test/util.h
index d8ecc51ea..c15846d05 100644
--- a/toolsrc/include/vcpkg-test/util.h
+++ b/toolsrc/include/vcpkg-test/util.h
@@ -23,6 +23,18 @@ namespace vcpkg::Test
const std::vector<std::pair<const char*, const char*>>& features = {},
const std::vector<const char*>& default_features = {});
+ inline auto test_parse_control_file(const std::vector<std::unordered_map<std::string, std::string>>& v)
+ {
+ std::vector<vcpkg::Parse::Paragraph> pghs;
+ for (auto&& p : v)
+ {
+ pghs.emplace_back();
+ for (auto&& kv : p)
+ pghs.back().emplace(kv.first, std::make_pair(kv.second, vcpkg::Parse::TextRowCol{}));
+ }
+ return vcpkg::SourceControlFile::parse_control_file("", std::move(pghs));
+ }
+
std::unique_ptr<vcpkg::StatusParagraph> make_status_pgh(const char* name,
const char* depends = "",
const char* default_features = "",