Index: main/waeup.sirp/trunk/src/waeup/sirp/testing.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/testing.py	(revision 6734)
+++ main/waeup.sirp/trunk/src/waeup/sirp/testing.py	(revision 6735)
@@ -6,4 +6,5 @@
 import os.path
 import re
+import unittest
 import warnings
 import zope.component
@@ -332,2 +333,37 @@
         remove_new_loggers(self.old_loggers)
         return
+
+def get_doctest_suite(filename_list=[]):
+    """Helper function to create doctest suites for doctests.
+
+    The `filename_list` is a list of filenames relative to the
+    w.s. dir.  So, to get a doctest suite for ``browser.txt`` and
+    ``blah.txt`` in the ``browser/`` subpackage you have to pass
+    ``filename_list=['browser/browser.txt','browser/blah.txt']`` and
+    so on.
+
+    The returned test suite must be registered somewhere locally for
+    instance by something like:
+
+      from waeup.sirp.testing import get_doctest_suite
+      def test_suite():
+        suite = get_doctest_suite(['mypkg/foo.txt', 'mypkg/bar.txt'])
+        return suite
+
+    and that's it.
+    """
+    suite = unittest.TestSuite()
+    for filename in filename_list:
+        path = os.path.join(
+            os.path.dirname(__file__), filename)
+        test = doctest.DocFileSuite(
+            path,
+            module_relative=False,
+            setUp=setUp, tearDown=tearDown,
+            globs = dict(getRootFolder = getRootFolder),
+            optionflags = doctest.ELLIPSIS + doctest.NORMALIZE_WHITESPACE,
+            checker = checker,
+            )
+        test.layer = FunctionalLayer
+        suite.addTest(test)
+    return suite
