Subject: | some tests of t/GstPropertyProbe.t if /dev/alsamixer is not accessible |
Hi,
the bug is pretty much what the subject says. In Debian we build
packages in a chroot and /dev/alsamixer is not accessible.
The attached patch fixes the problem.
Cheers
Antonio
Subject: | skip_alsamixer_tests.patch |
/dev/alsamixer is not accessible from {cow,p}builder
Index: libgstreamer-interfaces-perl/t/GstPropertyProbe.t
===================================================================
--- libgstreamer-interfaces-perl.orig/t/GstPropertyProbe.t 2009-02-27 22:02:59.000000000 +0000
+++ libgstreamer-interfaces-perl/t/GstPropertyProbe.t 2009-02-27 22:04:13.000000000 +0000
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
use warnings;
-use Test::More tests => 9;
+use Test::More qw(no_plan);
# $Id: GstPropertyProbe.t,v 1.3 2006/07/07 22:02:22 kaffeetisch Exp $
@@ -9,6 +9,16 @@
use GStreamer -init;
use GStreamer::Interfaces;
+# if there is no r/w access to /dev/alsamixer we need to skip some tests
+my $alsamixer_rwaccess;
+if ( open (FD, '+<', "/dev/alsamixer") ) {
+ $alsamixer_rwaccess = 1;
+ close (FD);
+} else {
+ $alsamixer_rwaccess = 0;
+}
+
+# the actual tests
my $plugin = "alsamixer";
my $property = "device";
@@ -24,11 +34,15 @@
is($element -> needs_probe($pspec), TRUE);
$element -> probe_property($pspec);
-ok($element -> get_probe_values($pspec));
-ok($element -> probe_and_get_probe_values($pspec));
+if ( $alsamixer_rwaccess ) {
+ ok($element -> get_probe_values($pspec));
+ ok($element -> probe_and_get_probe_values($pspec));
+}
ok(defined $element -> needs_probe_name($property));
$element -> probe_property_name($property);
-ok($element -> get_probe_values_name($property));
-ok($element -> probe_and_get_probe_values_name($property));
+if ( $alsamixer_rwaccess ) {
+ ok($element -> get_probe_values_name($property));
+ ok($element -> probe_and_get_probe_values_name($property));
+}