Changeset 2028 for pjproject/trunk/pjsip-apps/src/test-pjsua/run.py
- Timestamp:
- Jun 16, 2008 1:04:44 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/test-pjsua/run.py
r2025 r2028 1 # $Id :$1 # $Id$ 2 2 import sys 3 3 import imp 4 4 import re 5 import os 5 6 import subprocess 7 import random 6 8 import time 7 9 8 10 import inc_const as const 9 11 10 # Defaults 11 G_EXE="..\\..\\bin\\pjsua_vc6d.exe" 12 # Get the pjsua executable name 13 if sys.platform.find("win32")!=-1: 14 e = "../../bin/pjsua_vc6d.exe" 15 st1 = os.stat(e) 16 if st1 != None: 17 G_EXE = e 18 e = "../../bin/pjsua_vc6d.exe" 19 st2 = os.stat(e) 20 if st2 != None and st2.st_mtime > st1.st_mtime: 21 G_EXE = e 22 st1 = st2 23 if G_EXE=="": 24 print "Unable to find valid pjsua. Please build pjsip first" 25 sys.exit(1) 26 G_INUNIX = False 27 else: 28 f = open("../../../build.mak", "r") 29 while True: 30 line = f.readline() 31 if not line: 32 break 33 if line.find("TARGET_NAME")!=-1: 34 print line 35 G_EXE="../../bin/pjsua-" + line.split(":= ")[1] 36 break 37 if G_EXE=="": 38 print "Unable to find ../../../build.mak. Please build pjsip first" 39 sys.exit(1) 40 G_INUNIX = True 41 42 43 G_EXE = G_EXE.rstrip("\n\r \t") 12 44 13 45 ################################### … … 36 68 fullcmd = G_EXE + " " + inst_param.arg + " --stdout-refresh=5 --stdout-refresh-text=" + const.STDOUT_REFRESH 37 69 self.trace("Popen " + fullcmd) 38 self.proc = subprocess.Popen(fullcmd, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)70 self.proc = subprocess.Popen(fullcmd, shell=G_INUNIX, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True) 39 71 def send(self, cmd): 40 72 self.trace("send " + cmd) … … 109 141 script = imp.load_source("script", sys.argv[1]) 110 142 143 # Init random seed 144 random.seed() 145 111 146 # Validate 112 147 if script.test == None: … … 120 155 # Instantiate pjsuas 121 156 print "====== Running " + script.test.title + " ======" 157 print "Using " + G_EXE + " as pjsua executable" 158 122 159 for inst_param in script.test.inst_params: 123 160 try:
Note: See TracChangeset
for help on using the changeset viewer.