r27455 - /trunk/dh-make-perl/t/Strange-0.1.t

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Sat Nov 29 21:56:12 UTC 2008


Author: dmn
Date: Sat Nov 29 21:56:10 2008
New Revision: 27455

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=27455
Log:
t/Stranve-0.1.t: complete the test

compare the generated debian/ directory with wanted-debian/

Modified:
    trunk/dh-make-perl/t/Strange-0.1.t

Modified: trunk/dh-make-perl/t/Strange-0.1.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/Strange-0.1.t?rev=27455&op=diff
==============================================================================
--- trunk/dh-make-perl/t/Strange-0.1.t (original)
+++ trunk/dh-make-perl/t/Strange-0.1.t Sat Nov 29 21:56:10 2008
@@ -7,9 +7,35 @@
 
 use FindBin qw($Bin);
 
+my $dist = "$Bin/dists/Strange-0.1";
+
+$ENV{DEBFULLNAME} = "Joe Maintainer";
 system( "$Bin/../dh-make-perl", "--no-verbose",
         "--home-dir", "$Bin/contents", "--sources-list",
-        "$Bin/contents/sources.list", "$Bin/dists/Strange-0.1" );
+        "$Bin/contents/sources.list", "--email", "joemaint\@test.local",
+        $dist );
 
 is( $?, 0, 'system returned 0' );
 
+use File::Find qw(find);
+use Text::Diff qw(diff);
+
+find(\&compare, "$dist/debian");
+
+sub compare
+{
+    return unless -f $File::Find::name;
+
+    my $diff = diff("$dist/wanted-debian/$_", $File::Find::name);
+
+    $diff = ''
+        unless grep { /^[-+] / and not /^[-+] -- Joe Maintainer / }
+            split( /\n/, $diff );
+
+    is($diff, '', "No differences to the wanted contents of debian/$_");
+}
+
+# clean after the test
+find( sub{ unlink $File::Find::name }, "$dist/debian" );
+
+rmdir "$dist/debian" or warn "Error removing $dist/debian: $!\n";




More information about the Pkg-perl-cvs-commits mailing list