validate: launcher: Fix test log header output

Write log file header before running tests, instead of overwriting the
file afterwards.

https://bugzilla.gnome.org/show_bug.cgi?id=742966
This commit is contained in:
Ramiro Polla 2015-01-13 02:32:16 +01:00 committed by Thibault Saunier
parent 9c3606a867
commit b29f378296

View file

@ -246,6 +246,13 @@ class Test(Loggable):
for log in self.extra_logfiles:
message += "\n - %s" % log
self.reporter.out.write("=================\n"
"Test name: %s\n"
"Command: '%s'\n"
"=================\n\n"
% (self.classname, self.command))
self.reporter.out.flush()
printc(message, Colors.OKBLUE)
try:
@ -262,14 +269,6 @@ class Test(Loggable):
self._kill_subprocess()
self.time_taken = time.time() - self._starting_time
if not self.options.redirect_logs:
self.reporter.out.seek(0)
self.reporter.out.write("=================\n"
"Test name: %s\n"
"Command: '%s'\n"
"=================\n\n"
% (self.classname, self.command))
printc("Result: %s%s\n" % (self.result,
" (" + self.message + ")" if self.message else ""),
color=utils.get_color_for_result(self.result))