Skip to content

Commit

Permalink
Add assert_screen_change
Browse files Browse the repository at this point in the history
Variant of wait_screen_change but dying on no screen change.
  • Loading branch information
okurz committed Jan 6, 2017
1 parent 26171f4 commit c082982
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion testapi.pm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ our @EXPORT = qw($realname $username $password $serialdev %cmd %vars
upload_asset upload_image data_url assert_shutdown parse_junit_log
upload_logs
wait_idle wait_screen_change wait_still_screen wait_serial record_soft_failure
wait_idle wait_screen_change assert_screen_change wait_still_screen wait_serial
record_soft_failure
become_root x11_start_program ensure_installed eject_cd power
save_memory_dump save_storage_drives freeze_vm
Expand Down Expand Up @@ -396,6 +397,19 @@ sub wait_screen_change(&@) {
return 0;
}

=head2 assert_screen_change
assert_screen_change { CODEREF [,$timeout] };
Run C<CODEREF> with C<wait_screen_change> but C<die> if screen did not change within timeout.
=cut

sub assert_screen_change(&@) {
::wait_screen_change(@_) or die 'assert_screen_change failed to detect a screen change';
}


=head2 wait_still_screen
=for stopwords stilltime
Expand Down

0 comments on commit c082982

Please sign in to comment.