mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-05 01:53:32 +01:00
43db91bd87
Also, fix two instances of runaway LCOV_EXCL_START lines.
35 lines
745 B
Perl
Executable File
35 lines
745 B
Perl
Executable File
#!/usr/bin/perl -p -i
|
|
|
|
use warnings;
|
|
use strict;
|
|
our $excluding;
|
|
|
|
# This script is meant to post-process a .gcov file for an input source
|
|
# that was annotated with LCOV_EXCL_START, LCOV_EXCL_STOP, and LCOV_EXCL_LINE
|
|
# entries. It doesn't understand the LCOV_EXCL_BR* variations.
|
|
#
|
|
# It replaces unreached reached lines with x:, and reached excluded lines
|
|
# with !!!num:.
|
|
|
|
BEGIN { our $excluding = 0; }
|
|
|
|
if (m/LCOV_EXCL_START/) {
|
|
$excluding = 1;
|
|
}
|
|
if ($excluding and m/LCOV_EXCL_STOP/) {
|
|
$excluding = 0;
|
|
}
|
|
|
|
my $exclude_this = (m/LCOV_EXCL_LINE/);
|
|
|
|
if ($excluding or $exclude_this) {
|
|
s{^\s*\#\#+:}{ x:};
|
|
s{^ (\s*)(\d+):}{$1!!!$2:};
|
|
}
|
|
|
|
if (eof and $excluding) {
|
|
warn "Runaway LCOV_EXCL_START in $ARGV";
|
|
$excluding = 0;
|
|
}
|
|
|