Browse Source

MMGenPexpect: add `exit_val` attr

The MMGen Project 1 year ago
parent
commit
7f0af76b48
1 changed files with 2 additions and 1 deletions
  1. 2 1
      test/include/pexpect.py

+ 2 - 1
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