summaryrefslogtreecommitdiff
path: root/tests/cdash/cfg_msvc.py
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-12-30 16:19:38 +0000
committerBenny Prijono <bennylp@teluu.com>2008-12-30 16:19:38 +0000
commitbeea36bf708bd92dfd5275dfe5eb53cff19c14b6 (patch)
tree69d4c251587cf12c714c340e7addc9bae8010aa1 /tests/cdash/cfg_msvc.py
parent07f2e296050d2a3de0b584e8458f51066b5c4b90 (diff)
CDash test for MSVC
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2404 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'tests/cdash/cfg_msvc.py')
-rw-r--r--tests/cdash/cfg_msvc.py69
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/cdash/cfg_msvc.py b/tests/cdash/cfg_msvc.py
new file mode 100644
index 00000000..dcebbd07
--- /dev/null
+++ b/tests/cdash/cfg_msvc.py
@@ -0,0 +1,69 @@
+#
+# cfg_msvc.py - MSVC/Visual Studio target configurator
+#
+# Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+import builder
+import os
+import sys
+
+# Each configurator must export this function
+def create_builder(args):
+ # (optional) args format:
+ # [cfg_site] [--vs-config VSCFG]
+ #
+ # cfg_site: site configuration module. If not specified, "cfg_site"
+ # is implied
+ # VSCFG: Visual Studio build configuration to build. Sample values:
+ # "Debug|Win32", "Release|Win32". If not specified then
+ # "Release|Win32" is assumed
+
+ cfg_site = "cfg_site"
+ vs_cfg = "Release|Win32"
+ in_option = ""
+
+ for arg in args:
+ if in_option=="--vs-config":
+ vs_cfg = arg
+ in_option = ""
+ elif arg=="--vs-config":
+ in_option = arg
+ else:
+ cfg_site = arg
+
+ if os.access(cfg_site+".py", os.F_OK) == False:
+ print "Error: file '%s.py' doesn't exist." % (cfg_site)
+ sys.exit(1)
+
+ cfg_site = __import__(cfg_site)
+ test_cfg = builder.BaseConfig(cfg_site.BASE_DIR, \
+ cfg_site.URL, \
+ cfg_site.SITE_NAME, \
+ cfg_site.GROUP, \
+ cfg_site.OPTIONS)
+
+ builders = [
+ builder.MSVCTestBuilder(test_cfg,
+ vs_config=vs_cfg,
+ build_config_name="default",
+ config_site="#define PJ_TODO(x)\n",
+ exclude=cfg_site.EXCLUDE,
+ not_exclude=cfg_site.NOT_EXCLUDE)
+ ]
+
+ return builders
+