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 c377012..bc88f9d 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)