Skip to content

Commit 4f2c3ae

Browse files
Peter Oberparleiteroberpar
authored andcommitted
genhtml: Check for proper description file format
Ensure that description files contain test name lines before test description lines. This fixes a "use of uninitialized value" warning in genhtml. Signed-off-by: Peter Oberparleiter <[email protected]>
1 parent 3a68239 commit 4f2c3ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/genhtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ use Digest::MD5 qw(md5_base64);
7373

7474
# Global constants
7575
our $title = "LCOV - code coverage report";
76-
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.77 $)';
76+
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.78 $)';
7777
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
7878
our $tool_name = basename($0);
7979

@@ -2521,6 +2521,9 @@ sub read_testfile($)
25212521
# Match lines beginning with TD:<whitespace(s)>
25222522
if (/^TD:\s+(.*?)\s*$/)
25232523
{
2524+
if (!defined($test_name)) {
2525+
die("ERROR: Found test description without prior test name in $_[0]:$.\n");
2526+
}
25242527
# Check for empty line
25252528
if ($1)
25262529
{

0 commit comments

Comments
 (0)