[PATCH 5/7] tests: Command line arguments can be passed to testrunner



---
 src/tests/testrunner.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/tests/testrunner.py b/src/tests/testrunner.py
index f82d51d..e3b090a 100755
--- a/src/tests/testrunner.py
+++ b/src/tests/testrunner.py
@@ -2,14 +2,22 @@
 
 import unittest
 import glob
+import sys
 
 test_loader = unittest.defaultTestLoader
 
 names = []
-for filename in glob.iglob("test_*.py"):
-    names.append(filename[:-3])
+args = sys.argv[1:]
+
+if args:
+    for item in args:
+        names.append(item[:-3])
+else:
+    for filename in glob.iglob("test_*.py"):
+        names.append(filename[:-3])
 
 test_suites = []
+print names
 for name in names:
     test_suites.append(test_loader.loadTestsFromName(name))
 
-- 
1.7.0.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]