Skip to content

Commit

Permalink
Skip plotting tests unless $DISPLAY is set
Browse files Browse the repository at this point in the history
  • Loading branch information
grahambell committed Aug 28, 2014
1 parent fa465f9 commit 80d2622
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 0 deletions.
5 changes: 5 additions & 0 deletions t/plot00_pgplot.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use strict;
use Test::More;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

# pgbegin( $unit, $file, $nxsub, $nysub );
eval { require PGPLOT; PGPLOT::pgbegin(0,"/xw",1,1) };
if ( $@ ) {
Expand Down
5 changes: 5 additions & 0 deletions t/plot00_plplot.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ use strict;
use Test::More;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

eval {require Graphics::PLplot; };
if ( $@ ) {
plan skip_all => "Graphics::PLplot module not installed.";
Expand Down
4 changes: 4 additions & 0 deletions t/plot00_tk.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ use strict;
use Test::More;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

eval "use Tk; use Tk::Button;";
if ( $@ ) {
Expand Down
4 changes: 4 additions & 0 deletions t/plot00_tk_zinc.t
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ use strict;
use Test::More;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

eval "use Tk; use Tk::Button;";
if ( $@ ) {
Expand Down
4 changes: 4 additions & 0 deletions t/plot_pg.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ require_ok( "Starlink::AST::PGPLOT" );
use File::Spec;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

eval { require PGPLOT; PGPLOT::pgbegin(0,"/xw",1,1) };
if ( $@ ) {
Expand Down
4 changes: 4 additions & 0 deletions t/plot_pl.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ require_ok( "Starlink::AST::PLplot" );
use File::Spec;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

eval "use Graphics::PLplot";
if ( $@ ) {
Expand Down
4 changes: 4 additions & 0 deletions t/plot_tk.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ use Test::More;
use Data::Dumper;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

eval "use Tk; use Tk::Button";
if ( $@ ) {
Expand Down
4 changes: 4 additions & 0 deletions t/plot_tk_zinc.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ use Data::Dumper;
use File::Spec;

BEGIN {
unless (exists $ENV{'DISPLAY'}) {
plan skip_all => '$DISPLAY is not set.';
exit;
}

eval "use Tk";
if ($@) {
Expand Down

0 comments on commit 80d2622

Please sign in to comment.