From 002b7e2293c93a5aec97e75be7e3976a987e1415 Mon Sep 17 00:00:00 2001 From: Oliver Kurz Date: Thu, 24 May 2018 15:54:47 +0200 Subject: [PATCH] testapi: Adapt check_screen timeout default to proposal in documentation The doc string of the method check_screen already suggested to use a timeout of 0 seconds for a long time. This change adjusts the timeout to a default of 0 seconds. This can be considered a breaking change :) --- isotovideo | 2 +- t/03-testapi.t | 2 +- testapi.pm | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/isotovideo b/isotovideo index 94b7a3538fb..fb215ccaa92 100755 --- a/isotovideo +++ b/isotovideo @@ -63,7 +63,7 @@ BEGIN { # this shall be an integer increased by every change of the API # either to the worker or the tests -our $INTERFACE = 11; +our $INTERFACE = 12; use bmwqemu; use needle; diff --git a/t/03-testapi.t b/t/03-testapi.t index bdb3564eb0f..149f74ada32 100755 --- a/t/03-testapi.t +++ b/t/03-testapi.t @@ -196,7 +196,7 @@ subtest 'check_assert_screen' => sub { stderr_like { assert_screen('foo', 3, timeout => 2) } qr/timeout=2/, 'named over positional'; stderr_like { assert_screen('foo') } qr/timeout=30/, 'default timeout'; stderr_like { assert_screen('foo', no_wait => 1) } qr/no_wait=1/, 'no wait option'; - stderr_like { check_screen('foo') } qr/timeout=30/, 'check_screen with same default timeout'; + stderr_like { check_screen('foo') } qr/timeout=0/, 'check_screen with timeout of 0'; stderr_like { check_screen('foo', 42) } qr/timeout=42/, 'check_screen with timeout variable'; }; diff --git a/testapi.pm b/testapi.pm index 5a542e1af21..e0699cd491b 100755 --- a/testapi.pm +++ b/testapi.pm @@ -363,7 +363,7 @@ can be replaced by C with multiple tags using an C in combination with C or another synchronization call in before, for example C or C. -Returns matched needle or C if timeout is hit. Default timeout is 30s. +Returns matched needle or C if timeout is hit. Default timeout is 0s. =cut @@ -371,7 +371,7 @@ sub check_screen { my ($mustmatch) = shift; my $timeout; $timeout = shift if (@_ % 2); - my %args = (timeout => $timeout // $bmwqemu::default_timeout, @_); + my %args = (timeout => $timeout // 0, @_); bmwqemu::log_call(mustmatch => $mustmatch, %args); return _check_or_assert($mustmatch, 1, %args); }