diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-07-26 10:23:59 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-07-26 10:23:59 -0700 |
commit | 7c488ded4b893a28ba16d1c97cb9e80092fe70dd (patch) | |
tree | 3da7326a89e89225cab4278e8158c271d3431b05 | |
parent | 257add0f7e437f0a1a355a748be0c97e03882b0c (diff) | |
download | mu-7c488ded4b893a28ba16d1c97cb9e80092fe70dd.tar.gz |
4422
-rw-r--r-- | 003trace.cc | 11 | ||||
-rw-r--r-- | 050scenario.cc | 2 |
2 files changed, 5 insertions, 8 deletions
diff --git a/003trace.cc b/003trace.cc index 8fe3ebb0..c6a05d3c 100644 --- a/003trace.cc +++ b/003trace.cc @@ -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; } diff --git a/050scenario.cc b/050scenario.cc index 9b7d1c2e..791ac38a 100644 --- a/050scenario.cc +++ b/050scenario.cc @@ -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; |