Skip to content

Commit f195414

Browse files
Nicer benchmarking script for all
1 parent c75ffad commit f195414

File tree

2 files changed

+132
-2
lines changed

2 files changed

+132
-2
lines changed

esop23_table2_set_ratcop.rb

+65-1
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,38 @@ def print_res (i)
7676
f.puts "<p>Benchmarking in progress: #{i}/#{$projects.length} <progress value=\"#{i}\" max=\"#{$projects.length}\" /></p>" unless i.nil?
7777
f.puts "<table border=2 cellpadding=4 style=\"font-size: 90%\">"
7878
gname = ""
79+
first_group = true
7980
total_assert_count = 0
8081
$projects.each do |p|
8182
if p.group != gname then
83+
if first_group == false then
84+
f.puts "<tr>"
85+
f.puts "<td colspan=3> Summary </td>"
86+
f.puts "<td>#{$analyses[0][4]}</td>"
87+
$analyses.each do |a|
88+
success = a[2]
89+
unknown = a[3]
90+
total = a[4]
91+
92+
thenumbers = ""
93+
if success == total then
94+
thenumbers << "<font color=\"green\" title=\"success\">✔️</font> "
95+
elsif unknown == total then
96+
thenumbers << "<font color=\"red\" title=\"unknown\">❌</font>"
97+
else
98+
thenumbers << "<font color=\"green\" title=\"success\">✔️<b>#{success}</b></font> "
99+
thenumbers << "<font color=\"red\" title=\"unknown\">❌<b>#{unknown}</b></font>"
100+
end
101+
102+
f.puts "<td> #{thenumbers}</td>"
103+
a[2] = 0
104+
a[3] = 0
105+
a[4] = 0
106+
end
107+
f.puts "</tr>"
108+
else
109+
first_group = false
110+
end
82111
gname = p.group
83112
f.puts "<tr><th colspan=#{4+$analyses.size+1}>#{gname}</th></tr>"
84113
if $print_desc then
@@ -153,6 +182,12 @@ def print_res (i)
153182
# thenumbers << "<font color=\"orange\" title=\"vulnerable memory locations\">#{vulner}</font> + "
154183
# thenumbers << "<font color=\"red\" title=\"unsafe memory locations\">#{unsafe}</font>; "
155184
thenumbers = ""
185+
186+
a[2] += success
187+
a[3] += unknown
188+
a[4] += assert_count
189+
190+
156191
# thenumbers << "<font color=\"magenta\" title=\"uncalled functions\">#{uncalled}</font>; " if uncalled > 0
157192
# thenumbers << "<b><font color=\"red\" title=\"dead lines\">#{dead}</font></b>+"
158193
# thenumbers << "<b title=\"live lines\">#{live}</b>="
@@ -182,6 +217,35 @@ def print_res (i)
182217
f.puts "</tr>"
183218
f.puts "</tr>"
184219
end
220+
221+
f.puts "<tr>"
222+
f.puts "<td colspan=3> Summary </td>"
223+
f.puts "<td>#{$analyses[0][4]}</td>"
224+
$analyses.each do |a|
225+
success = a[2]
226+
unknown = a[3]
227+
total = a[4]
228+
229+
thenumbers = ""
230+
if success == total then
231+
thenumbers << "<font color=\"green\" title=\"success\">✔️</font> "
232+
elsif unknown == total then
233+
thenumbers << "<font color=\"red\" title=\"unknown\">❌</font>"
234+
else
235+
thenumbers << "<font color=\"green\" title=\"success\">✔️<b>#{success}</b></font> "
236+
thenumbers << "<font color=\"red\" title=\"unknown\">❌<b>#{unknown}</b></font>"
237+
end
238+
239+
f.puts "<td> #{thenumbers}</td>"
240+
241+
242+
a[2] = 0
243+
a[3] = 0
244+
a[4] = 0
245+
end
246+
f.puts "</tr>"
247+
248+
185249
f.puts "</table>"
186250
f.print "<p style=\"font-size: 80%; white-space: pre-line\">"
187251
f.puts "Last updated: #{Time.now.strftime("%Y-%m-%d %H:%M:%S %z")}"
@@ -227,7 +291,7 @@ def print_res (i)
227291
gname = $1.chomp
228292
skipgrp << gname if line =~ /SKIP/
229293
elsif line =~ /(.*): ?(.*)/
230-
$analyses << [$1,$2]
294+
$analyses << [$1,$2,0,0,0]
231295
else
232296
name = line.chomp
233297
url = f.gets.chomp

