38 if data.extra and obj_type == "client" and (action == "sends" or action == "receives") then |
38 if data.extra and obj_type == "client" and (action == "sends" or action == "receives") then |
39 table.insert(l, "\n"..pretty(lines(data.extra), 4).."\n"); |
39 table.insert(l, "\n"..pretty(lines(data.extra), 4).."\n"); |
40 end |
40 end |
41 return lines(l); |
41 return lines(l); |
42 end; |
42 end; |
|
43 |
|
44 ["end"] = function (data) |
|
45 local r = {}; |
|
46 |
|
47 local all_results = {}; |
|
48 for k, v in pairs(data.summary.all) do |
|
49 table.insert(all_results, v); |
|
50 end |
|
51 table.sort(all_results, function (a, b) return a.name < b.name end); |
|
52 |
|
53 print(""); |
|
54 print("Summary"); |
|
55 print("-------"); |
|
56 |
|
57 for _, test_result in ipairs(all_results) do |
|
58 print("", test_result.status, test_result.name); |
|
59 end |
|
60 |
|
61 print(""); |
|
62 |
|
63 for _, test_result in ipairs{ "ok", "fail", "error", "total" } do |
|
64 local count = data.summary[test_result] and #data.summary[test_result] or 0; |
|
65 table.insert(r, tostring(count).." "..test_result); |
|
66 end |
|
67 return table.concat(r, " / "); |
|
68 end; |
43 }; |
69 }; |
44 |
70 |
45 return { |
71 return { |
46 handlers = handlers; |
72 handlers = handlers; |
47 } |
73 } |