Add TestListFilter definition.
authorJelmer Vernooij <jelmer@samba.org>
Sun, 4 Mar 2012 03:01:28 +0000 (04:01 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sun, 4 Mar 2012 17:02:07 +0000 (18:02 +0100)
selftest/testlist.py

index c37701280b48d13946b542b29676a03940931d8a..bc88f9d0c0fb5b55be3016395baac17df14801e4 100644 (file)
@@ -85,3 +85,16 @@ def read_testlist(inf, outf):
             yield (name, env, cmdline, supports_loadlist, supports_idlist)
         else:
             outf.write(l)
+
+
+class TestListFilter(object):
+    """Interface for something that can filter a test list."""
+
+    def should_run_testsuite(self, name):
+        """Whether to run a specific testsuite.
+
+        :param name: Name of the testsuite
+        :return: List of tests to run.  None means run the whole testsuite.
+            Return an empty list to not run this testsuite
+        """
+        raise NotImplementedError(self.should_run_testsuite)