Skip to content

Commit

Permalink
topotato/vendor: support .xz compression in LCOV genhtml
Browse files Browse the repository at this point in the history
... so the coverage data in topotato reports can be compressed.

Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
eqvinox committed Feb 24, 2023
1 parent 91c79bc commit 1709cdd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vendor/genhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,22 @@ sub read_info_file($)
or die("ERROR: cannot start gunzip to decompress ".
"file $_[0]!\n");
}
elsif ($_[0] =~ /\.xz$/)
{
# Check for availability of xz tool
system_no_output(1, "xz" ,"-h")
and die("ERROR: xz command not available!\n");

# Check integrity of compressed file
system_no_output(1, "xz", "-t", $_[0])
and die("ERROR: integrity check failed for ".
"compressed file $_[0]!\n");

# Open compressed file
open(INFO_HANDLE, "-|", "xz -c -d '$_[0]'")
or die("ERROR: cannot start xz to decompress ".
"file $_[0]!\n");
}
else
{
# Open decompressed file
Expand Down

0 comments on commit 1709cdd

Please sign in to comment.