@@ -90,22 +90,28 @@ static void output_goals_json(
90
90
log .status () << messaget::eom; // force end of previous message
91
91
json_stream_objectt &json_result =
92
92
ui_message_handler.get_json_stream ().push_back_stream_object ();
93
+ json_stream_arrayt &goals_array = json_result.push_back_stream_array (" goals" );
93
94
for (const auto &property_pair : properties)
94
95
{
95
96
const property_infot &property_info = property_pair.second ;
96
97
97
- json_result[" status" ] = json_stringt (
98
+ json_objectt json_goal;
99
+ json_goal[" status" ] = json_stringt (
98
100
property_info.status == property_statust::FAIL ? " satisfied" : " failed" );
99
- json_result [" goal" ] = json_stringt (property_pair.first );
100
- json_result [" description" ] = json_stringt (property_info.description );
101
+ json_goal [" goal" ] = json_stringt (property_pair.first );
102
+ json_goal [" description" ] = json_stringt (property_info.description );
101
103
102
104
if (property_info.pc ->source_location .is_not_nil ())
103
- json_result[" sourceLocation" ] = json (property_info.pc ->source_location );
105
+ json_goal[" sourceLocation" ] = json (property_info.pc ->source_location );
106
+
107
+ goals_array.push_back (std::move (json_goal));
104
108
}
105
- json_result[" totalGoals" ] = json_numbert (std::to_string (properties.size ()));
106
109
const std::size_t goals_covered =
107
110
count_properties (properties, property_statust::FAIL);
108
- json_result[" goalsCovered" ] = json_numbert (std::to_string (goals_covered));
111
+ json_result.push_back (
112
+ " goalsCovered" , json_numbert (std::to_string (goals_covered)));
113
+ json_result.push_back (
114
+ " totalGoals" , json_numbert (std::to_string (properties.size ())));
109
115
}
110
116
111
117
void output_goals (
0 commit comments