Skip to content

Commit 7a3f285

Browse files
authored
Merge pull request diffblue#231 from diffblue/feature/improved_HTML_interface_to_results
Improved HTML interface to results of the instrumenter and error traces.
2 parents 8e36d2f + 522fdce commit 7a3f285

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

driver/presentation.py

+13-7
Original file line numberDiff line numberDiff line change
@@ -317,30 +317,36 @@ def build_HTML_interface_to_slicing_tasks(root_dir,sub_dir,ofile):
317317
ofile.write("<p></p>\n")
318318

319319
with open(os.path.join(full_sub_dir,"instrumented_goto_programs.json")) as json_file:
320-
sliced_goto_programs = json.load(json_file)
321-
if sliced_goto_programs is not None:
320+
instrumented_goto_programs = json.load(json_file)
321+
if instrumented_goto_programs is not None:
322322
ofile.write("<table>\n"
323323
"<caption>Slicing tasks (per root function).</caption>\n"
324324
" <tr>\n"
325325
" <th>Root function</th>\n"
326326
" <th>Functions</th>\n"
327327
" <th>Symbol table</th>\n"
328+
" <th>Stats (JSON)</th>\n"
329+
" <th>File</th>\n"
328330
" </tr>\n")
329-
for slice in sliced_goto_programs:
330-
dir_name=text_to_file_or_dir_name(slice["root_function"])
331+
for slicing_task in instrumented_goto_programs:
332+
dir_name = text_to_file_or_dir_name(slicing_task["root_function"])
331333
ofile.write(" <tr>\n")
332-
ofile.write(" <td>" + escape_text_to_HTML(slice["root_function"]) + "</td>\n")
334+
ofile.write(" <td>" + escape_text_to_HTML(slicing_task["root_function"]) + "</td>\n")
333335
ofile.write(" <td align=\"center\"><a href=\"./" + os.path.join(sub_dir,dir_name,"index.html") +
334336
"\">here</a></td>\n")
335337
ofile.write(" <td align=\"center\"><a href=\"./" + os.path.join(sub_dir,dir_name,"symbol_table.html") +
336338
"\">here</a></td>\n")
339+
ofile.write(" <td align=\"center\"><a href=\"./" +
340+
os.path.relpath(os.path.splitext(slicing_task["goto_binary_file"])[0] + ".stats.json", root_dir) +
341+
"\">here</a></td>\n")
342+
ofile.write(" <td>" + escape_text_to_HTML(slicing_task["goto_binary_file"]) + "</td>\n")
337343
ofile.write(" </tr>\n")
338344
ofile.write("</table>\n")
339345

340346
ofile.write("<p>Resulting JSON file containing the configuration of all slicing tasks: "
341347
"<a href=\"./" + sub_dir + "/instrumented_goto_programs.json\">here</a></p>\n")
342348

343-
return len(sliced_goto_programs)
349+
return len(instrumented_goto_programs)
344350

345351

346352
def build_HTML_interface_to_group_of_error_traces(traces,tool_name,tgt_file,tgt_line,ofile):
@@ -383,7 +389,7 @@ def build_HTML_interface_to_error_traces(root_dir,sub_dir,ofile):
383389
return
384390

385391
ofile.write("<table>\n"
386-
"<caption>Error traces (grouped by target locations) found by CBMC and SYMEX.</caption>\n"
392+
"<caption>Error traces (grouped by target locations).</caption>\n"
387393
" <tr>\n"
388394
" <th>File</th>\n"
389395
" <th>Line</th>\n"

0 commit comments

Comments
 (0)