testprocess: Restart process when it quits.
This commit is contained in:
parent
f858af666f
commit
e6ee0c08cf
@ -30,6 +30,13 @@ class InvalidLine(Exception):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ProcessExited(Exception):
|
||||||
|
|
||||||
|
"""Raised when the child process did exit."""
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Process(QObject):
|
class Process(QObject):
|
||||||
|
|
||||||
"""Abstraction over a running test subprocess process.
|
"""Abstraction over a running test subprocess process.
|
||||||
@ -115,6 +122,10 @@ class Process(QObject):
|
|||||||
unexpected output lines earlier.
|
unexpected output lines earlier.
|
||||||
"""
|
"""
|
||||||
self._data.clear()
|
self._data.clear()
|
||||||
|
if self.proc.state() != QProcess.Running:
|
||||||
|
print("Restarting process...")
|
||||||
|
self.start()
|
||||||
|
raise ProcessExited
|
||||||
if self._invalid:
|
if self._invalid:
|
||||||
raise InvalidLine
|
raise InvalidLine
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user