-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1349 from peterschrammel/cleanup/use-preformatted…
…-output Make message streams accept XML and JSON data
- Loading branch information
Showing
13 changed files
with
175 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,18 +11,18 @@ Author: Georg Weissenbacher, [email protected] | |
|
||
#include "natural_loops.h" | ||
|
||
#include <iostream> | ||
|
||
void show_natural_loops(const goto_modelt &goto_model) | ||
void show_natural_loops( | ||
const goto_modelt &goto_model, | ||
std::ostream &out) | ||
{ | ||
forall_goto_functions(it, goto_model.goto_functions) | ||
{ | ||
std::cout << "*** " << it->first << '\n'; | ||
out << "*** " << it->first << '\n'; | ||
|
||
natural_loopst natural_loops; | ||
natural_loops(it->second.body); | ||
natural_loops.output(std::cout); | ||
natural_loops.output(out); | ||
|
||
std::cout << '\n'; | ||
out << '\n'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,6 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "all_properties_class.h" | ||
|
||
#include <iostream> | ||
|
||
#include <util/time_stopping.h> | ||
#include <util/xml.h> | ||
#include <util/json.h> | ||
|
@@ -163,10 +161,10 @@ void bmc_all_propertiest::report(const cover_goalst &cover_goals) | |
{ | ||
case ui_message_handlert::uit::PLAIN: | ||
{ | ||
status() << "\n** Results:" << eom; | ||
result() << "\n** Results:" << eom; | ||
|
||
for(const auto &goal_pair : goal_map) | ||
status() << "[" << goal_pair.first << "] " | ||
result() << "[" << goal_pair.first << "] " | ||
<< goal_pair.second.description << ": " | ||
<< goal_pair.second.status_string() | ||
<< eom; | ||
|
@@ -176,10 +174,11 @@ void bmc_all_propertiest::report(const cover_goalst &cover_goals) | |
for(const auto &g : goal_map) | ||
if(g.second.status==goalt::statust::FAILURE) | ||
{ | ||
std::cout << "\n" << "Trace for " << g.first << ":" << "\n"; | ||
show_goto_trace(std::cout, bmc.ns, g.second.goto_trace); | ||
result() << "\n" << "Trace for " << g.first << ":" << "\n"; | ||
show_goto_trace(result(), bmc.ns, g.second.goto_trace); | ||
} | ||
} | ||
result() << eom; | ||
|
||
status() << "\n** " << cover_goals.number_covered() | ||
<< " of " << cover_goals.size() << " failed (" | ||
|
@@ -200,7 +199,7 @@ void bmc_all_propertiest::report(const cover_goalst &cover_goals) | |
if(g.second.status==goalt::statust::FAILURE) | ||
convert(bmc.ns, g.second.goto_trace, xml_result.new_element()); | ||
|
||
std::cout << xml_result << "\n"; | ||
result() << xml_result; | ||
} | ||
break; | ||
} | ||
|
@@ -224,7 +223,7 @@ void bmc_all_propertiest::report(const cover_goalst &cover_goals) | |
} | ||
} | ||
|
||
std::cout << ",\n" << json_result; | ||
result() << json_result; | ||
} | ||
break; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,6 @@ Author: Daniel Kroening, [email protected] | |
|
||
#include "bmc.h" | ||
|
||
#include <iostream> | ||
|
||
#include <util/time_stopping.h> | ||
#include <util/xml.h> | ||
#include <util/xml_expr.h> | ||
|
@@ -185,10 +183,6 @@ void bmc_covert::satisfying_assignment() | |
goto_trace.steps.erase(++s_it1, goto_trace.steps.end()); | ||
break; | ||
} | ||
|
||
#if 0 | ||
show_goto_trace(std::cout, bmc.ns, test.goto_trace); | ||
#endif | ||
} | ||
|
||
bool bmc_covert::operator()() | ||
|
@@ -221,8 +215,6 @@ bool bmc_covert::operator()() | |
|
||
bmc.do_conversion(); | ||
|
||
// bmc.equation.output(std::cout); | ||
|
||
// get the conditions for these goals from formula | ||
// collect all 'instances' of the goals | ||
for(auto it = bmc.equation.SSA_steps.begin(); | ||
|
@@ -278,26 +270,25 @@ bool bmc_covert::operator()() | |
{ | ||
case ui_message_handlert::uit::PLAIN: | ||
{ | ||
status() << "\n** coverage results:" << eom; | ||
result() << "\n** coverage results:" << eom; | ||
|
||
for(const auto &g : goal_map) | ||
{ | ||
const goalt &goal=g.second; | ||
|
||
status() << "[" << g.first << "]"; | ||
result() << "[" << g.first << "]"; | ||
|
||
if(goal.source_location.is_not_nil()) | ||
status() << ' ' << goal.source_location; | ||
result() << ' ' << goal.source_location; | ||
|
||
if(!goal.description.empty()) | ||
status() << ' ' << goal.description; | ||
result() << ' ' << goal.description; | ||
|
||
status() << ": " << (goal.satisfied?"SATISFIED":"FAILED") | ||
<< eom; | ||
result() << ": " << (goal.satisfied?"SATISFIED":"FAILED") | ||
<< '\n'; | ||
} | ||
|
||
status() << '\n'; | ||
|
||
result() << eom; | ||
break; | ||
} | ||
|
||
|
@@ -315,7 +306,7 @@ bool bmc_covert::operator()() | |
if(goal.source_location.is_not_nil()) | ||
xml_result.new_element()=xml(goal.source_location); | ||
|
||
std::cout << xml_result << "\n"; | ||
result() << xml_result; | ||
} | ||
|
||
for(const auto &test : tests) | ||
|
@@ -348,7 +339,7 @@ bool bmc_covert::operator()() | |
xml_goal.set_attribute("id", id2string(goal_id)); | ||
} | ||
|
||
std::cout << xml_result << "\n"; | ||
result() << xml_result; | ||
} | ||
break; | ||
} | ||
|
@@ -404,7 +395,8 @@ bool bmc_covert::operator()() | |
goal_refs.push_back(json_stringt(id2string(goal_id))); | ||
} | ||
} | ||
std::cout << ",\n" << json_result; | ||
|
||
result() << json_result; | ||
break; | ||
} | ||
} | ||
|
@@ -422,10 +414,12 @@ bool bmc_covert::operator()() | |
|
||
if(bmc.ui==ui_message_handlert::uit::PLAIN) | ||
{ | ||
std::cout << "Test suite:" << '\n'; | ||
result() << "Test suite:" << '\n'; | ||
|
||
for(const auto &test : tests) | ||
std::cout << get_test(test.goto_trace) << '\n'; | ||
result() << get_test(test.goto_trace) << '\n'; | ||
|
||
result() << eom; | ||
} | ||
|
||
return false; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.