Skip to content

Commit 49b8771

Browse files
Peter Oberparleiteroberpar
authored andcommitted
geninfo: make empty data directories non-fatal
Emit a warning when no data file is found in a data directory to allow processing of additional directories. Based on suggestion by [email protected].
1 parent 3836c16 commit 49b8771

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

bin/geninfo

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if( $^O eq "msys" )
6161
}
6262

6363
# Constants
64-
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.118 $)';
64+
our $lcov_version = 'LCOV version 1.11 pre (CVS $Revision: 1.119 $)';
6565
our $lcov_url = "http://ltp.sourceforge.net/coverage/lcov.php";
6666
our $gcov_tool = "gcov";
6767
our $tool_name = basename($0);
@@ -684,8 +684,11 @@ sub gen_info($)
684684

685685
@file_list = `find "$directory" $maxdepth $follow -name \\*$ext -type f 2>/dev/null`;
686686
chomp(@file_list);
687-
@file_list or
688-
die("ERROR: no $ext files found in $directory!\n");
687+
if (!@file_list) {
688+
warn("WARNING: no $ext files found in $directory - ".
689+
"skipping!\n");
690+
return;
691+
}
689692
$prefix = get_common_prefix(1, @file_list);
690693
info("Found %d %s files in %s\n", $#file_list+1, $type,
691694
$directory);

0 commit comments

Comments
 (0)