Skip to content

Commit

Permalink
nixos tests: waitForText: output the detected screen content prior to…
Browse files Browse the repository at this point in the history
… the last attempt

    machine: Last chance to match /(?^:BALICE)/ on the screen, which currently contains:
    machine: performing optical character recognition
    machine: sending monitor command: screendump /tmp/nix-build-vm-test-run-sddm.drv-0/ocrin.ppm
    machine: Session Layout

    O O

    0 1 : 0 9

    Wednesday, June 21, 2017

    |_ I

    Select your user and enter password
  • Loading branch information
grahamc committed Jun 21, 2017
1 parent 348785e commit 1b83301
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nixos/lib/test-driver/Machine.pm
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ sub waitForText {
my ($self, $regexp) = @_;
$self->nest("waiting for $regexp to appear on the screen", sub {
retry sub {
my ($retries_remaining) = @_;
if ($retries_remaining == 0) {
$self->log("Last chance to match /$regexp/ on the screen, which currently contains:");
$self->log($self->getScreenText);
}

return 1 if $self->getScreenText =~ /$regexp/;
}
});
Expand Down

0 comments on commit 1b83301

Please sign in to comment.