summary refs log tree commit diff
path: root/nixos/lib
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2017-06-20 21:10:34 -0400
committerGraham Christensen <graham@grahamc.com>2017-06-20 21:10:34 -0400
commit1b833015b72fa6ccf379c46706d1d645cd216f07 (patch)
treec1a6d2ca58ff83ac8881e3e52bebcb8f4a8938ab /nixos/lib
parent348785eec0c499dc4f79943cedcd78be279ca41d (diff)
downloadnixlib-1b833015b72fa6ccf379c46706d1d645cd216f07.tar
nixlib-1b833015b72fa6ccf379c46706d1d645cd216f07.tar.gz
nixlib-1b833015b72fa6ccf379c46706d1d645cd216f07.tar.bz2
nixlib-1b833015b72fa6ccf379c46706d1d645cd216f07.tar.lz
nixlib-1b833015b72fa6ccf379c46706d1d645cd216f07.tar.xz
nixlib-1b833015b72fa6ccf379c46706d1d645cd216f07.tar.zst
nixlib-1b833015b72fa6ccf379c46706d1d645cd216f07.zip
nixos tests: waitForText: output the detected screen content prior to 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
Diffstat (limited to 'nixos/lib')
-rw-r--r--nixos/lib/test-driver/Machine.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/nixos/lib/test-driver/Machine.pm b/nixos/lib/test-driver/Machine.pm
index 973e05542d58..4a68e0cd9dc9 100644
--- a/nixos/lib/test-driver/Machine.pm
+++ b/nixos/lib/test-driver/Machine.pm
@@ -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/;
         }
     });