You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-11-06 08:49:29 +02:00
Add .inc extension to C files included in other C files.
These files were never intended to be compiled on their own so the .c extension was a bit misleading. In particular Meson does not like .c files that are not intended to be compiled independently. Leave header files as is since they are already protected against being included more than once and are never expected to be compiled.
This commit is contained in:
@@ -94,13 +94,13 @@ sub codeCountScan
|
||||
}
|
||||
|
||||
# Append auto if an auto-generated file
|
||||
if ($strFile =~ '\.auto\..$' | $strFile =~ 'Auto\.pm$')
|
||||
if ($strFile =~ '\.auto\..$' || $strFile =~ '\.auto\..\.inc$' || $strFile =~ 'Auto\.pm$')
|
||||
{
|
||||
$strClass .= '/auto';
|
||||
}
|
||||
|
||||
# Append vendor if a vendorized file
|
||||
if ($strFile =~ '\.vendor\..$')
|
||||
if ($strFile =~ '\.vendor\..$' || $strFile =~ '\.vendor\..\.inc$')
|
||||
{
|
||||
$strClass .= '/vendor';
|
||||
}
|
||||
@@ -119,7 +119,7 @@ sub codeCountScan
|
||||
$strType = 'c/h';
|
||||
$strForceLang = 'C/C++ Header';
|
||||
}
|
||||
elsif ($strFile =~ '\.c$')
|
||||
elsif ($strFile =~ '\.c$' || $strFile =~ '\.c.inc$')
|
||||
{
|
||||
$strType = 'c';
|
||||
$strForceLang = 'C';
|
||||
|
||||
@@ -140,16 +140,18 @@ sub coverageExtract
|
||||
'test/src/module/' . substr(${strModuleOutName}, 5) : "src/${strModuleOutName}");
|
||||
my $strLCovFile = "${strTestResultCoveragePath}/raw/${strModuleOutName}.lcov";
|
||||
my $strLCovTotal = "${strWorkTmpPath}/all.lcov";
|
||||
my $bInc = $strModuleName =~ '\.vendor$' || $strModuleName =~ '\.auto$';
|
||||
my $strModuleSourceFile = $strModulePath . '.c' . ($bInc ? '.inc' : '');
|
||||
|
||||
executeTest(
|
||||
"${strLCovExe}" . ($bTest ? ' --rc lcov_branch_coverage=0' : '') . " --extract=${strLCovOut} */${strModuleName}.c" .
|
||||
" --o=${strLCovOutTmp}");
|
||||
($bInc ? '.inc' : '') . " --o=${strLCovOutTmp}");
|
||||
|
||||
# Combine with prior run if there was one
|
||||
if ($oStorage->exists($strLCovFile))
|
||||
{
|
||||
my $strCoverage = ${$oStorage->get($strLCovOutTmp)};
|
||||
$strCoverage =~ s/^SF\:.*$/SF:$strModulePath\.c/mg;
|
||||
$strCoverage =~ s/^SF\:.*$/SF:$strModuleSourceFile/mg;
|
||||
$oStorage->put($strLCovOutTmp, $strCoverage);
|
||||
|
||||
executeTest("${strLCovExe} --add-tracefile=${strLCovOutTmp} --add-tracefile=${strLCovFile} --o=${strLCovOutTmp}");
|
||||
@@ -185,7 +187,7 @@ sub coverageExtract
|
||||
if (!$bTest || $iTotalLines != $iCoveredLines || $iTotalBranches != $iCoveredBranches)
|
||||
{
|
||||
# Fix source file name
|
||||
$strCoverage =~ s/^SF\:.*$/SF:$strModulePath\.c/mg;
|
||||
$strCoverage =~ s/^SF\:.*$/SF:$strModuleSourceFile/mg;
|
||||
|
||||
$oStorage->put($oStorage->openWrite($strLCovFile, {bPathCreate => true}), $strCoverage);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user