diff options
Diffstat (limited to '003trace.cc')
-rw-r--r-- | 003trace.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/003trace.cc b/003trace.cc index 76f3207f..8db6f54d 100644 --- a/003trace.cc +++ b/003trace.cc @@ -179,9 +179,12 @@ ostream& operator<<(ostream& os, unused die) { #define DUMP(layer) if (Trace_stream) cerr << Trace_stream->readable_contents(layer); -// Trace_stream is a resource, lease_tracer uses RAII to manage it. -string Trace_file; +// All scenarios save their traces in the repo, just like code. This gives +// future readers more meat when they try to make sense of a new project. static string Trace_dir = ".traces/"; +string Trace_file; + +// Trace_stream is a resource, lease_tracer uses RAII to manage it. struct lease_tracer { lease_tracer() { Trace_stream = new trace_stream; } ~lease_tracer() { @@ -196,9 +199,6 @@ struct lease_tracer { } }; -// To transparently save traces, start tests with the TEST() macro. -#define TEST(name) void test_##name() { Trace_file = #name; - #define START_TRACING_UNTIL_END_OF_SCOPE lease_tracer leased_tracer; :(before "End Test Setup") START_TRACING_UNTIL_END_OF_SCOPE |