Bug 1056587 - Only print line with expected status in tbpl logs when this isn't PASS, r=chmanchester

--HG--
extra : rebase_source : 7a7505b90f156381e5be563dab5c783f45860456
This commit is contained in:
James Graham 2014-08-21 23:35:25 +01:00
Родитель b5c27602e8
Коммит 308ea12c94
1 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -74,8 +74,10 @@ class TbplFormatter(BaseFormatter):
failure_line = "TEST-UNEXPECTED-%s | %s | %s %s" % (
data["status"], self.id_str(data["test"]), data["subtest"],
message)
info_line = "TEST-INFO | expected %s\n" % data["expected"]
return "\n".join([failure_line, info_line])
if data["expected"] != "PASS":
info_line = "TEST-INFO | expected %s\n" % data["expected"]
return "\n".join([failure_line, info_line])
return failure_line
return "TEST-%s | %s | %s %s\n" % (
data["status"], self.id_str(data["test"]), data["subtest"],
@ -90,16 +92,20 @@ class TbplFormatter(BaseFormatter):
if test_id in self.test_start_times:
start_time = self.test_start_times.pop(test_id)
time = data["time"] - start_time
time_msg = " | took %ims" % time
time_msg = "took %ims" % time
if "expected" in data:
failure_line = "TEST-UNEXPECTED-%s | %s | %s" % (
data["status"], test_id, message)
info_line = "TEST-INFO expected %s%s\n" % (data["expected"], time_msg)
if data["expected"] not in ("PASS", "OK"):
expected_msg = "expected %s | " % data["expected"]
else:
expected_msg = ""
info_line = "TEST-INFO %s%s\n" % (expected_msg, time_msg)
return "\n".join([failure_line, info_line])
return "TEST-%s | %s%s\n" % (
return "TEST-%s | %s | %s\n" % (
data["status"], test_id, time_msg)
def suite_end(self, data):