| 874 | |
| 875 | |
| 876 | class TestRepository(TestSuite): |
| 877 | |
| 878 | def __init__(self, path): |
| 879 | normalized_path = abspath(path) |
| 880 | super(TestRepository, self).__init__(basename(normalized_path)) |
| 881 | self.path = normalized_path |
| 882 | self.is_loaded = False |
| 883 | self.config = None |
| 884 | |
| 885 | def GetConfiguration(self, context): |
| 886 | if self.is_loaded: |
| 887 | return self.config |
| 888 | self.is_loaded = True |
| 889 | |
| 890 | module = get_module('testcfg', self.path) |
| 891 | self.config = module.GetConfiguration(context, self.path) |
| 892 | if hasattr(self.config, 'additional_flags'): |
| 893 | self.config.additional_flags += context.node_args |
| 894 | else: |
| 895 | self.config.additional_flags = context.node_args |
| 896 | return self.config |
| 897 | |
| 898 | def GetBuildRequirements(self, path, context): |
| 899 | return self.GetConfiguration(context).GetBuildRequirements() |
| 900 | |
| 901 | def AddTestsToList(self, result, current_path, path, context, arch, mode): |
| 902 | tests = self.GetConfiguration(context).ListTests(current_path, path, |
| 903 | arch, mode) |
| 904 | result += tests |
| 905 | for i in range(1, context.repeat): |
| 906 | result += copy.deepcopy(tests) |
| 907 | |
| 908 | def GetTestStatus(self, context, sections, defs): |
| 909 | self.GetConfiguration(context).GetTestStatus(sections, defs) |
| 910 | |
| 911 | |
| 912 | class LiteralTestSuite(TestSuite): |