validate:tools: Properly inform the user about the log location when test fails

This commit is contained in:
Thibault Saunier 2014-01-10 15:30:38 +01:00
parent eb23274a5b
commit 6bd9177205
3 changed files with 6 additions and 3 deletions

View file

@ -50,14 +50,16 @@ class Test(Loggable):
self.time_taken = 0.0
self._starting_time = None
self.result = Result.NOT_RUN
self.logfile = None
def __str__(self):
string = self.classname
if self.result != Result.NOT_RUN:
string += ": " + self.result
if self.result in [Result.FAILED, Result.TIMEOUT]:
string += " '%s'\n You can reproduce with: %s" \
% (self.message, self.command)
string += " '%s'\n You can reproduce with: %s\n " \
"You can find logs in: %s" % (self.message, self.command,
self.logfile)
return string

View file

@ -69,6 +69,7 @@ class Reporter(Loggable):
mkdir(os.path.dirname(path))
self.out = open(path, 'w+')
self._current_test = test
test.logfile = path
def set_failed(self, test):
self.stats["failure"] += 1

View file

@ -151,6 +151,7 @@ FORMATS = {"aac": "audio/mpeg,mpegversion=4",
"mp4": "video/quicktime,variant=iso;",
"webm": "video/webm"}
def get_profile_full(muxer, venc, aenc, video_restriction=None,
audio_restriction=None,
audio_presence=0, video_presence=0):
@ -176,7 +177,6 @@ def get_profile_full(muxer, venc, aenc, video_restriction=None,
return ret.replace("::", ":")
def get_profile(combination):
return get_profile_full(FORMATS[combination.container],
FORMATS[combination.vcodec],