From 27fb3d3cd5103ea814d6c62f802aef9f1292ddc6 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 27 Aug 2010 13:27:55 +0000 Subject: More on automated tests (re ticket:1111): work on Visual Studio target, and added ability to disable tests in configure.py git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3300 74dad513-b988-da41-8d7b-12977e46ad98 --- tests/automated/configure.py | 35 +++++++++++++++++++++++++++-------- tests/automated/gnu-ipp.xml.template | 10 +++++----- tests/automated/gnu.xml.template | 10 +++++----- tests/automated/msvc.xml.template | 11 ++++++----- tests/automated/prepare.xml.template | 8 ++++++++ tests/automated/testvars.template | 9 +++++++++ 6 files changed, 60 insertions(+), 23 deletions(-) diff --git a/tests/automated/configure.py b/tests/automated/configure.py index fe5cabc0..d277471b 100755 --- a/tests/automated/configure.py +++ b/tests/automated/configure.py @@ -12,6 +12,8 @@ PYTHON = os.path.basename(sys.executable) build_type = "" vs_target = "" s60_target = "" +no_test = False +no_pjsua_test = False # # Get gcc version @@ -123,7 +125,7 @@ class S60SDK: def replace_vars(text): - global vs_target, s60_target, build_type + global vs_target, s60_target, build_type, no_test, no_pjsua_test suffix = "" os_info = platform.system() + platform.release() + "-" + platform.machine() @@ -172,12 +174,15 @@ def replace_vars(text): while True: if text.find("$(PJSUA-TESTS)") >= 0: - # Determine pjsua exe to use - exe = "../../pjsip-apps/bin/pjsua-" + suffix - proc = subprocess.Popen(PYTHON + " runall.py --list-xml -e " + exe, - cwd="../pjsua", - shell=True, stdout=subprocess.PIPE) - content = proc.stdout.read() + if no_test==False and no_pjsua_test==False: + # Determine pjsua exe to use + exe = "../../pjsip-apps/bin/pjsua-" + suffix + proc = subprocess.Popen(PYTHON + " runall.py --list-xml -e " + exe, + cwd="../pjsua", + shell=True, stdout=subprocess.PIPE) + content = proc.stdout.read() + else: + content = "" text = text.replace("$(PJSUA-TESTS)", content) elif text.find("$(GCC)") >= 0: text = text.replace("$(GCC)", gcc_version("gcc")) @@ -227,13 +232,19 @@ def replace_vars(text): else: cmd = "echo Success" text = text.replace("$(NOP)", cmd) + elif text.find("$(NOTEST)") >= 0: + if no_test: + str = '"1"' + else: + str = '"0"' + text = text.replace("$(NOTEST)", str) else: break return text def main(args): - global vs_target, s60_target, build_type + global vs_target, s60_target, build_type, no_test, no_pjsua_test output = sys.stdout usage = """Usage: configure.py [OPTIONS] scenario_template_file @@ -255,6 +266,8 @@ Where OPTIONS: names: - "gcce udeb" - "gcce urel" + -notest Disable all tests in the scenario. + -nopjsuatest Disable pjsua tests in the scenario. """ args.pop(0) @@ -294,6 +307,12 @@ Where OPTIONS: if not ["vs", "gnu", "s60"].count(build_type): sys.stderr.write("Error: invalid -t argument value\n") sys.exit(1) + elif args[0]=='-notest' or args[0]=='-notests': + args.pop(0) + no_test = True + elif args[0]=='-nopjsuatest' or args[0]=='-nopjsuatests': + args.pop(0) + no_pjsua_test = True else: break diff --git a/tests/automated/gnu-ipp.xml.template b/tests/automated/gnu-ipp.xml.template index 96078c89..f6daf517 100644 --- a/tests/automated/gnu-ipp.xml.template +++ b/tests/automated/gnu-ipp.xml.template @@ -18,11 +18,11 @@ export CFLAGS += -Wno-unused-label -g - - - - - + + + + + $(PJSUA-TESTS) diff --git a/tests/automated/gnu.xml.template b/tests/automated/gnu.xml.template index e488cc85..d453f44b 100644 --- a/tests/automated/gnu.xml.template +++ b/tests/automated/gnu.xml.template @@ -18,11 +18,11 @@ export CFLAGS += -Wno-unused-label -g - - - - - + + + + + $(PJSUA-TESTS) diff --git a/tests/automated/msvc.xml.template b/tests/automated/msvc.xml.template index bd134c02..d4dc8ffd 100644 --- a/tests/automated/msvc.xml.template +++ b/tests/automated/msvc.xml.template @@ -8,15 +8,16 @@ /* Written by ccdash */ #define PJ_HAS_IPV6 1 #define PJMEDIA_HAS_G7221_CODEC 1 +#define PJ_TODO(x) ]]> - - - - - + + + + + $(PJSUA-TESTS) diff --git a/tests/automated/prepare.xml.template b/tests/automated/prepare.xml.template index c1f650b9..cadfb342 100644 --- a/tests/automated/prepare.xml.template +++ b/tests/automated/prepare.xml.template @@ -27,6 +27,14 @@ --> + + +