mirror of https://github.com/mgba-emu/mgba.git
Tools: Fix closing a perf server
This commit is contained in:
parent
b1691c9527
commit
9d0865d5d4
|
@ -103,13 +103,16 @@ class PerfServer(object):
|
||||||
self.results.append(next(self.reader))
|
self.results.append(next(self.reader))
|
||||||
self.iterations -= 1
|
self.iterations -= 1
|
||||||
if self.iterations == 0:
|
if self.iterations == 0:
|
||||||
self.socket.send("\n");
|
self.finish()
|
||||||
self.reader = None
|
|
||||||
self.socket.close()
|
|
||||||
time.sleep(5)
|
|
||||||
self.socket = None
|
|
||||||
self.iterations = self.ITERATIONS_PER_INSTANCE
|
self.iterations = self.ITERATIONS_PER_INSTANCE
|
||||||
|
|
||||||
|
def finish(self):
|
||||||
|
self.socket.send("\n");
|
||||||
|
self.reader = None
|
||||||
|
self.socket.close()
|
||||||
|
time.sleep(5)
|
||||||
|
self.socket = None
|
||||||
|
|
||||||
class Suite(object):
|
class Suite(object):
|
||||||
def __init__(self, cwd, wall=None, game=None, renderer='software'):
|
def __init__(self, cwd, wall=None, game=None, renderer='software'):
|
||||||
self.cwd = cwd
|
self.cwd = cwd
|
||||||
|
@ -153,6 +156,7 @@ class Suite(object):
|
||||||
if test.results:
|
if test.results:
|
||||||
results.append(test.results)
|
results.append(test.results)
|
||||||
if self.server:
|
if self.server:
|
||||||
|
self.server.finish()
|
||||||
results.extend(self.server.results)
|
results.extend(self.server.results)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue