about summary refs log tree commit diff stats
path: root/cpp/001test
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-22 12:43:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-22 12:43:38 -0700
commit2ed1aa9c5661ec9ee32fe9fbdc230c29d30d27e4 (patch)
tree7ec048db41ca8f475ae88405bb2bcd3061b99631 /cpp/001test
parent8b91d0cd3215c42525bfef6443a73987a1a72987 (diff)
downloadmu-2ed1aa9c5661ec9ee32fe9fbdc230c29d30d27e4.tar.gz
1130
Diffstat (limited to 'cpp/001test')
-rw-r--r--cpp/001test8
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/001test b/cpp/001test
index 38e5a2b6..0d45d070 100644
--- a/cpp/001test
+++ b/cpp/001test
@@ -16,8 +16,7 @@ const test_fn Tests[] = {
   #include "test_list"  // auto-generated; see makefile
 };
 
-bool Passed = true;
-
+bool Passed = true;  // set this to false inside any test to indicate failure
 long Num_failures = 0;
 
 #define CHECK(X) \
@@ -25,7 +24,7 @@ long Num_failures = 0;
     ++Num_failures; \
     cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << '\n'; \
     Passed = false; \
-    return; \
+    return;  /* Currently we stop at the very first failure. */ \
   }
 
 #define CHECK_EQ(X, Y) \
@@ -34,7 +33,7 @@ long Num_failures = 0;
     cerr << "\nF " << __FUNCTION__ << "(" << __FILE__ << ":" << __LINE__ << "): " << #X << " == " << #Y << '\n'; \
     cerr << "  got " << (X) << '\n';  /* BEWARE: multiple eval */ \
     Passed = false; \
-    return; \
+    return;  /* Currently we stop at the very first failure. */ \
   }
 
 :(before "End Main")
@@ -95,6 +94,7 @@ void run_test(size_t i) {
     return;
   }
   setup();
+  Passed = true;
   // End Test Setup
   (*Tests[i])();
   if (Passed) cerr << ".";