validate:tools: Properly inform the user about the log location when test fails
authorThibault Saunier <thibault.saunier@collabora.com>
Fri, 10 Jan 2014 14:30:38 +0000 (15:30 +0100)
committerThibault Saunier <thibault.saunier@collabora.com>
Thu, 6 Feb 2014 11:02:58 +0000 (12:02 +0100)
validate/tools/launcher/baseclasses.py
validate/tools/launcher/reporters.py
validate/tools/launcher/utils.py

index e72562e..d7f13e8 100644 (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
 
index 2aa6ebf..d7b231a 100644 (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
index 43bba25..8ae35ba 100644 (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],