[svn-commits] mjordan: testsuite/asterisk/trunk r3961 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Jul 27 10:45:25 CDT 2013


Author: mjordan
Date: Sat Jul 27 10:45:22 2013
New Revision: 3961

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3961
Log:
Let tests execute if any tag specified is matched

Originally, tags were used to further exclude tests. This meant that
specifying 'CDR' and 'SIP' would only execute a test if the test had both the
'CDR' and the 'SIP' flag. While this is useful to filter large sets of tests,
it is actually less useful in practice. Often, it is more useful to execute
different categories of tests together rather than execute a subset of an
existing category.

For example, it is useful to be able to execute all channel driver tests. This
lets you specify '-g SIP -g IAX (etc.)' on the command line and execute all of
the channel driver tests. Previously, this would only have executed a test if
it was both SIP and IAX (which is highly unlikely).

Modified:
    asterisk/trunk/lib/python/asterisk/TestConfig.py

Modified: asterisk/trunk/lib/python/asterisk/TestConfig.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/TestConfig.py?view=diff&rev=3961&r1=3960&r2=3961
==============================================================================
--- asterisk/trunk/lib/python/asterisk/TestConfig.py (original)
+++ asterisk/trunk/lib/python/asterisk/TestConfig.py Sat Jul 27 10:45:22 2013
@@ -454,20 +454,9 @@
         if not requested_tags:
             return self.can_run
 
-        for tag in requested_tags:
-            if tag.startswith("-"):
-                try:
-                    self.tags.index(tag[1:])
-                    self.can_run = False
-                    return self.can_run
-                except:
-                    pass
-            else:
-                try:
-                    self.tags.index(tag)
-                except:
-                    self.can_run = False
-                    return self.can_run
+        intersection = set(requested_tags).intersection(set(self.tags))
+        if len(intersection) == 0:
+            self.can_run = False
 
         # all tags matched successfully
         return self.can_run




More information about the svn-commits mailing list