about summary refs log tree commit diff stats
path: root/cpp
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-06 12:20:48 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-06 12:20:48 -0700
commit730b03bd75f67053eefee312650f383ad11555ee (patch)
tree8a8f559cc03137b0c89a0b302d4be34900209716 /cpp
parentc517316b09e35eee95cdae1b44f7c9357f9bddf6 (diff)
downloadmu-730b03bd75f67053eefee312650f383ad11555ee.tar.gz
1026
Diffstat (limited to 'cpp')
-rw-r--r--cpp/001test2
-rw-r--r--cpp/002trace3
2 files changed, 3 insertions, 2 deletions
diff --git a/cpp/001test b/cpp/001test
index 3611ca09..8222adcd 100644
--- a/cpp/001test
+++ b/cpp/001test
@@ -20,8 +20,6 @@ bool Passed = true;
 
 long Num_failures = 0;
 
-#define TEST(name) void test_##name() { Trace_file = #name;
-
 #define CHECK(X) \
   if (!(X)) { \
     ++Num_failures; \
diff --git a/cpp/002trace b/cpp/002trace
index 4946517c..c01de39e 100644
--- a/cpp/002trace
+++ b/cpp/002trace
@@ -200,6 +200,9 @@ 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