1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-10-30 23:37:45 +02:00

Move raw coverage results to test/result/raw path.

These results were stored in the vagrant path along with a full copy of src.

Instead store the raw coverage data in test/result/raw and change source references to the files that already exist in [test-path]/repo.
This commit is contained in:
David Steele
2020-03-16 08:41:32 -04:00
parent d702249507
commit 4328bc1ac6
3 changed files with 35 additions and 28 deletions

View File

@@ -626,7 +626,7 @@ sub end
"module/$self->{oTest}->{&TEST_MODULE}/" . testRunName($self->{oTest}->{&TEST_NAME}, false) . 'Test');
# Generate coverage reports for the modules
my $strLCovConf = $self->{strBackRestBase} . '/test/.vagrant/code/lcov.conf';
my $strLCovConf = $self->{strBackRestBase} . '/test/result/coverage/raw/lcov.conf';
coverageLCovConfigGenerate($self->{oStorageTest}, $strLCovConf, $self->{bCoverageSummary});
my $strLCovExeBase = "lcov --config-file=${strLCovConf}";
@@ -659,9 +659,12 @@ sub end
}
# Generate lcov reports
my $strModulePath = $self->{strBackRestBase} . "/test/.vagrant/code/${strModuleOutName}";
my $strLCovFile = "${strModulePath}.lcov";
my $strLCovTotal = $self->{strBackRestBase} . "/test/.vagrant/code/all.lcov";
my $strModulePath =
$self->{strTestPath} . "/repo/" .
(${strModuleOutName} =~ /^test\// ?
'test/src/module/' . substr(${strModuleOutName}, 5) : "src/${strModuleOutName}");
my $strLCovFile = $self->{strBackRestBase} . "/test/result/coverage/raw/${strModuleOutName}.lcov";
my $strLCovTotal = $self->{strTestPath} . "/temp/all.lcov";
executeTest(
"${strLCovExe} --extract=${strLCovOut} */${strModuleName}.c --o=${strLCovOutTmp}");
@@ -709,7 +712,8 @@ sub end
# Fix source file name
$strCoverage =~ s/^SF\:.*$/SF:$strModulePath\.c/mg;
$self->{oStorageTest}->put($strLCovFile, $strCoverage);
$self->{oStorageTest}->put(
$self->{oStorageTest}->openWrite($strLCovFile, {bPathCreate => true}), $strCoverage);
if ($self->{oStorageTest}->exists($strLCovTotal))
{