diff options
-rw-r--r-- | tests/cdash/README.TXT | 9 | ||||
-rw-r--r-- | tests/cdash/builder.py | 28 | ||||
-rw-r--r-- | tests/cdash/cfg_gnu.py | 7 | ||||
-rw-r--r-- | tests/cdash/cfg_msvc.py | 5 | ||||
-rw-r--r-- | tests/cdash/cfg_site_sample.py | 6 | ||||
-rw-r--r-- | tests/cdash/cfg_symbian.py | 2 | ||||
-rw-r--r-- | tests/cdash/starttest_sample.bat | 44 | ||||
-rw-r--r-- | tests/pjsua/run.py | 19 |
8 files changed, 102 insertions, 18 deletions
diff --git a/tests/cdash/README.TXT b/tests/cdash/README.TXT index 0d09965a..69728b73 100644 --- a/tests/cdash/README.TXT +++ b/tests/cdash/README.TXT @@ -43,8 +43,17 @@ site and save them as different files. $ python main.py cfg_msvc + To execute tests for Symbian target: + + $ python main.py cfg_symbian + If you have a different site configuration file, you may specify it in the arguments, e.g.: $ python main.py cfg_gnu my_site_config + + For more information you can also pass "-h" or "--help", e.g.: + + $ python main.py cfg_gnu --help + diff --git a/tests/cdash/builder.py b/tests/cdash/builder.py index 3f5ea9b2..98e81e6c 100644 --- a/tests/cdash/builder.py +++ b/tests/cdash/builder.py @@ -82,16 +82,6 @@ std_test_ops= [ ] # -# These are operations to build the software on GNU/Posix systems -# -gnu_build_ops = [ - Operation(Operation.CONFIGURE, "sh ./configure"), - Operation(Operation.BUILD, "sh -c 'make distclean && make dep && make && cd pjsip-apps/src/python && python setup.py clean build'"), - #Operation(Operation.BUILD, "python setup.py clean build", - # wdir="pjsip-apps/src/python") -] - -# # These are pjsua Python based unit test operations # def build_pjsua_test_ops(pjsua_exe=""): @@ -236,6 +226,7 @@ class TestBuilder: if len(self.ccdash_args)==0: self.build_tests() self.pre_action() + mandatory_op = ["update", "configure", "build"] counter = 0 for a in self.ccdash_args: # Check if this test is in exclusion list @@ -261,7 +252,10 @@ class TestBuilder: b.extend(a) a = b #print a - ccdash.main(a) + rc = ccdash.main(a) + if rc!=0 and a[1] in mandatory_op: + print "Stopping because of error.." + break counter = counter + 1 self.post_action() @@ -315,7 +309,17 @@ class GNUTestBuilder(TestBuilder): build_name = build_name + "-" + self.build_config_name cmds = [] cmds.extend(update_ops) - cmds.extend(gnu_build_ops) + cmds.append(Operation(Operation.CONFIGURE, "sh ./configure")) + if sys.platform == "win32": + # Don't build python module on Mingw + cmds.append(Operation(Operation.BUILD, + "sh -c 'make distclean && make dep && make'")) + else: + cmds.append(Operation(Operation.BUILD, + "sh -c 'make distclean && make dep && make" + \ + " && cd pjsip-apps/src/python && " + \ + "python setup.py clean build'")) + cmds.extend(std_test_ops) cmds.extend(build_pjsua_test_ops()) self.ccdash_args = [] diff --git a/tests/cdash/cfg_gnu.py b/tests/cdash/cfg_gnu.py index 4a1362b6..8411b654 100644 --- a/tests/cdash/cfg_gnu.py +++ b/tests/cdash/cfg_gnu.py @@ -59,10 +59,13 @@ Arguments: cfg_site.GROUP, \ cfg_site.OPTIONS) + config_site = "#define PJ_TODO(x)\n" + cfg_site.CONFIG_SITE + user_mak = "export CFLAGS+=-Wall\n" + cfg_site.USER_MAK + builders = [ builder.GNUTestBuilder(test_cfg, build_config_name="default", - user_mak="export CFLAGS+=-Wall\n", - config_site="#define PJ_TODO(x)\n", + user_mak=user_mak, + config_site=config_site, exclude=cfg_site.EXCLUDE, not_exclude=cfg_site.NOT_EXCLUDE) ] diff --git a/tests/cdash/cfg_msvc.py b/tests/cdash/cfg_msvc.py index af0b6ecb..26b07855 100644 --- a/tests/cdash/cfg_msvc.py +++ b/tests/cdash/cfg_msvc.py @@ -66,11 +66,14 @@ Arguments: cfg_site.GROUP, \ cfg_site.OPTIONS) + config_site = "#define PJ_TODO(x)\n" + cfg_site.CONFIG_SITE + user_mak = cfg_site.USER_MAK + builders = [ builder.MSVCTestBuilder(test_cfg, target=target, build_config_name="default", - config_site="#define PJ_TODO(x)\n", + config_site=config_site, exclude=cfg_site.EXCLUDE, not_exclude=cfg_site.NOT_EXCLUDE) ] diff --git a/tests/cdash/cfg_site_sample.py b/tests/cdash/cfg_site_sample.py index a73cf859..b0596427 100644 --- a/tests/cdash/cfg_site_sample.py +++ b/tests/cdash/cfg_site_sample.py @@ -35,6 +35,12 @@ BASE_DIR = "/root/project/pjproject" #OPTIONS = ["-o", "out.xml", "-y"] OPTIONS = [] +# What's the content of config_site.h +CONFIG_SITE = "" + +# What's the content of user.mak +USER_MAK = "" + # List of regular expression of test patterns to be excluded EXCLUDE = [] diff --git a/tests/cdash/cfg_symbian.py b/tests/cdash/cfg_symbian.py index e4d135dd..94f5f3f6 100644 --- a/tests/cdash/cfg_symbian.py +++ b/tests/cdash/cfg_symbian.py @@ -71,6 +71,8 @@ Arguments: """ + config_Site = config_site1 + cfg_site.CONFIG_SITE + builders = [ builder.SymbianTestBuilder(test_cfg, target=target, diff --git a/tests/cdash/starttest_sample.bat b/tests/cdash/starttest_sample.bat new file mode 100644 index 00000000..752e38db --- /dev/null +++ b/tests/cdash/starttest_sample.bat @@ -0,0 +1,44 @@ +@echo off
+
+rem ***
+rem ************** VS 2005 **************
+rem ***
+set OLD_PATH=%PATH%
+set OLD_INCLUDE=%INCLUDE%
+set OLD_LIB=%LIB%
+set OLD_LIBPATH=%LIBPATH%
+
+call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat" x86
+python main.py cfg_msvc -t "Debug|Win32"
+python main.py cfg_msvc -t "Release|Win32"
+
+set PATH=%OLD_PATH%
+set INCLUDE=%OLD_INCLUDE%
+set LIB=%OLD_LIB%
+set LIBPATH=%OLD_LIBPATH%
+
+
+rem ***
+rem ************** S60 3rd FP1 **************
+rem ***
+set EPOCROOT=\symbian\9.2\S60_3rd_FP1\
+devices -setdefault @S60_3rd_FP1:com.nokia.s60
+python main.py cfg_symbian -t "winscw udeb"
+python main.py cfg_symbian -t "gcce udeb"
+python main.py cfg_symbian -t "gcce urel"
+
+
+rem ***
+rem ************** Mingw **************
+rem ***
+set MSYSTEM=MINGW32
+set DISPLAY=
+C:\msys\1.0\bin\sh -c "python main.py cfg_gnu"
+
+
+rem ***
+rem ************** Linux **************
+rem ***
+set PATH=%PATH%;c:\msys\1.0\bin
+set HOME=C:\msys\1.0\home\Administrator
+C:\mingw\bin\ssh test@192.168.0.12 "cd project/pjproject/tests/cdash && python main.py cfg_gnu"
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) |