aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/tests.arguments.cpp
diff options
context:
space:
mode:
authorVictor Romero <romerosanchezv@gmail.com>2019-07-11 17:00:55 -0700
committerGitHub <noreply@github.com>2019-07-11 17:00:55 -0700
commit7dbe375a2c270e91f9742dd78cf2b579d1f5f2fa (patch)
treec43f5c1bfccea28b77da6a42ad43f5995a81ee50 /toolsrc/src/tests.arguments.cpp
parent44eff6b7b523c2e02dc33c18b3196face23921f2 (diff)
downloadvcpkg-7dbe375a2c270e91f9742dd78cf2b579d1f5f2fa.tar.gz
vcpkg-7dbe375a2c270e91f9742dd78cf2b579d1f5f2fa.zip
Testing for --overlay-ports and --overlay-triplets args (#7243)
Diffstat (limited to 'toolsrc/src/tests.arguments.cpp')
-rw-r--r--toolsrc/src/tests.arguments.cpp40
1 files changed, 38 insertions, 2 deletions
diff --git a/toolsrc/src/tests.arguments.cpp b/toolsrc/src/tests.arguments.cpp
index 533b3a0d0..e108b983a 100644
--- a/toolsrc/src/tests.arguments.cpp
+++ b/toolsrc/src/tests.arguments.cpp
@@ -15,24 +15,60 @@ namespace UnitTest1
{
TEST_METHOD(create_from_arg_sequence_options_lower)
{
- std::vector<std::string> t = {"--vcpkg-root", "C:\\vcpkg", "--scripts-root", "C:\\scripts", "--debug", "--sendmetrics", "--printmetrics"};
+ std::vector<std::string> t = {
+ "--vcpkg-root", "C:\\vcpkg",
+ "--scripts-root=C:\\scripts",
+ "--debug",
+ "--sendmetrics",
+ "--printmetrics",
+ "--overlay-ports=C:\\ports1",
+ "--overlay-ports=C:\\ports2",
+ "--overlay-triplets=C:\\tripletsA",
+ "--overlay-triplets=C:\\tripletsB"
+ };
auto v = VcpkgCmdArguments::create_from_arg_sequence(t.data(), t.data() + t.size());
Assert::AreEqual("C:\\vcpkg", v.vcpkg_root_dir.get()->c_str());
Assert::AreEqual("C:\\scripts", v.scripts_root_dir.get()->c_str());
Assert::IsTrue(v.debug && *v.debug.get());
Assert::IsTrue(v.sendmetrics && v.sendmetrics.get());
Assert::IsTrue(v.printmetrics && *v.printmetrics.get());
+
+ Assert::IsTrue(v.overlay_ports.get()->size() == 2);
+ Assert::AreEqual("C:\\ports1", v.overlay_ports.get()->at(0).c_str());
+ Assert::AreEqual("C:\\ports2", v.overlay_ports.get()->at(1).c_str());
+
+ Assert::IsTrue(v.overlay_triplets.get()->size() == 2);
+ Assert::AreEqual("C:\\tripletsA", v.overlay_triplets.get()->at(0).c_str());
+ Assert::AreEqual("C:\\tripletsB", v.overlay_triplets.get()->at(1).c_str());
}
TEST_METHOD(create_from_arg_sequence_options_upper)
{
- std::vector<std::string> t = {"--VCPKG-ROOT", "C:\\vcpkg", "--SCRIPTS-ROOT", "C:\\scripts", "--DEBUG", "--SENDMETRICS", "--PRINTMETRICS"};
+ std::vector<std::string> t = {
+ "--VCPKG-ROOT", "C:\\vcpkg",
+ "--SCRIPTS-ROOT=C:\\scripts",
+ "--DEBUG",
+ "--SENDMETRICS",
+ "--PRINTMETRICS",
+ "--OVERLAY-PORTS=C:\\ports1",
+ "--OVERLAY-PORTS=C:\\ports2",
+ "--OVERLAY-TRIPLETS=C:\\tripletsA",
+ "--OVERLAY-TRIPLETS=C:\\tripletsB"
+ };
auto v = VcpkgCmdArguments::create_from_arg_sequence(t.data(), t.data() + t.size());
Assert::AreEqual("C:\\vcpkg", v.vcpkg_root_dir.get()->c_str());
Assert::AreEqual("C:\\scripts", v.scripts_root_dir.get()->c_str());
Assert::IsTrue(v.debug && *v.debug.get());
Assert::IsTrue(v.sendmetrics && v.sendmetrics.get());
Assert::IsTrue(v.printmetrics && *v.printmetrics.get());
+
+ Assert::IsTrue(v.overlay_ports.get()->size() == 2);
+ Assert::AreEqual("C:\\ports1", v.overlay_ports.get()->at(0).c_str());
+ Assert::AreEqual("C:\\ports2", v.overlay_ports.get()->at(1).c_str());
+
+ Assert::IsTrue(v.overlay_triplets.get()->size() == 2);
+ Assert::AreEqual("C:\\tripletsA", v.overlay_triplets.get()->at(0).c_str());
+ Assert::AreEqual("C:\\tripletsB", v.overlay_triplets.get()->at(1).c_str());
}
TEST_METHOD(create_from_arg_sequence_valued_options)