1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-05 00:28:52 +02:00

Build command and configuration reference in C.

Migrate generation of these files from help.xml to the intermediate documentation format. This allows us to share a lot of code that is already in C and remove duplicated code in Perl. More duplicate code can be removed in Perl once man generation is migrated.

Also update the unit test harness to allow testing of modules in the doc directory.
This commit is contained in:
David Steele
2023-10-09 14:03:43 -04:00
parent 983cc1a9e3
commit 1eb0162208
25 changed files with 1366 additions and 421 deletions

View File

@ -129,6 +129,10 @@ sub coverageExtract
{
$strModuleName =~ s/^test/src/mg;
}
elsif ($strModuleName =~ /^doc/mg)
{
$strModuleName =~ s/^doc/doc\/src/mg;
}
my $strModuleOutName = $strModuleName;
my $bTest = false;
@ -150,6 +154,10 @@ sub coverageExtract
{
$strModulePath .= 'test/src/module/' . substr(${strModuleOutName}, 5);
}
elsif (${strModuleOutName} =~ /^doc\//)
{
$strModulePath .= "${strModuleOutName}";
}
else
{
$strModulePath .= "src/${strModuleOutName}";
@ -161,7 +169,7 @@ sub coverageExtract
my $strModuleSourceFile = $strModulePath . '.c' . ($bInc ? '.inc' : '');
executeTest(
"${strLCovExe}" . ($bTest ? ' --rc lcov_branch_coverage=0' : '') . " --extract=${strLCovOut} */${strModuleName}.c" .
"${strLCovExe}" . ($bTest ? ' --rc lcov_branch_coverage=0' : '') . " --extract=${strLCovOut} *${strModuleName}.c" .
($bInc ? '.inc' : '') . " --o=${strLCovOutTmp}");
# Combine with prior run if there was one
@ -315,6 +323,7 @@ sub coverageValidateAndGenerate
{
my $strCoverageFile = $strCodeModule;
$strCoverageFile =~ s/^test/src/mg;
$strCoverageFile =~ s/^doc/doc\/src/mg;
$strCoverageFile =~ s/^module/test/mg;
$strCoverageFile = "${strTestResultCoveragePath}/raw/${strCoverageFile}.lcov";