From 58f6df24cd02165bc0f2c9a7203f2e929bcb20cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= <gaetan.harter@fu-berlin.de> Date: Thu, 16 Nov 2017 11:54:08 +0100 Subject: [PATCH] dist/tools/testrunner: Make started wait time configurable The wait before board is started is 3 by default but can be overwritten by setting 'TESTRUNNER_START_WAIT' environment variable. --- dist/tools/testrunner/testrunner.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dist/tools/testrunner/testrunner.py b/dist/tools/testrunner/testrunner.py index 40f0f56520..8828aad82c 100755 --- a/dist/tools/testrunner/testrunner.py +++ b/dist/tools/testrunner/testrunner.py @@ -19,6 +19,11 @@ PEXPECT_PATH = os.path.dirname(pexpect.__file__) RIOTBASE = os.environ['RIOTBASE'] or \ os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) +# Setting an empty 'TESTRUNNER_START_DELAY' environment variable use the +# default value (3) +MAKE_TERM_STARTED_DELAY = int(os.environ.get('TESTRUNNER_START_DELAY') or 3) + + def list_until(l, cond): return l[:([i for i, e in enumerate(l) if cond(e)][0])] @@ -33,7 +38,7 @@ def run(testfunc, timeout=10, echo=True, traceback=False): child = pexpect.spawnu("make term", env=env, timeout=timeout) # on many platforms, the termprog needs a short while to be ready... - time.sleep(3) + time.sleep(MAKE_TERM_STARTED_DELAY) if echo: child.logfile = sys.stdout -- GitLab