Misc (#915): several fixes on the python unit tests on Linux:
- added Makefile for cmp_wav and modified the test script - test 999: MESSAGE without body is now allowed git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2884 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
0c9015781c
commit
28a48221c1
|
@ -20,7 +20,14 @@ from inc_cfg import *
|
|||
cfg_file = imp.load_source("cfg_file", ARGS[1])
|
||||
|
||||
# WAV similarity calculator
|
||||
COMPARE_WAV_EXE = "tools/cmp_wav.exe"
|
||||
COMPARE_WAV_EXE = ""
|
||||
if sys.platform.find("win32")!=-1:
|
||||
COMPARE_WAV_EXE = "tools/cmp_wav.exe"
|
||||
G_INUNIX = False
|
||||
else:
|
||||
COMPARE_WAV_EXE = "tools/cmp_wav"
|
||||
G_INUNIX = True
|
||||
|
||||
|
||||
# Threshold to declare degradation is too high when result is lower than this value
|
||||
COMPARE_THRESHOLD = 2
|
||||
|
@ -78,7 +85,7 @@ def post_func(t):
|
|||
# Check WAV similarity
|
||||
fullcmd = COMPARE_WAV_EXE + " " + input_filename + " " + output_filename + " " + "3000"
|
||||
endpt.trace("Popen " + fullcmd)
|
||||
cmp_proc = subprocess.Popen(fullcmd, stdout=subprocess.PIPE, universal_newlines=True)
|
||||
cmp_proc = subprocess.Popen(fullcmd, shell=G_INUNIX, stdout=subprocess.PIPE, universal_newlines=True)
|
||||
|
||||
# Parse similarity ouput
|
||||
line = cmp_proc.stdout.readline()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import inc_sip as sip
|
||||
import inc_sdp as sdp
|
||||
|
||||
# There's some report that incoming MESSAGE without body will crash pjsua
|
||||
# Incoming MESSAGE without body is now accepted
|
||||
#
|
||||
complete_msg = \
|
||||
"""MESSAGE sip:localhost SIP/2.0
|
||||
|
@ -20,5 +20,5 @@ Content-Length: 50
|
|||
|
||||
|
||||
sendto_cfg = sip.SendtoCfg( "empty MESSAGE", "--null-audio --auto-answer 200",
|
||||
"", 488, complete_msg=complete_msg)
|
||||
"", 200, complete_msg=complete_msg)
|
||||
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
#Modify this to point to the PJSIP location.
|
||||
PJBASE=~/Desktop/project/pjproject
|
||||
|
||||
include $(PJBASE)/build.mak
|
||||
|
||||
CC = $(APP_CC)
|
||||
LDFLAGS = $(APP_LDFLAGS)
|
||||
LDLIBS = $(APP_LDLIBS)
|
||||
CFLAGS = $(APP_CFLAGS)
|
||||
CPPFLAGS= ${CFLAGS}
|
||||
|
||||
# If your application is in a file named myapp.cpp or myapp.c
|
||||
# # this is the line you will need to build the binary.
|
||||
# all: myapp
|
||||
#
|
||||
cmp_wav: cmp_wav.c
|
||||
$(CC) -o $@ $< $(CPPFLAGS) $(LDFLAGS) $(LDLIBS)
|
||||
|
||||
clean:
|
||||
rm -f cmp_wav.o cmp_wav
|
||||
|
Loading…
Reference in New Issue