[pygobject: 21/23] tests: add runtests-windows.py script
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject: 21/23] tests: add runtests-windows.py script
- Date: Thu, 4 Nov 2010 22:44:20 +0000 (UTC)
commit 3d5955767d81f45e796ab2af0707533375681774
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date: Wed Nov 3 09:38:56 2010 +0100
tests: add runtests-windows.py script
Signed-off-by: Dieter Verfaillie <dieterv optionexplicit be>
tests/runtests-windows.py | 47 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
---
diff --git a/tests/runtests-windows.py b/tests/runtests-windows.py
new file mode 100644
index 0000000..90154b4
--- /dev/null
+++ b/tests/runtests-windows.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+
+import os
+import sys
+import glob
+import unittest
+
+os.environ['PYGTK_USE_GIL_STATE_API'] = ''
+sys.path.insert(0, os.path.dirname(__file__))
+sys.argv.append('--g-fatal-warnings')
+
+import gobject
+gobject.threads_init()
+
+
+SKIP_FILES = ['runtests',
+ 'test_gio', # python crash
+ 'test_gresolver', # python crash
+ 'test_gsocket', # blocks on test_socket_condition_wait
+ 'test_mainloop', # no os.fork on windows
+ 'test_subprocess'] # blocks on testChildWatch
+
+
+if __name__ == '__main__':
+ testdir = os.path.split(os.path.abspath(__file__))[0]
+ os.chdir(testdir)
+
+ def gettestnames():
+ files = glob.glob('*.py')
+ names = map(lambda x: x[:-3], files)
+ map(names.remove, SKIP_FILES)
+ return names
+
+ suite = unittest.TestSuite()
+ loader = unittest.TestLoader()
+
+ for name in gettestnames():
+ try:
+ suite.addTest(loader.loadTestsFromName(name))
+ except Exception, e:
+ print 'Could not load %s: %s' % (name, e)
+
+ testRunner = unittest.TextTestRunner()
+ testRunner.verbosity = 2
+ testRunner.run(suite)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]