Subject: | t/Tk-Help.t should check for a connected DISPLAY |
Especially CPAN Testers machines sometimes run headless, without a DISPLAY. This may cause test failures:
...
PERL_DL_NONLAZY=1 "/usr/perl5.26.1t/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
couldn't connect to display ":0" at /usr/perl5.26.1t/lib/site_perl/5.26.1/amd64-freebsd-thread-multi/Tk/MainWindow.pm line 53.
MainWindow->new() at t/Tk-Help.t line 32.
# Looks like your test exited with 61 just after 1.
t/Tk-Help.t ..
Dubious, test returned 61 (wstat 15616, 0x3d00)
Failed 1/2 subtests
...
Best is to check if a DISPLAY is available and otherwise skip the test, e.g. using something similar like this:
use Test::More;
my $mw = eval { MainWindow->new };
plan skip_all => "Cannot create MainWindow: $@" if !$mw;
plan tests => ...