Browse Source

new `test_suite_pexpect_timeout` cfg var

The MMGen Project 3 months ago
parent
commit
0e2340e2bc
2 changed files with 6 additions and 1 deletions
  1. 2 0
      mmgen/cfg.py
  2. 4 1
      test/cmdtest_d/include/pexpect.py

+ 2 - 0
mmgen/cfg.py

@@ -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',

+ 4 - 1
test/cmdtest_d/include/pexpect.py

@@ -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: