@@ -562,13 +562,22 @@ $output_filename = catfile($cwd, $output_filename)
562
562
# Build list of directories to identify external files
563
563
foreach my $entry (@data_directory , $base_directory ) {
564
564
next if (!defined ($entry ));
565
+ # do not apply substitution patterns to the dir name -
566
+ # if user really wants that, they can specify a substitution and/or
567
+ # include/exclude patterns
565
568
my $p = solve_relative_path($cwd , $entry );
566
- push (@lcovutil::internal_dirs , $p );
569
+ push (@lcovutil::internal_dirs , $p )
570
+ unless grep ($p , @lcovutil::internal_dirs );
567
571
if (!file_name_is_absolute($entry ) &&
568
572
$entry ne $p ) {
569
- push (@lcovutil::internal_dirs , $entry );
573
+ push (@lcovutil::internal_dirs , $entry )
574
+ unless grep ($entry , @lcovutil::internal_dirs );
570
575
}
571
576
}
577
+ if (@lcovutil::internal_dirs ) {
578
+ lcovutil::info(" Recording 'internal' directories:\n\t " .
579
+ join (" \n\t " , @internal_dirs ) . " \n " );
580
+ }
572
581
573
582
# Function is_external() requires all internal_dirs to end with a slash
574
583
foreach my $dir (@lcovutil::internal_dirs ) {
@@ -3375,8 +3384,14 @@ sub filter_source_files($)
3375
3384
3376
3385
foreach my $filename (keys (%{$hash })) {
3377
3386
# Skip external files if requested
3378
- if (is_external($filename ) ||
3387
+ my $external = is_external($filename );
3388
+ if ($external ||
3379
3389
TraceFile::skipCurrentFile($filename )) {
3390
+ if ($external ) {
3391
+ lcovutil::info(" Dropping 'external' file '$filename '\n " );
3392
+ } else {
3393
+ lcovutil::info(" Excluding file '$filename '\n " );
3394
+ }
3380
3395
# Remove file data
3381
3396
delete ($hash -> {$filename });
3382
3397
$lcovutil::excluded_files {$filename } = 1;
0 commit comments