r29315 - in /branches/upstream/libtest-needsdisplay-perl/current: Changes MANIFEST META.yml Makefile.PL README lib/Test/NeedsDisplay.pm t/02_skip_all.t t/10_run.t t/11_run.t t/12_run.t t/lib/ t/lib/Display.pm

gregoa at users.alioth.debian.org gregoa at users.alioth.debian.org
Mon Jan 5 14:19:09 UTC 2009


Author: gregoa
Date: Mon Jan  5 14:19:06 2009
New Revision: 29315

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=29315
Log:
[svn-upgrade] Integrating new upstream version, libtest-needsdisplay-perl (1.07)

Added:
    branches/upstream/libtest-needsdisplay-perl/current/t/02_skip_all.t
    branches/upstream/libtest-needsdisplay-perl/current/t/10_run.t
    branches/upstream/libtest-needsdisplay-perl/current/t/11_run.t
    branches/upstream/libtest-needsdisplay-perl/current/t/12_run.t
    branches/upstream/libtest-needsdisplay-perl/current/t/lib/
    branches/upstream/libtest-needsdisplay-perl/current/t/lib/Display.pm
Modified:
    branches/upstream/libtest-needsdisplay-perl/current/Changes
    branches/upstream/libtest-needsdisplay-perl/current/MANIFEST
    branches/upstream/libtest-needsdisplay-perl/current/META.yml
    branches/upstream/libtest-needsdisplay-perl/current/Makefile.PL
    branches/upstream/libtest-needsdisplay-perl/current/README
    branches/upstream/libtest-needsdisplay-perl/current/lib/Test/NeedsDisplay.pm

Modified: branches/upstream/libtest-needsdisplay-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/Changes?rev=29315&op=diff
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/Changes (original)
+++ branches/upstream/libtest-needsdisplay-perl/current/Changes Mon Jan  5 14:19:06 2009
@@ -1,4 +1,12 @@
 Changes for Perl extension Test-NeedsDisplay
+
+1.07 Sun  4 Jan 2009
+	- Fixing a typo bug
+	- More tests thanks to Gabor
+
+1.06 Sun  4 Jan 2009
+	- Don't require xvfb-run if running under wxPerl
+	- Add support for :skip_all
 
 1.05 Wed 29 Oct 2008
 	- Adding support for passing through -d and -Mblib

Modified: branches/upstream/libtest-needsdisplay-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/MANIFEST?rev=29315&op=diff
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/MANIFEST (original)
+++ branches/upstream/libtest-needsdisplay-perl/current/MANIFEST Mon Jan  5 14:19:06 2009
@@ -15,6 +15,11 @@
 META.yml
 README
 t/01_compile.t
+t/02_skip_all.t
+t/10_run.t
+t/11_run.t
+t/12_run.t
 t/97_meta.t
 t/98_pod.t
 t/99_pmv.t
+t/lib/Display.pm

Modified: branches/upstream/libtest-needsdisplay-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/META.yml?rev=29315&op=diff
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/META.yml (original)
+++ branches/upstream/libtest-needsdisplay-perl/current/META.yml Mon Jan  5 14:19:06 2009
@@ -2,8 +2,6 @@
 abstract: 'Ensure that tests needing a display have one'
 author:
   - 'Adam Kennedy <adamk at cpan.org>'
-build_requires:
-  Test::More: 0.47
 distribution_type: module
 generated_by: 'Module::Install version 0.77'
 license: perl
@@ -18,7 +16,8 @@
     - t
 requires:
   File::Spec: 0.80
+  Test::More: 0.47
   perl: 5.6.0
 resources:
   license: http://dev.perl.org/licenses/
-version: 1.05
+version: 1.07

Modified: branches/upstream/libtest-needsdisplay-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/Makefile.PL?rev=29315&op=diff
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/Makefile.PL (original)
+++ branches/upstream/libtest-needsdisplay-perl/current/Makefile.PL Mon Jan  5 14:19:06 2009
@@ -1,11 +1,15 @@
 use inc::Module::Install 0.77;
 
-all_from      'lib/Test/NeedsDisplay.pm';
-requires      'File::Spec' => '0.80';
-test_requires 'Test::More' => '0.47';
+all_from  'lib/Test/NeedsDisplay.pm';
+requires  'File::Spec' => '0.80';
+requires  'Test::More' => '0.47';
 
