From 7f0af76b48885a9908ce3b7bd6d479610e5a8363 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sun, 10 Mar 2024 14:43:33 +0000 Subject: [PATCH] MMGenPexpect: add `exit_val` attr --- test/include/pexpect.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/include/pexpect.py b/test/include/pexpect.py index 773732aa..d31b38cf 100755 --- a/test/include/pexpect.py +++ b/test/include/pexpect.py @@ -54,6 +54,7 @@ class MMGenPexpect: self.skip_ok = False self.sent_value = None self.spawn_env = spawn_env + self.exit_val = None if direct_exec or cfg.direct_exec: from subprocess import Popen,DEVNULL @@ -95,7 +96,7 @@ class MMGenPexpect: self.p.sendeof() self.p.read() ret = self.p.wait() - if ret != (exit_val or 0) and not cfg.coverage: + if ret != (self.exit_val or exit_val or 0) and not cfg.coverage: die( 'TestSuiteSpawnedScriptException', f'Spawned script exited with value {ret}' ) if cfg.profile: return