mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-25 18:14:15 +00:00
validate:launcher: Enhance dumping log files output
This commit is contained in:
parent
3d5099ee41
commit
b4e96b4f4e
1 changed files with 15 additions and 16 deletions
|
@ -140,14 +140,14 @@ class Test(Loggable):
|
||||||
if self.result != Result.NOT_RUN:
|
if self.result != Result.NOT_RUN:
|
||||||
string += ": " + self.result
|
string += ": " + self.result
|
||||||
if self.result in [Result.FAILED, Result.TIMEOUT]:
|
if self.result in [Result.FAILED, Result.TIMEOUT]:
|
||||||
string += " '%s'\n" \
|
string += " '%s'" % self.message
|
||||||
" You can reproduce with: %s\n" \
|
if not self.options.dump_on_failure:
|
||||||
% (self.message, self.get_command_repr())
|
string += "\n You can reproduce with: %s\n" % \
|
||||||
|
self.get_command_repr()
|
||||||
if not self.options.redirect_logs and \
|
if not self.options.redirect_logs and self.result != Result.PASSED:
|
||||||
self.result == Result.PASSED or \
|
string += self.get_logfile_repr()
|
||||||
not self.options.dump_on_failure:
|
else:
|
||||||
string += self.get_logfile_repr()
|
string = "\n==> %s" % string
|
||||||
|
|
||||||
return string
|
return string
|
||||||
|
|
||||||
|
@ -522,11 +522,10 @@ class Test(Loggable):
|
||||||
self.command = self.use_valgrind(self.command, self.proc_env)
|
self.command = self.use_valgrind(self.command, self.proc_env)
|
||||||
|
|
||||||
if not self.options.redirect_logs:
|
if not self.options.redirect_logs:
|
||||||
self.out.write("=================\n"
|
self.out.write("Test name: %s\n"
|
||||||
"Test name: %s\n"
|
|
||||||
"Command: '%s'\n"
|
"Command: '%s'\n"
|
||||||
"=================\n\n"
|
"%s\n"
|
||||||
% (self.classname, self.get_command_repr()))
|
% (self.classname, self.get_command_repr(), '-' * 80))
|
||||||
self.out.flush()
|
self.out.flush()
|
||||||
else:
|
else:
|
||||||
message = "Launching: %s%s\n" \
|
message = "Launching: %s%s\n" \
|
||||||
|
@ -542,14 +541,14 @@ class Test(Loggable):
|
||||||
self.start_ts = time.time()
|
self.start_ts = time.time()
|
||||||
|
|
||||||
def _dump_log_file(self, logfile):
|
def _dump_log_file(self, logfile):
|
||||||
message = "Dumping contents of %s\n" % logfile
|
message = "> Dumping %s\n>" % logfile
|
||||||
printc(message, Colors.FAIL)
|
printc(message)
|
||||||
|
|
||||||
with open(logfile, 'r') as fin:
|
with open(logfile, 'r') as fin:
|
||||||
print(fin.read())
|
for line in fin.readlines():
|
||||||
|
print('> ' + line, end='')
|
||||||
|
|
||||||
def _dump_log_files(self):
|
def _dump_log_files(self):
|
||||||
printc("Dumping log files on failure\n", Colors.FAIL)
|
|
||||||
self._dump_log_file(self.logfile)
|
self._dump_log_file(self.logfile)
|
||||||
for logfile in self.extra_logfiles:
|
for logfile in self.extra_logfiles:
|
||||||
self._dump_log_file(logfile)
|
self._dump_log_file(logfile)
|
||||||
|
|
Loading…
Reference in a new issue