complete-run: die if X11::XCB couldn’t connect to a display
This commit is contained in:
parent
8349190e09
commit
6a5ca32c5a
|
@ -84,20 +84,16 @@ if (@displays == 0) {
|
||||||
# the X server from exiting (Xdummy will restart it, but not quick enough
|
# the X server from exiting (Xdummy will restart it, but not quick enough
|
||||||
# sometimes)
|
# sometimes)
|
||||||
my @conns;
|
my @conns;
|
||||||
my @wdisplays;
|
|
||||||
for my $display (@displays) {
|
for my $display (@displays) {
|
||||||
my $screen;
|
my $screen;
|
||||||
my $x = X11::XCB->new($display, $screen);
|
my $x = X11::XCB->new($display, $screen);
|
||||||
if ($x->has_error) {
|
if ($x->has_error) {
|
||||||
Log "WARNING: Not using X11 display $display, could not connect";
|
die "Could not connect to display $display\n";
|
||||||
} else {
|
} else {
|
||||||
push @conns, $x;
|
push @conns, $x;
|
||||||
push @wdisplays, $display;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
die "No usable displays found" if @wdisplays == 0;
|
|
||||||
|
|
||||||
# 1: get a list of all testcases
|
# 1: get a list of all testcases
|
||||||
my @testfiles = @ARGV;
|
my @testfiles = @ARGV;
|
||||||
|
|
||||||
|
@ -125,11 +121,11 @@ my $harness = TAP::Harness->new({ });
|
||||||
my $aggregator = TAP::Parser::Aggregator->new();
|
my $aggregator = TAP::Parser::Aggregator->new();
|
||||||
$aggregator->start();
|
$aggregator->start();
|
||||||
|
|
||||||
status_init(displays => \@wdisplays, tests => $num);
|
status_init(displays => \@displays, tests => $num);
|
||||||
|
|
||||||
# We start tests concurrently: For each display, one test gets started. Every
|
# We start tests concurrently: For each display, one test gets started. Every
|
||||||
# test starts another test after completing.
|
# test starts another test after completing.
|
||||||
for (@wdisplays) { $cv->begin; take_job($_) }
|
for (@displays) { $cv->begin; take_job($_) }
|
||||||
|
|
||||||
#
|
#
|
||||||
# Takes a test from the beginning of @testfiles and runs it.
|
# Takes a test from the beginning of @testfiles and runs it.
|
||||||
|
|
Loading…
Reference in New Issue