Skip GTK tests if no display available?

2011-08-25 Thread Thomas Klausner
Hi!

I recently uploaded a small dist to CPAN (App-TimeTracker-Gtk2TrayIcon) 
that uses Gtk2::TrayIcon to display my working status (powered by 
App::TimeTracker...)

Now I'm getting FAIL reports like this:
http://www.cpantesters.org/cpan/report/0c00fda4-cde2-11e0-bbec-9aeec8b7ec30

[ERROR] [Wed Aug 24 00:45:54 2011] MAKE TEST failed:
Gtk-WARNING **: cannot open display:  at 
/usr/home/cpan/pit/thr/conf/perl-5.10.1/.cpanplus/5.10.1/build/Gtk2-1.224/blib/lib/Gtk2.pm
 
line 138.

Is there an easy and/or unified way to skip tests if there is no 
display?
Are there ways to mock a display?

Thanks for any tips,
domm


-- 
#!/usr/bin/perl  http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Skip GTK tests if no display available?

2011-08-25 Thread Colin Newell
Would simply detecting the DISPLAY environment variable work for the
first question?


Colin.

On 25 August 2011 07:51, Thomas Klausner d...@cpan.org wrote:
 Hi!

 I recently uploaded a small dist to CPAN (App-TimeTracker-Gtk2TrayIcon)
 that uses Gtk2::TrayIcon to display my working status (powered by
 App::TimeTracker...)

 Now I'm getting FAIL reports like this:
 http://www.cpantesters.org/cpan/report/0c00fda4-cde2-11e0-bbec-9aeec8b7ec30

 [ERROR] [Wed Aug 24 00:45:54 2011] MAKE TEST failed:
 Gtk-WARNING **: cannot open display:  at
 /usr/home/cpan/pit/thr/conf/perl-5.10.1/.cpanplus/5.10.1/build/Gtk2-1.224/blib/lib/Gtk2.pm
 line 138.

 Is there an easy and/or unified way to skip tests if there is no
 display?
 Are there ways to mock a display?

 Thanks for any tips,
 domm


 --
 #!/usr/bin/perl                              http://domm.plix.at
 for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}



Re: Skip GTK tests if no display available?

2011-08-25 Thread Torsten Schoenfeld

On 25.08.2011 08:51, Thomas Klausner wrote:

I recently uploaded a small dist to CPAN (App-TimeTracker-Gtk2TrayIcon)
that uses Gtk2::TrayIcon to display my working status (powered by
App::TimeTracker...)


You can use Gtk2::TestHelper to handle this automatically: 
https://metacpan.org/module/Gtk2::TestHelper.


Re: Skip GTK tests if no display available?

2011-08-25 Thread Thomas Klausner
Hi!

On Thu, Aug 25, 2011 at 11:32:59AM +0200, Torsten Schoenfeld wrote:
 On 25.08.2011 08:51, Thomas Klausner wrote:
 
 You can use Gtk2::TestHelper to handle this automatically:
 https://metacpan.org/module/Gtk2::TestHelper.

Hm, this means I'd have to go back to calculation the plan by hand - no 
more done_testing() :-(

Or I just rip out the relevant part, which seem to be
Gtk2-init_check

anyway, thanks for the hint.

-- 
#!/usr/bin/perl  http://domm.plix.at
for(ref bless{},just'another'perl'hacker){s-:+-$-gprint$_.$/}


Re: Skip GTK tests if no display available?

2011-08-25 Thread Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯
 Now I'm getting FAIL reports like this:
http://lists.perl.org/list/cpan-testers-discuss.html is relevant.

 Are there ways to mock a display?
http://p3rl.org/Test::NeedsDisplay
http://wiki.cpantesters.org/wiki/CPANAuthorNotes


signature.asc
Description: This is a digitally signed message part.