summaryrefslogtreecommitdiff
path: root/Tests/CMakeLib
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-07-20 15:52:45 -0400
committerBrad King <brad.king@kitware.com>2022-07-25 13:51:43 -0400
commitf95a5832c7ce6e88bd623e818471fa8c23fa77f4 (patch)
tree59264f579af5b4c07ad21fe07c6101bf03088777 /Tests/CMakeLib
parent9a7efb681331f77a3873bd9fb5694ad46338c0f7 (diff)
downloadcmake-f95a5832c7ce6e88bd623e818471fa8c23fa77f4.tar.gz
cmArgumentParser: Drop unused keywordsMissingValue argument to Parse()
All clients have been converted to encoding this requirement in their bindings.
Diffstat (limited to 'Tests/CMakeLib')
-rw-r--r--Tests/CMakeLib/testArgumentParser.cxx24
1 files changed, 7 insertions, 17 deletions
diff --git a/Tests/CMakeLib/testArgumentParser.cxx b/Tests/CMakeLib/testArgumentParser.cxx
index f0ace50e1b..9db7936829 100644
--- a/Tests/CMakeLib/testArgumentParser.cxx
+++ b/Tests/CMakeLib/testArgumentParser.cxx
@@ -63,14 +63,10 @@ std::initializer_list<cm::string_view> const args = {
};
bool verifyResult(Result const& result,
- std::vector<std::string> const& unparsedArguments,
- std::vector<cm::string_view> const& keywordsMissingValue)
+ std::vector<std::string> const& unparsedArguments)
{
static std::vector<std::string> const foobar = { "foo", "bar" };
static std::vector<std::string> const barfoo = { "bar", "foo" };
- static std::vector<cm::string_view> const missing = { "STRING_1"_s,
- "LIST_1"_s,
- "LIST_4"_s };
static std::map<cm::string_view, std::string> const keywordErrors = {
{ "STRING_1"_s, " missing required value\n" },
{ "LIST_1"_s, " missing required value\n" },
@@ -117,7 +113,6 @@ bool verifyResult(Result const& result,
ASSERT_TRUE(unparsedArguments.size() == 1);
ASSERT_TRUE(unparsedArguments[0] == "bar");
- ASSERT_TRUE(keywordsMissingValue == missing);
ASSERT_TRUE(result.GetKeywordErrors().size() == keywordErrors.size());
for (auto const& ke : result.GetKeywordErrors()) {
@@ -133,7 +128,6 @@ bool testArgumentParserDynamic()
{
Result result;
std::vector<std::string> unparsedArguments;
- std::vector<cm::string_view> keywordsMissingValue;
static_cast<ArgumentParser::ParseResult&>(result) =
cmArgumentParser<void>{}
@@ -153,9 +147,9 @@ bool testArgumentParserDynamic()
.Bind("MULTI_2"_s, result.Multi2)
.Bind("MULTI_3"_s, result.Multi3)
.Bind("MULTI_4"_s, result.Multi4)
- .Parse(args, &unparsedArguments, &keywordsMissingValue);
+ .Parse(args, &unparsedArguments);
- return verifyResult(result, unparsedArguments, keywordsMissingValue);
+ return verifyResult(result, unparsedArguments);
}
static auto const parserStatic = //
@@ -181,20 +175,16 @@ static auto const parserStatic = //
bool testArgumentParserStatic()
{
std::vector<std::string> unparsedArguments;
- std::vector<cm::string_view> keywordsMissingValue;
- Result const result =
- parserStatic.Parse(args, &unparsedArguments, &keywordsMissingValue);
- return verifyResult(result, unparsedArguments, keywordsMissingValue);
+ Result const result = parserStatic.Parse(args, &unparsedArguments);
+ return verifyResult(result, unparsedArguments);
}
bool testArgumentParserStaticBool()
{
std::vector<std::string> unparsedArguments;
- std::vector<cm::string_view> keywordsMissingValue;
Result result;
- ASSERT_TRUE(parserStatic.Parse(result, args, &unparsedArguments,
- &keywordsMissingValue) == false);
- return verifyResult(result, unparsedArguments, keywordsMissingValue);
+ ASSERT_TRUE(parserStatic.Parse(result, args, &unparsedArguments) == false);
+ return verifyResult(result, unparsedArguments);
}
} // namespace