summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2008-06-28 00:52:20 +0000
committerNanang Izzuddin <nanang@teluu.com>2008-06-28 00:52:20 +0000
commit964bf0de6b9211c1649f20c616900fcdf091541a (patch)
tree7ee645ec88a87146f5d88f50a7058b9e98fd4398
parentfd388102b9da31869793eb1741a68a73cd2b3c40 (diff)
Updated PESQ test to save the WAV output on failure and report the PESQ target.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2088 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip-apps/src/test-pjsua/mod_pesq.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/pjsip-apps/src/test-pjsua/mod_pesq.py b/pjsip-apps/src/test-pjsua/mod_pesq.py
index de92eb12..109674ef 100644
--- a/pjsip-apps/src/test-pjsua/mod_pesq.py
+++ b/pjsip-apps/src/test-pjsua/mod_pesq.py
@@ -16,6 +16,7 @@ import sys
import re
import subprocess
import wave
+import shutil
import inc_const as const
from inc_cfg import *
@@ -137,10 +138,21 @@ def post_func(t):
# Evaluate the PESQ MOS value
pesq_res = mo_pesq_out.group(1)
if (float(pesq_res) >= threshold):
- endpt.trace("Success, PESQ result = " + pesq_res)
+ endpt.trace("Success, PESQ result = " + pesq_res + " (target=" + str(threshold) + ").")
else:
- endpt.trace("Failed, PESQ result = " + pesq_res)
- raise TestError("WAV seems to be degraded badly")
+ endpt.trace("Failed, PESQ result = " + pesq_res + " (target=" + str(threshold) + ").")
+ # Save the wav file
+ wavoutname = ARGS[1]
+ wavoutname = re.sub("[\\\/]", "_", wavoutname)
+ wavoutname = re.sub("\.py$", ".wav", wavoutname)
+ wavoutname = "logs/" + wavoutname
+ try:
+ shutil.copyfile(output_filename, wavoutname)
+ print "Output WAV is copied to " + wavoutname
+ except:
+ print "Couldn't copy output WAV, please check if 'logs' directory exists."
+
+ raise TestError("WAV seems to be degraded badly, PESQ = "+ pesq_res + " (target=" + str(threshold) + ").")
# Here where it all comes together