new test_suite_pexpect_timeout cfg var

This commit is contained in:
The MMGen Project 2025-09-09 11:27:05 +00:00
commit 0e2340e2bc
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 6 additions and 1 deletions

View file

@ -256,6 +256,7 @@ class Config(Lockable):
test_suite_cfgtest = False
test_suite_deterministic = False
test_suite_pexpect = False
test_suite_pexpect_timeout = 0
test_suite_popen_spawn = False
test_suite_root_pfx = ''
hold_protect_disable = False
@ -339,6 +340,7 @@ class Config(Lockable):
'MMGEN_TEST_SUITE_DETERMINISTIC',
'MMGEN_TEST_SUITE_ENABLE_COLOR',
'MMGEN_TEST_SUITE_PEXPECT',
'MMGEN_TEST_SUITE_PEXPECT_TIMEOUT',
'MMGEN_TEST_SUITE_POPEN_SPAWN',
'MMGEN_TEST_SUITE_ROOT_PFX',
'MMGEN_TRACEBACK',

View file

@ -64,7 +64,10 @@ class CmdTestPexpect:
redir = DEVNULL if (no_output or not cfg.exact_output) else None
self.ep = Popen([args[0]] + args[1:], stderr=redir, env=spawn_env)
else:
timeout = int(timeout or cfg.pexpect_timeout or 0) or (60, 5)[bool(cfg.debug_pexpect)]
timeout = int(
timeout
or cfg.pexpect_timeout
or cfg.test_suite_pexpect_timeout) or (60, 5)[bool(cfg.debug_pexpect)]
if pexpect_spawn:
self.p = pexpect.spawn(args[0], args[1:], encoding='utf8', timeout=timeout, env=spawn_env)
else: