Skip to content

Commit 8dd9f80

Browse files
committed
XML output of stop-on-fail verifier: goto_trace is within result node
The XML schema requires that goto_trace appears within a result node, which was the case for all-properties verifiers, but not for stop-on-fail. While at it, also cleanup JSON output to use the goto_tracet API.
1 parent cce4503 commit 8dd9f80

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/goto-checker/bmc_util.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,22 @@ void output_error_trace(
7979

8080
case ui_message_handlert::uit::XML_UI:
8181
{
82-
xmlt xml;
83-
convert(ns, goto_trace, xml);
84-
msg.status() << xml;
82+
const goto_trace_stept &last_step = goto_trace.get_last_step();
83+
property_infot info{
84+
last_step.pc, last_step.comment, property_statust::FAIL};
85+
xmlt xml_result = xml(last_step.property_id, info);
86+
convert(ns, goto_trace, xml_result.new_element());
87+
msg.result() << xml_result;
8588
}
8689
break;
8790

8891
case ui_message_handlert::uit::JSON_UI:
8992
{
9093
json_stream_objectt &json_result =
9194
ui_message_handler.get_json_stream().push_back_stream_object();
92-
const goto_trace_stept &step = goto_trace.steps.back();
93-
json_result["property"] =
94-
json_stringt(step.pc->source_location.get_property_id());
95-
json_result["description"] =
96-
json_stringt(step.pc->source_location.get_comment());
95+
const goto_trace_stept &step = goto_trace.get_last_step();
96+
json_result["property"] = json_stringt(step.property_id);
97+
json_result["description"] = json_stringt(step.comment);
9798
json_result["status"] = json_stringt("failed");
9899
json_stream_arrayt &json_trace =
99100
json_result.push_back_stream_array("trace");

0 commit comments

Comments
 (0)