Package: libdevel-cover-perl
Version: 0.66-1
Severity: important
Tags: patch
User: [email protected]
Usertags: perl-5.12-transition

The test suite fails when the build directory path contains regexp
metacharacters. This breaks binNMUing the package at least in my (more
or less default) sbuild setup because the '+b1' version suffix ends up
in the build directory name.

Example:

% pwd
/home/niko/tmp/test+dir/libdevel-cover-perl-0.66
% perl -Iblib/lib -Iblib/arch t/atrivial.t            
1..32
# Running under perl version 5.010001 for linux
# Current time local: Wed Apr 28 21:36:52 2010
# Current time GMT:   Wed Apr 28 18:36:52 2010
# Using Test.pm version 1.25_02
[...]
not ok 7
# Test 7 got: "tests/trivial100.0    n/a    n/a    n/a  100.0\n" 
(/home/niko/tmp/test+dir/libdevel-cover-perl-0.66/blib/lib/Devel/Cover/Test.pm 
at line 295 fail #7)
#   Expected: "tests/trivial                               100.0    n/a    n/a  
  n/a  100.0\n"
#  
/home/niko/tmp/test+dir/libdevel-cover-perl-0.66/blib/lib/Devel/Cover/Test.pm 
line 295 is:             $ENV{DEVEL_COVER_NO_COVERAGE} ? ok 1 : ok $t, $c;
[...]
not ok 18
# Test 18 got: 
"/home/niko/tmp/test+dir/libdevel-cover-perl-0.66/tests/trivial\n" 
(/home/niko/tmp/test+dir/libdevel-cover-perl-0.66/blib/lib/Devel/Cover/Test.pm 
at line 295 fail #18)
#    Expected: "tests/trivial\n"
[...]

-- 
Niko Tyni   [email protected]
>From a3df3ec500224fa99ee357eef585eac1f22a3cd4 Mon Sep 17 00:00:00 2001
From: Niko Tyni <[email protected]>
Date: Wed, 28 Apr 2010 21:23:07 +0300
Subject: [PATCH] Fix test failures when the build directory contains regexp metacharacters.

The build directory name may contain regexp metacharacters like '+'
that need escaping or they break the substitution.
---
 lib/Devel/Cover.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Devel/Cover.pm b/lib/Devel/Cover.pm
index d9f2b4b..ae8e140 100644
--- a/lib/Devel/Cover.pm
+++ b/lib/Devel/Cover.pm
@@ -441,7 +441,7 @@ sub normalised_file
         # print STDERR "finally <$file> <$Dir>\n";
     }
     $file =~ s|\\|/|g if $^O eq "MSWin32";
-    $file =~ s|^$Dir/||;
+    $file =~ s|^\Q$Dir\E/||;
 
     # print STDERR "File: $f => $file\n";
 
-- 
1.7.0.4

Reply via email to