From 80d2622260bf8c4221748723eab87a34101347c8 Mon Sep 17 00:00:00 2001 From: Graham Bell Date: Thu, 28 Aug 2014 11:52:37 -1000 Subject: [PATCH] Skip plotting tests unless $DISPLAY is set --- t/plot00_pgplot.t | 5 +++++ t/plot00_plplot.t | 5 +++++ t/plot00_tk.t | 4 ++++ t/plot00_tk_zinc.t | 4 ++++ t/plot_pg.t | 4 ++++ t/plot_pl.t | 4 ++++ t/plot_tk.t | 4 ++++ t/plot_tk_zinc.t | 4 ++++ 8 files changed, 34 insertions(+) diff --git a/t/plot00_pgplot.t b/t/plot00_pgplot.t index c5fd7bc..559c5cc 100644 --- a/t/plot00_pgplot.t +++ b/t/plot00_pgplot.t @@ -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 ( $@ ) { diff --git a/t/plot00_plplot.t b/t/plot00_plplot.t index 63dd8b2..9e068ff 100644 --- a/t/plot00_plplot.t +++ b/t/plot00_plplot.t @@ -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."; diff --git a/t/plot00_tk.t b/t/plot00_tk.t index d96000f..cb2409a 100644 --- a/t/plot00_tk.t +++ b/t/plot00_tk.t @@ -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 ( $@ ) { diff --git a/t/plot00_tk_zinc.t b/t/plot00_tk_zinc.t index 61bff0d..49511c3 100644 --- a/t/plot00_tk_zinc.t +++ b/t/plot00_tk_zinc.t @@ -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 ( $@ ) { diff --git a/t/plot_pg.t b/t/plot_pg.t index a28cc35..f39000b 100644 --- a/t/plot_pg.t +++ b/t/plot_pg.t @@ -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 ( $@ ) { diff --git a/t/plot_pl.t b/t/plot_pl.t index 180ec31..0f472c2 100644 --- a/t/plot_pl.t +++ b/t/plot_pl.t @@ -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 ( $@ ) { diff --git a/t/plot_tk.t b/t/plot_tk.t index 59b3f30..ca8008b 100644 --- a/t/plot_tk.t +++ b/t/plot_tk.t @@ -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 ( $@ ) { diff --git a/t/plot_tk_zinc.t b/t/plot_tk_zinc.t index e5ed7c5..9db82e7 100644 --- a/t/plot_tk_zinc.t +++ b/t/plot_tk_zinc.t @@ -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 ($@) {