aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-09-27 14:48:50 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-09-27 14:48:50 +0200
commit40c1ce264991447522e8296ad86a55ca5c3b81d1 (patch)
treeabbc46c63fb3d7e635f19bdcb2c38f87a8f9a1ff /tests
parent8063a8cb27a35cd81f238796fa5c902d8ea93182 (diff)
downloadqxmpp-40c1ce264991447522e8296ad86a55ca5c3b81d1.tar.gz
add helper script to run tests
Diffstat (limited to 'tests')
-rwxr-xr-xtests/run.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/run.py b/tests/run.py
new file mode 100755
index 00000000..1a077716
--- /dev/null
+++ b/tests/run.py
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+
+import getopt
+import os
+import platform
+import sys
+
+root = os.path.dirname(__file__)
+report_path = None
+
+def usage():
+ print "Usage: run.py [options]"
+
+# parse options
+try:
+ opts, args = getopt.getopt(sys.argv[1:], 'hx:')
+except getopt.GetoptError, err:
+ print err
+ usage()
+ sys.exit(2)
+
+for opt, optarg in opts:
+ if opt == '-h':
+ usage()
+ sys.exit()
+ elif opt == '-x':
+ report_path = optarg
+ if not os.path.exists(report_path):
+ os.mkdir(report_path)
+
+# set library path
+path = os.path.join(root, '..', 'src')
+if platform.system() == 'Darwin':
+ os.environ['DYLD_LIBRARY_PATH'] = path
+else:
+ os.environ['LD_LIBRARY_PATH'] = path
+
+# run tests
+if platform.system() == 'Darwin':
+ prog = os.path.join(root, 'qxmpp-tests.app', 'Contents', 'MacOS', 'qxmpp-tests')
+else:
+ prog = os.path.join(root, 'qxmpp-tests.app')
+if report_path:
+ os.system('%s -xunitxml -o %s/%s.xml' % (prog, report_path, test))
+else:
+ os.system(prog)