mtest: Move loading of test data into its own function
A subsequent commit will do a bit more during test data loading, making a
dedicated function seem advisable.
The diff looks a bit odd, using git show --diff-algorithm=patience
will make it clearer.
@@ -1523,6 +1523,19 @@ class TestHarness:
if namebase:
self.logfile_base += '-' + namebase.replace(' ', '_')
+ self.load_metadata()
+
+ ss = set()
+ for t in self.tests:
+ for s in t.suite:
+ ss.add(s)
+ self.suites = list(ss)
+
+ def get_console_logger(self) -> 'ConsoleLogger':
+ assert self.console_logger
+ return self.console_logger
+
+ def load_metadata(self) -> None:
startdir = os.getcwd()
try:
os.chdir(self.options.wd)
@@ -1536,16 +1549,6 @@ class TestHarness:
finally:
os.chdir(startdir)
- ss = set()
- for t in self.tests:
- for s in t.suite:
- ss.add(s)
- self.suites = list(ss)
-
- def get_console_logger(self) -> 'ConsoleLogger':
- assert self.console_logger
- return self.console_logger
-
def load_tests(self, file_name: str) -> T.List[TestSerialisation]:
datafile = Path('meson-private') / file_name
if not datafile.is_file():
