Skip to content

Commit

Permalink
Skip t/opengl.t open window tests if $AUTOMATED_TESTING is set
Browse files Browse the repository at this point in the history
  • Loading branch information
devel-chm committed Oct 6, 2015
1 parent 7e2a426 commit ca09e49
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions t/opengl.t
Expand Up @@ -21,14 +21,17 @@ BEGIN {
if ( $PDL::Config{WITH_3D} ) { # check if compiled
if ( $PDL::Config{USE_POGL} ) { # check if using Perl OpenGL
if ( hasDISPLAY or exists($ENV{'PDL_INT'}) ) {
plan tests => 4;
if ( $ENV{AUTOMATED_TESTING} ) {
plan tests => 2;
} else {
plan tests => 4;
}
use_ok("OpenGL $PDL::Config{POGL_VERSION}", qw(:all));
use_ok('PDL::Graphics::OpenGL::Perl::OpenGL');
} else { # no DISPLAY
plan tests => 2;
use_ok("OpenGL $PDL::Config{POGL_VERSION}", qw(:all));
use_ok('PDL::Graphics::OpenGL::Perl::OpenGL');
exit;
}
} else {
plan skip_all => 'Non-POGL TriD graphics not supported';
Expand All @@ -47,23 +50,27 @@ SKIP: {
if ( hasDISPLAY and OpenGL::_have_glx ) {
eval { OpenGL::glpDisplay($ENV{DISPLAY}) };
skip "can't open X display", 2 if $@;
}
} elsif ( $ENV{AUTOMATED_TESTING} ) {
skip "don't open try GL windows if \$AUTOMATED_TESTING is set", 2;
} else {

my $numwins = 2;
my @windows;
my $opt;
$opt->{width} = 90;
$opt->{height} = 90;
my $numwins = 2;
my @windows;
my $opt;
$opt->{width} = 90;
$opt->{height} = 90;

foreach(0..$numwins-1){
$opt->{x} = ($numwins % 10) *100;
$opt->{y} = int($numwins / 10) *100;
my $win=eval 'PDL::Graphics::OpenGL::OO->new($opt)';
if (! defined($win) ) {
skip "$@", 2 if $@ =~ /display mode not possible/;
} else {
isa_ok($win, 'PDL::Graphics::OpenGL::OO');
foreach(0..$numwins-1){
$opt->{x} = ($numwins % 10) *100;
$opt->{y} = int($numwins / 10) *100;
my $win=eval 'PDL::Graphics::OpenGL::OO->new($opt)';
if (! defined($win) ) {
skip "$@", 2 if $@ =~ /display mode not possible/;
} else {
isa_ok($win, 'PDL::Graphics::OpenGL::OO');
}
push @windows, $win;
}
push @windows, $win;

}
}

0 comments on commit ca09e49

Please sign in to comment.