This commit is contained in:
Kartik Agaram 2018-07-26 10:23:59 -07:00
parent 257add0f7e
commit 7c488ded4b
2 changed files with 5 additions and 8 deletions

View File

@ -77,9 +77,9 @@ struct trace_line {
};
:(before "End Globals")
bool Hide_errors = false;
bool Dump_trace = false;
string Dump_label = "";
bool Hide_errors = false; // if set, don't print even error trace lines to screen
bool Dump_trace = false; // if set, print trace lines to screen
string Dump_label = ""; // if set, print trace lines matching a single label to screen
:(before "End Reset")
Hide_errors = false;
Dump_trace = false;
@ -140,7 +140,7 @@ struct trace_stream {
}
void save() {
cerr << "saving trace to last_run\n";
cerr << "saving trace to 'last_run'\n";
ofstream fout("last_run");
fout << readable_contents("");
fout.close();
@ -231,7 +231,7 @@ ostream& operator<<(ostream& os, end /*unused*/) {
}
:(before "End Globals")
bool Save_trace = false;
bool Save_trace = false; // if set, write out trace to disk
// Trace_stream is a resource, lease_tracer uses RAII to manage it.
:(before "End Types")
@ -242,7 +242,6 @@ struct lease_tracer {
:(code)
lease_tracer::lease_tracer() { Trace_stream = new trace_stream; }
lease_tracer::~lease_tracer() {
if (!Trace_stream) return; // in case tests close Trace_stream
if (Save_trace) Trace_stream->save();
delete Trace_stream, Trace_stream = NULL;
}

View File

@ -197,8 +197,6 @@ if (Test_only_app && Num_core_mu_scenarios < SIZE(Scenarios)) {
:(after "Test Runs")
for (int i = 0; i < SIZE(Scenarios); ++i) {
if (Scenarios.at(i).name == argv[argc-1]) {
if (Save_trace)
Trace_stream = new trace_stream;
run_mu_scenario(Scenarios.at(i));
if (Passed) cerr << ".\n";
return 0;