def RobotTestSuite(*paths, **kw):
suite = unittest.TestSuite()<EOL>if '<STR_LIT>' in os.environ:<EOL><INDENT>try:<EOL><INDENT>suite.level = int(os.environ.get('<STR_LIT>', <NUM_LIT:1>))<EOL><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if kw.get('<STR_LIT>', True):<EOL><INDENT>kw['<STR_LIT>'] = doctest._normalize_module(kw.get('<STR_LIT>'))<EOL><DEDENT>variables = get_robot_variables()<EOL>for path in paths:<EOL><INDENT>filename = doctest._module_relative_path(kw['<STR_LIT>'], path)<EOL>robot_suite = robot_parsing.TestData(source=filename)<EOL>outputdir = []<EOL>def recurs(child_suite):<EOL><INDENT>suite_base = os.path.basename(child_suite.source)<EOL>suite_dir = os.path.splitext(suite_base)[<NUM_LIT:0>]<EOL>outputdir.append(suite_dir)<EOL>for test in child_suite.testcase_table.tests:<EOL><INDENT>test_dir = normalize(test.name)<EOL>outputdir.append(test_dir)<EOL>suite.addTest(RobotTestCase(path, name=test.name,<EOL>tags=test.tags.value,<EOL>variables=variables,<EOL>source=child_suite.source,<EOL>outputdir='<STR_LIT:/>'.join(outputdir),<EOL>**kw))<EOL>outputdir.pop()<EOL><DEDENT>for grandchild in getattr(child_suite, '<STR_LIT>', []):<EOL><INDENT>recurs(grandchild)<EOL><DEDENT>outputdir.pop()<EOL><DEDENT>recurs(robot_suite)<EOL><DEDENT>return suite<EOL>
Build up a test suite similarly to doctest.DocFileSuite