diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-08-27 13:27:55 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-08-27 13:27:55 +0000 |
commit | 27fb3d3cd5103ea814d6c62f802aef9f1292ddc6 (patch) | |
tree | ba268522b80de4bff08573116d6c0c4e1afc5bff | |
parent | a5c285d7fd046c862ef2ba11cd8bef71786db939 (diff) |
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
-rwxr-xr-x | tests/automated/configure.py | 35 | ||||
-rw-r--r-- | tests/automated/gnu-ipp.xml.template | 10 | ||||
-rw-r--r-- | tests/automated/gnu.xml.template | 10 | ||||
-rw-r--r-- | tests/automated/msvc.xml.template | 11 | ||||
-rw-r--r-- | tests/automated/prepare.xml.template | 8 | ||||
-rw-r--r-- | 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 </FileWrite> <Configure cmd='./aconfigure --enable-ipp --with-ipp="$(IPPROOT)" --with-ipp-samples="$(IPPSAMPLES)" --with-ipp-arch=$(IPPARCH)' /> <Build cmd="make dep && make clean && make" /> - <Test name="pjlib-test" wdir="pjlib/bin" cmd="./pjlib-test-$(SUFFIX)" /> - <Test name="pjlib-util-test" wdir="pjlib-util/bin" cmd="./pjlib-util-test-$(SUFFIX)" /> - <Test name="pjnath-test" wdir="pjnath/bin" cmd="./pjnath-test-$(SUFFIX)" /> - <Test name="pjmedia-test" wdir="pjmedia/bin" cmd="./pjmedia-test-$(SUFFIX)" /> - <Test name="pjsip-test" wdir="pjsip/bin" cmd="./pjsip-test-$(SUFFIX)" /> + <Test name="pjlib-test" wdir="pjlib/bin" cmd="./pjlib-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjlib-util-test" wdir="pjlib-util/bin" cmd="./pjlib-util-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjnath-test" wdir="pjnath/bin" cmd="./pjnath-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjmedia-test" wdir="pjmedia/bin" cmd="./pjmedia-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjsip-test" wdir="pjsip/bin" cmd="./pjsip-test-$(SUFFIX)" disabled=$(NOTEST) /> $(PJSUA-TESTS) </Submit> </Scenario> 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 </FileWrite> <Configure cmd="./aconfigure" /> <Build cmd="make dep && make clean && make" /> - <Test name="pjlib-test" wdir="pjlib/bin" cmd="./pjlib-test-$(SUFFIX)" /> - <Test name="pjlib-util-test" wdir="pjlib-util/bin" cmd="./pjlib-util-test-$(SUFFIX)" /> - <Test name="pjnath-test" wdir="pjnath/bin" cmd="./pjnath-test-$(SUFFIX)" /> - <Test name="pjmedia-test" wdir="pjmedia/bin" cmd="./pjmedia-test-$(SUFFIX)" /> - <Test name="pjsip-test" wdir="pjsip/bin" cmd="./pjsip-test-$(SUFFIX)" /> + <Test name="pjlib-test" wdir="pjlib/bin" cmd="./pjlib-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjlib-util-test" wdir="pjlib-util/bin" cmd="./pjlib-util-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjnath-test" wdir="pjnath/bin" cmd="./pjnath-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjmedia-test" wdir="pjmedia/bin" cmd="./pjmedia-test-$(SUFFIX)" disabled=$(NOTEST) /> + <Test name="pjsip-test" wdir="pjsip/bin" cmd="./pjsip-test-$(SUFFIX)" disabled=$(NOTEST) /> $(PJSUA-TESTS) </Submit> 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) ]]> </FileWrite> <Configure cmd="cmd /c echo success" /> <Build cmd='vcbuild.exe /nologo /nohtmllog /nocolor /rebuild pjproject-vs8.sln "$(VSTARGET)|Win32"' /> - <Test name="pjlib-test" info="" wdir="pjlib/bin" cmd="pjlib-test-i386-Win32-vc8-$(VSTARGET)" /> - <Test name="pjlib-util-test" info="" wdir="pjlib-util/bin" cmd="pjlib-util-test-i386-Win32-vc8-$(VSTARGET)" /> - <Test name="pjnath-test" info="" wdir="pjnath/bin" cmd="pjnath-test-i386-Win32-vc8-$(VSTARGET)" /> - <Test name="pjmedia-test" info="" wdir="pjmedia/bin" cmd="pjmedia-test-i386-Win32-vc8-$(VSTARGET)" /> - <Test name="pjsip-test" info="" wdir="pjsip/bin" cmd="pjsip-test-i386-Win32-vc8-$(VSTARGET)" /> + <Test name="pjlib-test" info="" wdir="pjlib/bin" cmd="pjlib-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST)/> + <Test name="pjlib-util-test" info="" wdir="pjlib-util/bin" cmd="pjlib-util-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) /> + <Test name="pjnath-test" info="" wdir="pjnath/bin" cmd="pjnath-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) /> + <Test name="pjmedia-test" info="" wdir="pjmedia/bin" cmd="pjmedia-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) /> + <Test name="pjsip-test" info="" wdir="pjsip/bin" cmd="pjsip-test-i386-Win32-vc8-$(VSTARGET)" disabled=$(NOTEST) /> $(PJSUA-TESTS) </Submit> 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 @@ --> <Test name="Configuring iPhone scenario" cmd="python configure.py -t gnu -o iphone.xml iphone.xml.template" /> + <!-- MSVC target. + Requirements: + - Build from VS successfully + - VS paths are set + + --> + <Test name="Configuring Visual Studio for Win32" cmd="python configure.py -t vs -vstarget Release -o msvc-win32.xml -nopjsuatest msvc.xml.template" /> + <!-- Symbian target. Requirement: - EPOCROOT (modify below) diff --git a/tests/automated/testvars.template b/tests/automated/testvars.template index c9389421..e3f5cf09 100644 --- a/tests/automated/testvars.template +++ b/tests/automated/testvars.template @@ -6,11 +6,14 @@ HOSTNAME = "$(HOSTNAME)" OS = "$(OS)" PJDIR = "$(PJDIR)" SUFFIX = "$(SUFFIX)" +NOTEST = "$(NOTEST)" S60 only: ------------------------------ S60TARGET = "$(S60TARGET)" S60TARGETNAME = "$(S60TARGETNAME)" +S60DEVICE = "$(S60DEVICE)" +EPOCROOT = "$(EPOCROOT)" VS only: ------------------------------ @@ -22,3 +25,9 @@ PJSUA-TESTS: $(PJSUA-TESTS) ------------------------------ +OTHER: +------------------------------ +IPPROOT +IPPSAMPLES +IPPARCH +NOP (cmdline to do nothing) |