[telepathy-gabble/master] Add ability to only test certian jingle dialects

Sjoerd Simons sjoerd.simons at collabora.co.uk
Thu Apr 30 04:33:58 PDT 2009


test_all_dialects now checks the JINGLE_DIALECTS environment variable to decide
which dialects to test. If it's not set all dialects will be tested. When set
it should be a list of dialects seperated by commas. Current supported dialects
are jingle015, jingle031, gtalk03 and gtalk04.
---
 tests/twisted/jingle/jingletest2.py |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tests/twisted/jingle/jingletest2.py b/tests/twisted/jingle/jingletest2.py
index 7c6a3ad..2a56587 100644
--- a/tests/twisted/jingle/jingletest2.py
+++ b/tests/twisted/jingle/jingletest2.py
@@ -13,6 +13,7 @@ from gabbletest import sync_stream, exec_test
 from servicetest import EventPattern
 import dbus
 import ns
+import os
 
 class JingleProtocol:
     """
@@ -476,7 +477,17 @@ def test_dialects(f, dialects):
             lambda q, bus, conn, stream: f(dialect(), q, bus, conn, stream))
 
 def test_all_dialects(f):
-    test_dialects(f, [
-        JingleProtocol015, JingleProtocol031, GtalkProtocol03,
-        GtalkProtocol04])
-
+    dialectmap = { "jingle015": JingleProtocol015,
+        "jingle031": JingleProtocol031,
+        "gtalk03": GtalkProtocol03,
+        "gtalk04":  GtalkProtocol04
+    }
+    dialects = []
+
+    jd = os.getenv("JINGLE_DIALECTS")
+    if jd == None:
+        dialects = dialectmap.values()
+    else:
+        for d in jd.split (','):
+            dialects.append(dialectmap[d])
+    test_dialects(f,  dialects)
-- 
1.5.6.5




More information about the telepathy-commits mailing list