aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/vcpkg-tests/util.h
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2019-07-18 19:07:00 -0700
committerGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-07-18 19:07:00 -0700
commit825055378998ae6bc24e8cb0bce2e1fbf9a425da (patch)
treedce29d762b06e5f44e985051c3d5520c7ca1cc19 /toolsrc/include/vcpkg-tests/util.h
parent9b5ee9941232dc3dd07085de747b1e95bb059525 (diff)
downloadvcpkg-825055378998ae6bc24e8cb0bce2e1fbf9a425da.tar.gz
vcpkg-825055378998ae6bc24e8cb0bce2e1fbf9a425da.zip
Rewrite the tests! now they're cross-platform! (#7315)
* begin exploratory rewriting of tests * continue working on tests * more test work! holy butts vcpkg-tests/plan.cpp was a bunch of work * finish writing new tests - [x] write catch2 tests - [ ] rewrite/at least delete the VS project files - [ ] document running tests * Fix tests to work on WSL, rewrite test vcxproj still need to test on macOS also, delete tests.pch.h * Condense add_test calls
Diffstat (limited to 'toolsrc/include/vcpkg-tests/util.h')
-rw-r--r--toolsrc/include/vcpkg-tests/util.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg-tests/util.h b/toolsrc/include/vcpkg-tests/util.h
new file mode 100644
index 000000000..fe4ee0eec
--- /dev/null
+++ b/toolsrc/include/vcpkg-tests/util.h
@@ -0,0 +1,33 @@
+#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 = "x86-windows");
+
+std::unique_ptr<vcpkg::StatusParagraph> make_status_feature_pgh(const char* name,
+ const char* feature,
+ const char* depends = "",
+ const char* triplet = "x86-windows");
+
+vcpkg::PackageSpec unsafe_pspec(std::string name, vcpkg::Triplet t = vcpkg::Triplet::X86_WINDOWS);
+
+template<class T, class S>
+T&& unwrap(vcpkg::ExpectedT<T, S>&& p)
+{
+ REQUIRE(p.has_value());
+ return std::move(*p.get());
+}
+
+template<class T>
+T&& unwrap(vcpkg::Optional<T>&& opt)
+{
+ REQUIRE(opt.has_value());
+ return std::move(*opt.get());
+}
+
+}