diff options
author | Benny Prijono <bennylp@teluu.com> | 2010-04-20 10:05:09 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2010-04-20 10:05:09 +0000 |
commit | ae2ca64fc09a15a01995613d032480e92a94cada (patch) | |
tree | acb637033074fabc378e4d3669fbcade0d844885 | |
parent | b2428c8bed5f9459682199bdacc3c2d7ab549cb3 (diff) |
More ticket #1041 (unit test framework):
- added support for Intel IPP build configuration and testing
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3143 74dad513-b988-da41-8d7b-12977e46ad98
-rwxr-xr-x | tests/automated/configure.py | 50 | ||||
-rw-r--r-- | tests/automated/gnu-ipp.xml.template | 27 | ||||
-rw-r--r-- | tests/automated/gnu.xml.template | 13 | ||||
-rw-r--r-- | tests/automated/run.py | 1 |
4 files changed, 73 insertions, 18 deletions
diff --git a/tests/automated/configure.py b/tests/automated/configure.py index 06a65315..2d530d08 100755 --- a/tests/automated/configure.py +++ b/tests/automated/configure.py @@ -86,7 +86,7 @@ class S60SDK: def __init__(self): # Check that EPOCROOT is set if not "EPOCROOT" in os.environ: - print "Error: EPOCROOT environment variable is not set" + sys.stderr.write("Error: EPOCROOT environment variable is not set\n") sys.exit(1) epocroot = os.environ["EPOCROOT"] # EPOCROOT must have trailing backslash @@ -107,9 +107,9 @@ class S60SDK: proc.wait() if sdk1 != sdk2: - print "Error: default SDK in device doesn't match EPOCROOT" - print "Default device SDK =", sdk2 - print "EPOCROOT SDK =", sdk1 + sys.stderr.write("Error: default SDK in device doesn't match EPOCROOT\n") + sys.stderr.write("Default device SDK = " + sdk2 + "\n") + sys.stderr.write("EPOCROOT SDK = " + sdk1 + "\n") sys.exit(1) self.name = sdk2.replace("_", "-") @@ -129,7 +129,7 @@ def replace_vars(text): if platform.system().lower() == "microsoft": os_info = platform.release() + "-" + platform.version() + "-" + platform.win32_ver()[2] elif platform.system().lower() == "linux": - os_info = + "-" + "-".join(platform.linux_distribution()[0:2]) + os_info = "-" + "-".join(platform.linux_distribution()[0:2]) # vs_target if not vs_target and text.find("$(VSTARGET)") >= 0: @@ -159,7 +159,7 @@ def replace_vars(text): shell=True, stdout=subprocess.PIPE) suffix = proc.stdout.readline().rstrip(" \r\n") else: - sys.stderr.write("Error: unsupported built type " + build_type + "\n") + sys.stderr.write("Error: unsupported build type '" + build_type + "'\n") sys.exit(1) while True: @@ -184,6 +184,21 @@ def replace_vars(text): text = text.replace("$(S60TARGETNAME)", s60_target.replace(" ", "-")) elif text.find("$(DISABLED)") >= 0: text = text.replace("$(DISABLED)", "0") + elif text.find("$(IPPROOT)") >= 0: + if not os.environ.has_key("IPPROOT"): + sys.stderr.write("Error: environment variable IPPROOT is needed but not set\n") + sys.exit(1) + text = text.replace("$(IPPROOT)", os.environ["IPPROOT"]) + elif text.find("$(IPPSAMPLES)") >= 0: + if not os.environ.has_key("IPPSAMPLES"): + sys.stderr.write("Error: environment variable IPPSAMPLES is needed but not set\n") + sys.exit(1) + text = text.replace("$(IPPSAMPLES)", os.environ["IPPSAMPLES"]) + elif text.find("$(IPPARCH)") >= 0: + if not os.environ.has_key("IPPARCH"): + text = text.replace("$(IPPARCH)", "") + else: + text = text.replace("$(IPPARCH)", os.environ["IPPARCH"]) elif text.find("$(OS)") >= 0: text = text.replace("$(OS)", os_info) elif text.find("$(SUFFIX)") >= 0: @@ -201,11 +216,12 @@ def replace_vars(text): def main(args): global vs_target, s60_target, build_type + output = sys.stdout usage = """Usage: configure.py [OPTIONS] scenario_template_file Where OPTIONS: - -t TYPE Specify build type for Windows since we support both - Visual Studio and Mingw. If not specified, it will be + -o FILE Output to file, otherwise to stdout. + -t TYPE Specify build type. If not specified, it will be asked if necessary. Values are: vs: Visual Studio gnu: Makefile based @@ -225,7 +241,15 @@ Where OPTIONS: args.pop(0) while len(args): - if args[0]=='-vstarget': + if args[0]=='-o': + args.pop(0) + if len(args): + output = open(args[0], "wt") + args.pop(0) + else: + sys.stderr.write("Error: needs value for -o\n") + sys.exit(1) + elif args[0]=='-vstarget': args.pop(0) if len(args): vs_target = args[0] @@ -256,10 +280,10 @@ Where OPTIONS: break if len(args) != 1: - print usage + sys.stderr.write(usage + "\n") return 1 - if not build_type and (platform.system().lower() == "windows" or platform.system().lower() == "microsoft"): + if not build_type: print "Enter the build type (values: vs, gnu, s60) [vs]: ", build_type = sys.stdin.readline().replace("\n", "").replace("\r", "") if not build_type: @@ -276,7 +300,9 @@ Where OPTIONS: f.close() tpl = replace_vars(tpl) - print tpl + output.write(tpl) + if output != sys.stdout: + output.close() return 0 diff --git a/tests/automated/gnu-ipp.xml.template b/tests/automated/gnu-ipp.xml.template new file mode 100644 index 00000000..f5e367f4 --- /dev/null +++ b/tests/automated/gnu-ipp.xml.template @@ -0,0 +1,27 @@ +<?xml version="1.0" ?> +<Scenario site="$(HOSTNAME)" url="http://my.cdash.org/submit.php?project=PJSIP" wdir="$(PJDIR)"> + <Submit group="Experimental" build="$(SUFFIX)-$(GCC)-IPP" disabled="$(DISABLED)" > + <Update /> + <FileWrite file="user.mak"> + <![CDATA[ +# Written by ccdash +]]> + </FileWrite> + <FileWrite file="pjlib/include/pj/config_site.h"> + <![CDATA[ +/* Written by ccdash */ +#define PJ_HAS_IPV6 1 +#define PJMEDIA_HAS_G7221_CODEC 0 +#define PJMEDIA_HAS_INTEL_IPP 1 +]]> + </FileWrite> + <Configure cmd='./aconfigure --enable-ipp --with-ipp="$(IPPROOT)" --with-ipp-samples="$(IPPSAMPLES)" --with-ipp-arch=$(IPPARCH)' /> + <Build cmd="make dep && make distclean && 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)" /> + $(PJSUA-TESTS) + </Submit> +</Scenario> diff --git a/tests/automated/gnu.xml.template b/tests/automated/gnu.xml.template index 888f5691..687c87b9 100644 --- a/tests/automated/gnu.xml.template +++ b/tests/automated/gnu.xml.template @@ -1,7 +1,7 @@ <?xml version="1.0" ?> <Scenario site="$(HOSTNAME)" url="http://my.cdash.org/submit.php?project=PJSIP" wdir="$(PJDIR)"> - <Submit group="Experimental" build="$(SUFFIX)-$(GCC)-default" disabled="$(DISABLED)" > + <Submit group="Experimental" build="$(SUFFIX)-$(GCC)-IPP" disabled="$(DISABLED)" > <Update /> <FileWrite file="user.mak"> <![CDATA[ @@ -13,15 +13,16 @@ /* Written by ccdash */ #define PJ_HAS_IPV6 1 #define PJMEDIA_HAS_G7221_CODEC 1 +#define PJMEDIA_HAS_INTEL_IPP 1 ]]> </FileWrite> <Configure cmd="./aconfigure" /> <Build cmd="make dep && make distclean && make" /> - <Test name="pjlib-test" info="" wdir="pjlib/bin" cmd="./pjlib-test-$(SUFFIX)" /> - <Test name="pjlib-util-test" info="" wdir="pjlib-util/bin" cmd="./pjlib-util-test-$(SUFFIX)" /> - <Test name="pjnath-test" info="" wdir="pjnath/bin" cmd="./pjnath-test-$(SUFFIX)" /> - <Test name="pjmedia-test" info="" wdir="pjmedia/bin" cmd="./pjmedia-test-$(SUFFIX)" /> - <Test name="pjsip-test" info="" wdir="pjsip/bin" cmd="./pjsip-test-$(SUFFIX)" /> + <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)" /> $(PJSUA-TESTS) </Submit> diff --git a/tests/automated/run.py b/tests/automated/run.py index a9c319e1..7672a265 100644 --- a/tests/automated/run.py +++ b/tests/automated/run.py @@ -1,3 +1,4 @@ +#!/usr/bin/python import sys import ccdash |