Bug#768712: Bug#768692: libaudio-mpd-perl: FTBFS in jessie: dh_auto_test: perl Build test returned exit code 255

Simon McVittie smcv at debian.org
Mon Nov 10 15:18:07 UTC 2014


On Mon, 10 Nov 2014 at 14:56:48 +0000, Simon McVittie wrote:
> Of course, I meant to refer to
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=768692
> in libaudio-mpd-perl, rather than pointing to the same bug twice :-)

It's a behaviour change in mpd 0.19; search for for total_duration in
<http://anonscm.debian.org/cgit/pkg-mpd/pkg-mpd.git/commit/?id=upstream/0.19>.

I suggest this patch (untested but should work), and the equivalent
for libpoe-component-client-mpd-perl.

Unfortunately, the tests are quietly skipped on machines where mpd is
running (even if it is not actually listening on an IP port) so it's
annoying for a mpd user to run these tests...

diff --git a/t/24-info.t b/t/24-info.t
index af031c3..49f4137 100644
--- a/t/24-info.t
+++ b/t/24-info.t
@@ -18,7 +18,7 @@ use Test::More;
 eval 'use Test::Corpus::Audio::MPD';
 plan skip_all => $@ if $@ =~ s/\n+Compilation failed.*//s;
 
-plan tests => 16;
+plan tests => 17;
 my $mpd = Audio::MPD->new;
 my $song;
 
@@ -34,7 +34,12 @@ is( $stats->artists,      1, 'one artist in the database' );
 is( $stats->albums,       1, 'one album in the database' );
 is( $stats->songs,        5, '5 songs in the database' );
 is( $stats->playtime,     0, 'already played 0 seconds' );
-is( $stats->db_playtime, 10, '10 seconds worth of music in the db' );
+# Test::Corpus::Audio::MPD contains 5 tracks just over 1.8 seconds each.
+# mpd < 0.19 rounded each track up to 2 seconds then added the lengths
+# in seconds to get 10s, but mpd >= 0.19 adds up the lengths in ms and then
+# rounds it down to 9s.
+cmp_ok( $stats->db_playtime, '>=', 9, '>= 9 seconds worth of music in the db' );
+cmp_ok( $stats->db_playtime, '<=', 10, '<= 10 seconds worth of music in the db' );
 isnt( $stats->uptime, undef, 'uptime is defined' );
 isnt( $stats->db_update,  0, 'database has been updated' );
 

Regards,
    S



More information about the pkg-perl-maintainers mailing list