1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Validate configuration options in a single pass.

By pre-calculating and storing the option dependencies in parse.auto.c validation can be completed in a single pass, which is both simpler and faster.
This commit is contained in:
David Steele
2018-08-11 12:55:33 -04:00
parent f06bf9e832
commit cd5df3570b
5 changed files with 398 additions and 178 deletions

View File

@ -552,6 +552,10 @@ testRun(void)
StringList *argList = NULL;
String *configFile = strNewFmt("%s/test.config", testPath());
TEST_RESULT_INT(
sizeof(optionResolveOrder) / sizeof(ConfigOption), CFG_OPTION_TOTAL,
"check that the option resolve list contains an entry for every option");
// -------------------------------------------------------------------------------------------------------------------------
argList = strLstNew();
strLstAdd(argList, strNew(TEST_BACKREST_EXE));
@ -718,6 +722,8 @@ testRun(void)
strLstAdd(argList, strNew("--stanza=db"));
strLstAdd(argList, strNew("--repo1-type=s3"));
strLstAdd(argList, strNew("--repo1-s3-key=xxx"));
strLstAdd(argList, strNew("--repo1-s3-bucket=xxx"));
strLstAdd(argList, strNew("--repo1-s3-endpoint=xxx"));
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP));
TEST_ERROR(
configParse(strLstSize(argList), strLstPtr(argList), false), OptionInvalidError,