Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Errors when Installing Modules

0 views
Skip to first unread message

Jack D

unread,
Jun 23, 2008, 6:09:20 PM6/23/08
to
I see that I have a errors when installing some Tk modules. All the errors
have to do with not being able to display the GUI during the "make test"
portion of the install.

http://ppm.activestate.com/beta/author/DUNNIGANJ.html

Errors such as the following:

couldn't connect to display ":0" at
/home/cpan/perl585/.cpanplus/5.8.5/build/Tk-804.028/blib/lib/Tk/MainWindow.pm
line 55.
MainWindow->new() at test.pl line 26

How would I bypass running the GUI test if there is no display to connect to
so that the install tests show pass instead of fail?

Jack


sisyphus

unread,
Jun 23, 2008, 7:48:46 PM6/23/08
to
On Jun 24, 8:09 am, "Jack D" <j...@home.net> wrote:
> I see that I have a errors when installing some Tk modules. All the errors
> have to do with not being able to display the GUI during the "make test"
> portion of the install.
>
> http://ppm.activestate.com/beta/author/DUNNIGANJ.html
>
> Errors such as the following:
>
> couldn't connect to display ":0" at
> /home/cpan/perl585/.cpanplus/5.8.5/build/Tk-804.028/blib/lib/Tk/MainWindow.­pm

> line 55.
> MainWindow->new() at test.pl line 26
>
> How would I bypass running the GUI test if there is no display to connect to
> so that the install tests show pass instead of fail?

Are those errors specific to ActiveState's ppm build process, or are
you also getting them with cpan-testers ? (I'm thinking that if it's
specific to ActiveState, the correct approach might be to get them to
fix their build environment.)

As regards bypassing the tests, is there some eval() you could run (in
the test script) to pre-determine the availability of the display ?

Cheers,
Rob

Jack D

unread,
Jun 23, 2008, 8:48:14 PM6/23/08
to
"sisyphus" <sisyp...@gmail.com> wrote in message
news:d1d847a7-e865-49b4...@p25g2000pri.googlegroups.com...

On Jun 24, 8:09 am, "Jack D" <j...@home.net> wrote:
> I see that I have a errors when installing some Tk modules. All the errors
> have to do with not being able to display the GUI during the "make test"
> portion of the install.
>
> http://ppm.activestate.com/beta/author/DUNNIGANJ.html
>
> > Errors such as the following:
> >
> > couldn't connect to display ":0" at
> > /home/cpan/perl585/.cpanplus/5.8.5/build/Tk-804.028/blib/lib/Tk/MainWindow.計m

> > line 55.
> > MainWindow->new() at test.pl line 26
> >
> > How would I bypass running the GUI test if there is no display to
> > connect to
> > so that the install tests show pass instead of fail?

> Are those errors specific to ActiveState's ppm build process, or are
> you also getting them with cpan-testers ? (I'm thinking that if it's
> specific to ActiveState, the correct approach might be to get them to
> fix their build environment.)

> As regards bypassing the tests, is there some eval() you could run (in
> the test script) to pre-determine the availability of the display ?

> Cheers,
> Rob


Hi Rob.

No it is not just an Activestate thing. The errors are also shown on CPAN as
well.

http://cpantesters.perl.org/author/DUNNIGANJ.html

I thought it could be as simple as checking if the existence of
$ENV{DISPLAY} - However even though it could be set - it doesn't guarantee
that the window will have permission to be displayed (i.e. xhost
permissions).

I'm thinking that I might have to eval the entire Tk script - but I was
hoping for a more elegant solution. Any other thoughts?

Jack


Marc Girod

unread,
Jun 24, 2008, 4:50:05 AM6/24/08
to
On Jun 24, 1:48 am, "Jack D" <j...@home.net> wrote:

> I thought it could be as simple as checking if the existence of
> $ENV{DISPLAY} - However even though it could be set - it doesn't guarantee
> that the window will have permission to be displayed (i.e. xhost
> permissions).

And this is quite tricky to check in a portable way...
I am afraid the best one can do is to document it.

On my box (Solaris), this finds where I came from:

$ who am i | perl -ne 'print if s/^.*\((.*)\)$/$1/' | sort -u

but it gets fooled if I jumps two hops (tells only the previous one).
And anyway, nothing guarantees that I can ssh or rsh back to check
xhost.

One could also look for the X display socket?

Marc

V. Ul. Peculus

unread,
Jun 24, 2008, 10:16:24 AM6/24/08
to

You can set up a virtual framebuffer with Xvfb and use it as the
"display" for your GUI

Ch Lamprecht

unread,
Jun 24, 2008, 5:08:01 PM6/24/08
to

Hi Jack,

you can use Test::More and a SKIP - block, then just test tkinit()

Christoph


use Test::More tests => 17;
BEGIN {use_ok ('Tk');
use_ok ('Tk::MyModule');
}

SKIP:{

my $mw = eval{ tkinit()};

skip 'Tk::MainWindow instantiation failed - skipping Tk-MyModule.t',
15 if $@;

## 15 tests

}#end SKIP


--
use Tk;use Tk::GraphItems;$c=tkinit->Canvas->pack;push@i,Tk::GraphItems->
TextBox(text=>$_,canvas=>$c,x=>$x+=70,y=>100)for(Just=>another=>Perl=>Hacker);
Tk::GraphItems->Connector(source=>$i[$_],target=>$i[$_+1])for(0..2);
$c->repeat(30,sub{$_->move(0,4*cos($d+=3.16))for(@i)});MainLoop

Jack D

unread,
Jun 26, 2008, 1:01:38 AM6/26/08
to
"Ch Lamprecht" <ch.l...@online.de> wrote in message
news:g3rnng$cdh$1...@online.de...
Perfect! Thanks Christoph.

Do you know if Test::More a core module?

Jack


sisyphus

unread,
Jun 26, 2008, 6:18:13 AM6/26/08
to
On Jun 26, 3:01 pm, "Jack D" <j...@home.net> wrote:

>
> Do you know if Test::More a core module?
>

It was a core module beginning with 5.6.2:

C:\>perl -MModule::CoreList -e "print Module::CoreList-
>first_release('Test::More')"
5.006002

Cheers,
Rob

0 new messages