mesontest: Use test setup name in logfiles
When using a setup, use the setup name as the namebase for the logfile
instead of the wrapper. The wrapper may not be set, or it may be shared
between test setups.
Also don't try to use the wrapper if it's an empty list.
Closes
@@ -415,15 +415,18 @@ TIMEOUT: %4d
if not self.options.logbase or self.options.verbose:
return None, None, None, None
+ namebase = None
logfile_base = os.path.join(self.options.wd, 'meson-logs', self.options.logbase)
- if self.options.wrapper is None:
+ if self.options.wrapper:
+ namebase = os.path.split(self.get_wrapper()[0])[1]
+ elif self.options.setup:
+ namebase = self.options.setup
+
+ if namebase:
+ logfile_base += '-' + namebase.replace(' ', '_')
logfilename = logfile_base + '.txt'
jsonlogfilename = logfile_base + '.json'
- else:
- namebase = os.path.split(self.get_wrapper()[0])[1]
- logfilename = logfile_base + '-' + namebase.replace(' ', '_') + '.txt'
- jsonlogfilename = logfile_base + '-' + namebase.replace(' ', '_') + '.json'
jsonlogfile = open(jsonlogfilename, 'w')
logfile = open(logfilename, 'w')
