1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-27 23:41:18 +01:00

Merge pull request #12891 from aabadie/pr/boards/hifive1b_fix_autotest

tools/testrunner: make interactive test sync retries/delay configurable
This commit is contained in:
Francisco 2019-12-13 13:27:27 +01:00 committed by GitHub
commit e8a5eb8dde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -24,6 +24,10 @@ RIOTBASE = (os.environ.get('RIOTBASE') or
# default value (3)
MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3)
# Allow customizing test interactive settings with environment variables
TEST_INTERACTIVE_RETRIES = int(os.environ.get('TEST_INTERACTIVE_RETRIES') or 5)
TEST_INTERACTIVE_DELAY = int(os.environ.get('TEST_INTERACTIVE_DELAY') or 1)
def list_until(l, cond):
return l[:([i for i, e in enumerate(l) if cond(e)][0])]
@ -79,8 +83,10 @@ def sync_child(child):
_test_utils_interactive_sync(child, modules)
def _test_utils_interactive_sync(child, modules, retries=5, delay=1):
def _test_utils_interactive_sync(child, modules):
if 'test_utils_interactive_sync' not in modules:
return
utils.test_utils_interactive_sync(child, retries=retries, delay=delay)
utils.test_utils_interactive_sync(child,
TEST_INTERACTIVE_RETRIES,
TEST_INTERACTIVE_DELAY)

View File

@ -9,7 +9,7 @@
import pexpect
def test_utils_interactive_sync(child, retries=5, delay=1):
def test_utils_interactive_sync(child, retries, delay):
"""Synchronisation for 'test_utils_interactive_sync' function.
Interacts through input to wait for node being ready.