-unless ( $^O eq 'MSWin32' or $ENV{DISPLAY} ) {
-	requires_external_bin 'xvfb-run';
+unless ( $^O eq 'MSWin32' or $ENV{DISPLAY} or $^X =~ /wxPerl/ ) { 
+	if ( $^O eq 'darwin') {
+		print STDERR 'Consider running as "wxPerl Makefile.PL" or "wxPerl -MCPAN -e shell"';
+	} else {
+		requires_external_bin 'xvfb-run';
+	}
 }
 
 WriteAll;

Modified: branches/upstream/libtest-needsdisplay-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/README?rev=29315&op=diff
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/README (original)
+++ branches/upstream/libtest-needsdisplay-perl/current/README Mon Jan  5 14:19:06 2009
@@ -84,7 +84,7 @@
     Adam Kennedy <adamk at cpan.org>
 
 COPYRIGHT
-    Copyright 2005 - 2008 Adam Kennedy.
+    Copyright 2005 - 2009 Adam Kennedy.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.

Modified: branches/upstream/libtest-needsdisplay-perl/current/lib/Test/NeedsDisplay.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/lib/Test/NeedsDisplay.pm?rev=29315&op=diff
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/lib/Test/NeedsDisplay.pm (original)
+++ branches/upstream/libtest-needsdisplay-perl/current/lib/Test/NeedsDisplay.pm Mon Jan  5 14:19:06 2009
@@ -85,10 +85,11 @@
 use strict;
 use Config     ();
 use File::Spec ();
+use Test::More ();
 
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '1.05';
+	$VERSION = '1.07';
 }
 
 sub import {
@@ -111,6 +112,12 @@
 			($INC{'perl5db.pl'} ? '-d' : ()),
 			$0,
 		);
+	}
+
+	# If provided with the :skip_all, abort the run
+	if ( $_[1] and $_[1] eq ':skip_all' ) {
+		Test::More::plan( skip_all => 'Test needs a DISPLAY' );
+		exit(0);
 	}
 
 	print "# Failed to find xvfb-run.\n";
@@ -139,7 +146,7 @@
 
 =head1 COPYRIGHT
 
-Copyright 2005 - 2008 Adam Kennedy.
+Copyright 2005 - 2009 Adam Kennedy.
 
 This program is free software; you can redistribute
 it and/or modify it under the same terms as Perl itself.

Added: branches/upstream/libtest-needsdisplay-perl/current/t/02_skip_all.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/t/02_skip_all.t?rev=29315&op=file
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/t/02_skip_all.t (added)
+++ branches/upstream/libtest-needsdisplay-perl/current/t/02_skip_all.t Mon Jan  5 14:19:06 2009
@@ -1,0 +1,14 @@
+#!/usr/bin/perl
+
+# This should skip properly if you don't have DISPLAY
+
+use strict;
+BEGIN {
+	$|  = 1;
+	$^W = 1;
+}
+
+use Test::NeedsDisplay ':skip_all';
+use Test::More tests => 1;
+
+ok( 1, 'Stub test' );

Added: branches/upstream/libtest-needsdisplay-perl/current/t/10_run.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/t/10_run.t?rev=29315&op=file
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/t/10_run.t (added)
+++ branches/upstream/libtest-needsdisplay-perl/current/t/10_run.t Mon Jan  5 14:19:06 2009
@@ -1,0 +1,12 @@
+#!/usr/bin/perl
+
+use strict;
+BEGIN {
+	$|  = 1;
+	$^W = 1;
+}
+
+use t::lib::Display;
+t::lib::Display::xeyes();
+
+

Added: branches/upstream/libtest-needsdisplay-perl/current/t/11_run.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/t/11_run.t?rev=29315&op=file
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/t/11_run.t (added)
+++ branches/upstream/libtest-needsdisplay-perl/current/t/11_run.t Mon Jan  5 14:19:06 2009
@@ -1,0 +1,12 @@
+#!/usr/bin/perl
+
+use strict;
+BEGIN {
+	$|  = 1;
+	$^W = 1;
+}
+
+use t::lib::Display;
+t::lib::Display::xeyes();
+
+

Added: branches/upstream/libtest-needsdisplay-perl/current/t/12_run.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/t/12_run.t?rev=29315&op=file
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/t/12_run.t (added)
+++ branches/upstream/libtest-needsdisplay-perl/current/t/12_run.t Mon Jan  5 14:19:06 2009
@@ -1,0 +1,12 @@
+#!/usr/bin/perl
+
+use strict;
+BEGIN {
+	$|  = 1;
+	$^W = 1;
+	# ENV{DISPLAY} = undef if $ENV{DISPLAY};
+}
+
+use t::lib::Display;
+t::lib::Display::xeyes();
+

Added: branches/upstream/libtest-needsdisplay-perl/current/t/lib/Display.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libtest-needsdisplay-perl/current/t/lib/Display.pm?rev=29315&op=file
==============================================================================
--- branches/upstream/libtest-needsdisplay-perl/current/t/lib/Display.pm (added)
+++ branches/upstream/libtest-needsdisplay-perl/current/t/lib/Display.pm Mon Jan  5 14:19:06 2009
@@ -1,0 +1,35 @@
+package t::lib::Display;
+use strict;
+use warnings FATAL => 'all';
+
+our $VERSION = '1.07';
+
+use Test::More;
+use Test::NeedsDisplay ':skip_all';
+
+sub xeyes {
+	my $xeyes = '/usr/bin/xeyes';
+
+	plan skip_all => "No $xeyes" if not -e $xeyes;
+	
+	plan tests => 2;
+	$SIG{ALRM} = sub { die "TIMEOUT\n" };
+	alarm(1);
+	my $pid = open(my $ph, "|$xeyes");
+	eval {
+		if (ok($pid, 'running xeyes')) {
+			diag "PID $pid";
+			sleep 3;
+		}
+	};
+	alarm(0);
+	ok($@ and $@ eq "TIMEOUT\n");
+	if ($pid) {
+		kill 9, $pid;
+	}
+}
+
+
+1;
+
+




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