diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-01 15:09:01 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-01 15:09:01 -0700 |
commit | 2a4599a92a570a461a60b1eb79df03908a047711 (patch) | |
tree | 4189e802957bea79c8a38bc0ce901afcfe7cf57e | |
parent | 574eb96053c62d5ad809e36b9bfcc66860331eb2 (diff) |
make WebsockHarness parametrizable
-rwxr-xr-x | tests/runner.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/runner.py b/tests/runner.py index eab327cc..80926468 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8663,11 +8663,14 @@ elif 'browser' in str(sys.argv): self.btest('pre_run_deps.cpp', expected='10', args=['--pre-js', 'pre.js']) class WebsockHarness: + def __init__(self, port): + self.port = port + def __enter__(self): self.pids = [] def server_func(q): - proc = Popen([path_from_root('tests', 'socket_server.sh'), '8990']) + proc = Popen([path_from_root('tests', 'socket_server.sh'), str(self.port)]) q.put(proc.pid) proc.communicate() @@ -8683,7 +8686,7 @@ elif 'browser' in str(sys.argv): print '[Socket server on processes %s]' % str(self.pids[-2:]) def websockify_func(q): - proc = Popen([path_from_root('third_party', 'websockify', 'other', 'websockify'), '-vvv', '8991', '127.0.0.1:8990']) + proc = Popen([path_from_root('third_party', 'websockify', 'other', 'websockify'), '-vvv', str(self.port+1), '127.0.0.1:' + str(self.port)]) q.put(proc.pid) proc.communicate() @@ -8705,7 +8708,7 @@ elif 'browser' in str(sys.argv): print '[%d should be cleaned up automatically]' % pid def test_zz_websockets(self): # always run this test last - with self.WebsockHarness(): + with self.WebsockHarness(8990): self.btest('websockets.c', expected='571') #def test_websockets_bi(self): |