Bring Mu's trace harness in line with recent changes in SubX.
This commit is contained in:
Kartik Agaram 2018-09-15 12:58:43 -07:00
parent 76faa50bfb
commit 8cf5912072
1 changed files with 13 additions and 9 deletions

View File

@ -76,15 +76,6 @@ struct trace_line {
trace_line(int d, string l, string c) :depth(d), label(l), contents(c) {}
};
:(before "End Globals")
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;
Dump_label = "";
//: Support for tracing an entire run.
//: Traces can have a lot of overhead, so only turn them on when asked.
:(before "End Commandline Options(*arg)")
@ -183,6 +174,15 @@ string trace_stream::readable_contents(string label) {
trace_stream* Trace_stream = NULL;
int Trace_errors = 0; // used only when Trace_stream is NULL
:(before "End Globals")
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;
Dump_label = "";
:(before "End Includes")
#define CLEAR_TRACE delete Trace_stream, Trace_stream = new trace_stream;
@ -361,6 +361,10 @@ bool trace_doesnt_contain(string label, string line) {
bool trace_doesnt_contain(string expected) {
vector<string> tmp = split_first(expected, ": ");
if (SIZE(tmp) == 1) {
raise << expected << ": missing label or contents in trace line\n" << end();
assert(false);
}
return trace_doesnt_contain(tmp.at(0), tmp.at(1));
}