Skip to content

Commit

Permalink
Added gcov_flush method to server to allow dumping coverage information
Browse files Browse the repository at this point in the history
  • Loading branch information
hyades committed Sep 1, 2013
1 parent e6971a0 commit 1e00977
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions python-api/gstswitch/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def terminate(self):
except OSError:
raise ServerProcessError("Cannot terminate server process. "
"Try killing it")
return False

def kill(self):
"""Kill the server process by sending signal.SIGKILL
Expand All @@ -253,3 +254,28 @@ def kill(self):
return True
except OSError:
raise ServerProcessError('Cannot kill process')
return False


def gcov_flush(self):
"""Generate gcov coverage by sending the signal SIGUSR1
The generated gcda files are dumped in tools directory.
Does not kill the process
:param: None
:returns: True when success
:raises ServerProcessError: If Server is not running
:raises ServerProcessError: Unable to send signal
"""

if self.proc is None:
raise ServerProcessError('Server process does not exist')
else:
try:
os.kill(self.pid, signal.SIGUSR1)
return True
except OSError:
raise ServerProcessError('Unable to send signal')
return False


0 comments on commit 1e00977

Please sign in to comment.