Subject: | t/02acnv.t fails without DISPLAY |
Test log:
...
Test 2 got: "couldn't connect to display \":0\" at /opt/perl-5.26.0/lib/site_perl/5.26.0/x86_64-linux/Tk/MainWindow.pm line 53.\nTk::MainWindow->new() at t/02acnv.t line 9.\n" (t/02acnv.t at line 10)
# Expected: "" (Can't create MainWindow)
# t/02acnv.t line 10 is: ok($@, '', "Can't create MainWindow");
# Test 3 got: "" (t/02acnv.t at line 11)
# Expected: "1" (MainWindow creation failed)
# t/02acnv.t line 11 is: ok(Tk::Exists($mwin), 1, "MainWindow creation failed");
# Test 5 got: "Can't call method \"AbstractCanvas\" on an undefined value at t/02acnv.t line 20.\n" (t/02acnv.t at line 21)
# Expected: "" (can't create AbstractCanvas widget)
# t/02acnv.t line 21 is: ok($@, '', "can't create $clas widget");
t/02acnv.t ..
Failed 3/15 subtests
(less 10 skipped subtests: 2 okay)
...
My suggestion: skip this test script if the MainWindow cannot be created. In my Tk test scripts I do something like:
use Test::More; # no plan!
use Tk;
my $mw = eval { tkinit };
if (!$mw) {
plan skip_all => 'Cannot create MainWindow';
} else {
plan 'no_plan'; # or plan tests => ...
}