summaryrefslogtreecommitdiff
path: root/tests/pjsua
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-01-02 18:15:07 +0000
committerBenny Prijono <bennylp@teluu.com>2009-01-02 18:15:07 +0000
commit05b6736a9a0d834194be217cafeeeab0dd73af67 (patch)
tree911e81052a95b49e837d05aaeef9b64a3a3a8b0b /tests/pjsua
parentdc16477c2763188a1a94dcf13fb988d0713935af (diff)
Test refinements for mingw etc.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2410 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests/pjsua')
-rw-r--r--tests/pjsua/run.py19
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/pjsua/run.py b/tests/pjsua/run.py
index c4dfcfc9..2a6cb9e1 100644
--- a/tests/pjsua/run.py
+++ b/tests/pjsua/run.py
@@ -161,7 +161,8 @@ class Expect:
def wait(self):
self.trace("wait")
- self.proc.wait()
+ self.proc.communicate("q")
+
def trace(self, s):
if self.trace_enabled:
now = time.time()
@@ -177,8 +178,20 @@ def handle_error(errmsg, t, close_processes = True):
for p in t.process:
p.send("q")
p.send("q")
- p.expect(const.DESTROYED, False)
- p.wait()
+ is_err = False
+ try:
+ ret = p.expect(const.DESTROYED, False)
+ if not ret:
+ is_err = True
+ except:
+ is_err = True
+ if is_err:
+ if sys.hexversion >= 0x02060000:
+ p.proc.terminate()
+ else:
+ p.wait()
+ else:
+ p.wait()
print "Test completed with error: " + errmsg
sys.exit(1)