esop23_table2_set_watts.rb

+67-1
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,38 @@ def print_res (i)
8181
f.puts "<p>Benchmarking in progress: #{i}/#{$projects.length} <progress value=\"#{i}\" max=\"#{$projects.length}\" /></p>" unless i.nil?
8282
f.puts "<table border=2 cellpadding=4 style=\"font-size: 90%\">"
8383
gname = ""
84+
first_group = true
8485
total_assert_count = 0
8586
$projects.each do |p|
8687
if p.group != gname then
88+
if first_group == false then
89+
f.puts "<tr>"
90+
f.puts "<td colspan=3> Summary </td>"
91+
f.puts "<td>#{$analyses[0][4]}</td>"
92+
$analyses.each do |a|
93+
success = a[2]
94+
unknown = a[3]
95+
total = a[4]
96+
97+
thenumbers = ""
98+
if success == total then
99+
thenumbers << "<font color=\"green\" title=\"success\">✔️</font> "
100+
elsif unknown == total then
101+
thenumbers << "<font color=\"red\" title=\"unknown\">❌</font>"
102+
else
103+
thenumbers << "<font color=\"green\" title=\"success\">✔️<b>#{success}</b></font> "
104+
thenumbers << "<font color=\"red\" title=\"unknown\">❌<b>#{unknown}</b></font>"
105+
end
106+
107+
f.puts "<td> #{thenumbers}</td>"
108+
a[2] = 0
109+
a[3] = 0
110+
a[4] = 0
111+
end
112+
f.puts "</tr>"
113+
else
114+
first_group = false
115+
end
87116
gname = p.group
88117
f.puts "<tr><th colspan=#{4+$analyses.size+1}>#{gname}</th></tr>"
89118
if $print_desc then
@@ -151,6 +180,11 @@ def print_res (i)
151180
dur = lines.grep(/^Duration: (.*) s/) { |x| $1 }
152181
cod = lines.grep(/EXITCODE\s*(.*)$/) { |x| $1 }
153182
if cod == [] and not dur == [] then
183+
184+
a[2] += success + unreachable
185+
a[3] += unknown + error
186+
a[4] += assert_count
187+
154188
if first_one then
155189
f.puts "<td> #{assert_count}</td>"
156190
first_one = false
@@ -199,6 +233,38 @@ def print_res (i)
199233
f.puts "</tr>"
200234
f.puts "</tr>"
201235
end
236+
237+
f.puts "<tr>"
238+
f.puts "<td colspan=3> Summary </td>"
239+
f.puts "<td>#{$analyses[0][4]}</td>"
240+
$analyses.each do |a|
241+
success = a[2]
242+
unknown = a[3]
243+
total = a[4]
244+
245+
thenumbers = ""
246+
if success == total then
247+
thenumbers << "<font color=\"green\" title=\"success\">✔️</font> "
248+
elsif unknown == total then
249+
thenumbers << "<font color=\"red\" title=\"unknown\">❌</font>"
250+
else
251+
thenumbers << "<font color=\"green\" title=\"success\">✔️<b>#{success}</b></font> "
252+
thenumbers << "<font color=\"red\" title=\"unknown\">❌<b>#{unknown}</b></font>"
253+
end
254+
255+
f.puts "<td> #{thenumbers}</td>"
256+
257+
258+
a[2] = 0
259+
a[3] = 0
260+
a[4] = 0
261+
end
262+
f.puts "</tr>"
263+
264+
265+
f.puts "</tr>"
266+
267+
202268
f.puts "</table>"
203269
f.print "<p style=\"font-size: 80%; white-space: pre-line\">"
204270
f.puts "Last updated: #{Time.now.strftime("%Y-%m-%d %H:%M:%S %z")}"
@@ -244,7 +310,7 @@ def print_res (i)
244310
gname = $1.chomp
245311
skipgrp << gname if line =~ /SKIP/
246312
elsif line =~ /(.*): ?(.*)/
247-
$analyses << [$1,$2]
313+
$analyses << [$1,$2,0,0,0]
248314
else
249315
name = line.chomp
250316
url = f.gets.chomp

0 commit comments

Comments
 (0)