From 8cf5912072d1046545572e6aa018ddf1c68737a5 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Sat, 15 Sep 2018 12:58:43 -0700 Subject: 4546 Bring Mu's trace harness in line with recent changes in SubX. --- 003trace.cc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/003trace.cc b/003trace.cc index f0939e1c..be5f71a9 100644 --- a/003trace.cc +++ b/003trace.cc @@ -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 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)); } -- cgit 1.4.1-2-gfad0