You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/06/05 22:44:59 UTC

[lucy-commits] [2/6] Update files in clownfish/runtime/core

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestNum.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestNum.c b/clownfish/runtime/core/Clownfish/Test/TestNum.c
index 00721ce..9def22d 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestNum.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestNum.c
@@ -14,20 +14,25 @@
  * limitations under the License.
  */
 
-#define C_LUCY_TESTNUM
-
 #define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
+#define TESTCFISH_USE_SHORT_NAMES
 
-#include "Clownfish/Test.h"
-#include "Clownfish/Test/TestUtils.h"
 #include "Clownfish/Test/TestNum.h"
-#include "Clownfish/Num.h"
+
 #include "Clownfish/CharBuf.h"
+#include "Clownfish/Num.h"
+#include "Clownfish/Test.h"
+#include "Clownfish/TestHarness/TestBatchRunner.h"
+#include "Clownfish/TestHarness/TestUtils.h"
+#include "Clownfish/VTable.h"
+
+TestNum*
+TestNum_new() {
+    return (TestNum*)VTable_Make_Obj(TESTNUM);
+}
 
 static void
-test_To_String(TestBatch *batch) {
+test_To_String(TestBatchRunner *runner) {
     Float32   *f32 = Float32_new(1.33f);
     Float64   *f64 = Float64_new(1.33);
     Integer32 *i32 = Int32_new(INT32_MAX);
@@ -39,17 +44,17 @@ test_To_String(TestBatch *batch) {
     CharBuf *true_string  = Bool_To_String(CFISH_TRUE);
     CharBuf *false_string = Bool_To_String(CFISH_FALSE);
 
-    TEST_TRUE(batch, CB_Starts_With_Str(f32_string, "1.3", 3),
+    TEST_TRUE(runner, CB_Starts_With_Str(f32_string, "1.3", 3),
               "Float32_To_String");
-    TEST_TRUE(batch, CB_Starts_With_Str(f64_string, "1.3", 3),
+    TEST_TRUE(runner, CB_Starts_With_Str(f64_string, "1.3", 3),
               "Float64_To_String");
-    TEST_TRUE(batch, CB_Equals_Str(i32_string, "2147483647", 10),
+    TEST_TRUE(runner, CB_Equals_Str(i32_string, "2147483647", 10),
               "Int32_To_String");
-    TEST_TRUE(batch, CB_Equals_Str(i64_string, "9223372036854775807", 19),
+    TEST_TRUE(runner, CB_Equals_Str(i64_string, "9223372036854775807", 19),
               "Int64_To_String");
-    TEST_TRUE(batch, CB_Equals_Str(true_string, "true", 4),
+    TEST_TRUE(runner, CB_Equals_Str(true_string, "true", 4),
               "Bool_To_String [true]");
-    TEST_TRUE(batch, CB_Equals_Str(false_string, "false", 5),
+    TEST_TRUE(runner, CB_Equals_Str(false_string, "false", 5),
               "Bool_To_String [false]");
 
     DECREF(false_string);
@@ -65,7 +70,7 @@ test_To_String(TestBatch *batch) {
 }
 
 static void
-test_accessors(TestBatch *batch) {
+test_accessors(TestBatchRunner *runner) {
     Float32   *f32 = Float32_new(1.0);
     Float64   *f64 = Float64_new(1.0);
     Integer32 *i32 = Int32_new(1);
@@ -76,49 +81,49 @@ test_accessors(TestBatch *batch) {
     double got64;
 
     Float32_Set_Value(f32, 1.33f);
-    TEST_FLOAT_EQ(batch, Float32_Get_Value(f32), 1.33f,
+    TEST_FLOAT_EQ(runner, Float32_Get_Value(f32), 1.33f,
                   "F32 Set_Value Get_Value");
 
     Float64_Set_Value(f64, 1.33);
     got64 = Float64_Get_Value(f64);
-    TEST_TRUE(batch, *(int64_t*)&got64 == *(int64_t*)&wanted64,
+    TEST_TRUE(runner, *(int64_t*)&got64 == *(int64_t*)&wanted64,
               "F64 Set_Value Get_Value");
 
-    TEST_TRUE(batch, Float32_To_I64(f32) == 1, "Float32_To_I64");
-    TEST_TRUE(batch, Float64_To_I64(f64) == 1, "Float64_To_I64");
+    TEST_TRUE(runner, Float32_To_I64(f32) == 1, "Float32_To_I64");
+    TEST_TRUE(runner, Float64_To_I64(f64) == 1, "Float64_To_I64");
 
     got32 = (float)Float32_To_F64(f32);
-    TEST_TRUE(batch, *(int32_t*)&got32 == *(int32_t*)&wanted32,
+    TEST_TRUE(runner, *(int32_t*)&got32 == *(int32_t*)&wanted32,
               "Float32_To_F64");
 
     got64 = Float64_To_F64(f64);
-    TEST_TRUE(batch, *(int64_t*)&got64 == *(int64_t*)&wanted64,
+    TEST_TRUE(runner, *(int64_t*)&got64 == *(int64_t*)&wanted64,
               "Float64_To_F64");
 
     Int32_Set_Value(i32, INT32_MIN);
-    TEST_INT_EQ(batch, Int32_Get_Value(i32), INT32_MIN,
+    TEST_INT_EQ(runner, Int32_Get_Value(i32), INT32_MIN,
                 "I32 Set_Value Get_Value");
 
     Int64_Set_Value(i64, INT64_MIN);
-    TEST_TRUE(batch, Int64_Get_Value(i64) == INT64_MIN,
+    TEST_TRUE(runner, Int64_Get_Value(i64) == INT64_MIN,
               "I64 Set_Value Get_Value");
 
     Int32_Set_Value(i32, -1);
     Int64_Set_Value(i64, -1);
-    TEST_TRUE(batch, Int32_To_F64(i32) == -1, "Int32_To_F64");
-    TEST_TRUE(batch, Int64_To_F64(i64) == -1, "Int64_To_F64");
+    TEST_TRUE(runner, Int32_To_F64(i32) == -1, "Int32_To_F64");
+    TEST_TRUE(runner, Int64_To_F64(i64) == -1, "Int64_To_F64");
 
-    TEST_INT_EQ(batch, Bool_Get_Value(CFISH_TRUE), true,
+    TEST_INT_EQ(runner, Bool_Get_Value(CFISH_TRUE), true,
                 "Bool_Get_Value [true]");
-    TEST_INT_EQ(batch, Bool_Get_Value(CFISH_FALSE), false,
+    TEST_INT_EQ(runner, Bool_Get_Value(CFISH_FALSE), false,
                 "Bool_Get_Value [false]");
-    TEST_TRUE(batch, Bool_To_I64(CFISH_TRUE) == true,
+    TEST_TRUE(runner, Bool_To_I64(CFISH_TRUE) == true,
               "Bool_To_I64 [true]");
-    TEST_TRUE(batch, Bool_To_I64(CFISH_FALSE) == false,
+    TEST_TRUE(runner, Bool_To_I64(CFISH_FALSE) == false,
               "Bool_To_I64 [false]");
-    TEST_TRUE(batch, Bool_To_F64(CFISH_TRUE) == 1.0,
+    TEST_TRUE(runner, Bool_To_F64(CFISH_TRUE) == 1.0,
               "Bool_To_F64 [true]");
-    TEST_TRUE(batch, Bool_To_F64(CFISH_FALSE) == 0.0,
+    TEST_TRUE(runner, Bool_To_F64(CFISH_FALSE) == 0.0,
               "Bool_To_F64 [false]");
 
     DECREF(i64);
@@ -128,74 +133,74 @@ test_accessors(TestBatch *batch) {
 }
 
 static void
-test_Equals_and_Compare_To(TestBatch *batch) {
+test_Equals_and_Compare_To(TestBatchRunner *runner) {
     Float32   *f32 = Float32_new(1.0);
     Float64   *f64 = Float64_new(1.0);
     Integer32 *i32 = Int32_new(INT32_MAX);
     Integer64 *i64 = Int64_new(INT64_MAX);
 
-    TEST_TRUE(batch, Float32_Compare_To(f32, (Obj*)f64) == 0,
+    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) == 0,
               "F32_Compare_To equal");
-    TEST_TRUE(batch, Float32_Equals(f32, (Obj*)f64),
+    TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f64),
               "F32_Equals equal");
 
     Float64_Set_Value(f64, 2.0);
-    TEST_TRUE(batch, Float32_Compare_To(f32, (Obj*)f64) < 0,
+    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) < 0,
               "F32_Compare_To less than");
-    TEST_FALSE(batch, Float32_Equals(f32, (Obj*)f64),
+    TEST_FALSE(runner, Float32_Equals(f32, (Obj*)f64),
                "F32_Equals less than");
 
     Float64_Set_Value(f64, 0.0);
-    TEST_TRUE(batch, Float32_Compare_To(f32, (Obj*)f64) > 0,
+    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)f64) > 0,
               "F32_Compare_To greater than");
-    TEST_FALSE(batch, Float32_Equals(f32, (Obj*)f64),
+    TEST_FALSE(runner, Float32_Equals(f32, (Obj*)f64),
                "F32_Equals greater than");
 
     Float64_Set_Value(f64, 1.0);
     Float32_Set_Value(f32, 1.0);
-    TEST_TRUE(batch, Float64_Compare_To(f64, (Obj*)f32) == 0,
+    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) == 0,
               "F64_Compare_To equal");
-    TEST_TRUE(batch, Float64_Equals(f64, (Obj*)f32),
+    TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f32),
               "F64_Equals equal");
 
     Float32_Set_Value(f32, 2.0);
-    TEST_TRUE(batch, Float64_Compare_To(f64, (Obj*)f32) < 0,
+    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) < 0,
               "F64_Compare_To less than");
-    TEST_FALSE(batch, Float64_Equals(f64, (Obj*)f32),
+    TEST_FALSE(runner, Float64_Equals(f64, (Obj*)f32),
                "F64_Equals less than");
 
     Float32_Set_Value(f32, 0.0);
-    TEST_TRUE(batch, Float64_Compare_To(f64, (Obj*)f32) > 0,
+    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)f32) > 0,
               "F64_Compare_To greater than");
-    TEST_FALSE(batch, Float64_Equals(f64, (Obj*)f32),
+    TEST_FALSE(runner, Float64_Equals(f64, (Obj*)f32),
                "F64_Equals greater than");
 
     Float64_Set_Value(f64, INT64_MAX * 2.0);
-    TEST_TRUE(batch, Float64_Compare_To(f64, (Obj*)i64) > 0,
+    TEST_TRUE(runner, Float64_Compare_To(f64, (Obj*)i64) > 0,
               "Float64 comparison to Integer64");
-    TEST_TRUE(batch, Int64_Compare_To(i64, (Obj*)f64) < 0,
+    TEST_TRUE(runner, Int64_Compare_To(i64, (Obj*)f64) < 0,
               "Integer64 comparison to Float64");
 
     Float32_Set_Value(f32, INT32_MAX * 2.0f);
-    TEST_TRUE(batch, Float32_Compare_To(f32, (Obj*)i32) > 0,
+    TEST_TRUE(runner, Float32_Compare_To(f32, (Obj*)i32) > 0,
               "Float32 comparison to Integer32");
-    TEST_TRUE(batch, Int32_Compare_To(i32, (Obj*)f32) < 0,
+    TEST_TRUE(runner, Int32_Compare_To(i32, (Obj*)f32) < 0,
               "Integer32 comparison to Float32");
 
     Int64_Set_Value(i64, INT64_C(0x6666666666666666));
     Integer64 *i64_copy = Int64_new(INT64_C(0x6666666666666666));
-    TEST_TRUE(batch, Int64_Compare_To(i64, (Obj*)i64_copy) == 0,
+    TEST_TRUE(runner, Int64_Compare_To(i64, (Obj*)i64_copy) == 0,
               "Integer64 comparison to same number");
 
-    TEST_TRUE(batch, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_TRUE),
+    TEST_TRUE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_TRUE),
               "CFISH_TRUE Equals itself");
-    TEST_TRUE(batch, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_FALSE),
+    TEST_TRUE(runner, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_FALSE),
               "CFISH_FALSE Equals itself");
-    TEST_FALSE(batch, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_TRUE),
+    TEST_FALSE(runner, Bool_Equals(CFISH_FALSE, (Obj*)CFISH_TRUE),
                "CFISH_FALSE not Equals CFISH_TRUE ");
-    TEST_FALSE(batch, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_FALSE),
+    TEST_FALSE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CFISH_FALSE),
                "CFISH_TRUE not Equals CFISH_FALSE ");
-    TEST_FALSE(batch, Bool_Equals(CFISH_TRUE, (Obj*)CHARBUF),
+    TEST_FALSE(runner, Bool_Equals(CFISH_TRUE, (Obj*)CHARBUF),
                "CFISH_TRUE not Equals random other object ");
 
     DECREF(i64_copy);
@@ -206,7 +211,7 @@ test_Equals_and_Compare_To(TestBatch *batch) {
 }
 
 static void
-test_Clone(TestBatch *batch) {
+test_Clone(TestBatchRunner *runner) {
     Float32   *f32 = Float32_new(1.33f);
     Float64   *f64 = Float64_new(1.33);
     Integer32 *i32 = Int32_new(INT32_MAX);
@@ -215,15 +220,15 @@ test_Clone(TestBatch *batch) {
     Float64   *f64_dupe = Float64_Clone(f64);
     Integer32 *i32_dupe = Int32_Clone(i32);
     Integer64 *i64_dupe = Int64_Clone(i64);
-    TEST_TRUE(batch, Float32_Equals(f32, (Obj*)f32_dupe),
+    TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f32_dupe),
               "Float32 Clone");
-    TEST_TRUE(batch, Float64_Equals(f64, (Obj*)f64_dupe),
+    TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f64_dupe),
               "Float64 Clone");
-    TEST_TRUE(batch, Int32_Equals(i32, (Obj*)i32_dupe),
+    TEST_TRUE(runner, Int32_Equals(i32, (Obj*)i32_dupe),
               "Integer32 Clone");
-    TEST_TRUE(batch, Int64_Equals(i64, (Obj*)i64_dupe),
+    TEST_TRUE(runner, Int64_Equals(i64, (Obj*)i64_dupe),
               "Integer64 Clone");
-    TEST_TRUE(batch, Bool_Equals(CFISH_TRUE, (Obj*)Bool_Clone(CFISH_TRUE)),
+    TEST_TRUE(runner, Bool_Equals(CFISH_TRUE, (Obj*)Bool_Clone(CFISH_TRUE)),
               "BoolNum Clone");
     DECREF(i64_dupe);
     DECREF(i32_dupe);
@@ -236,7 +241,7 @@ test_Clone(TestBatch *batch) {
 }
 
 static void
-test_Mimic(TestBatch *batch) {
+test_Mimic(TestBatchRunner *runner) {
     Float32   *f32 = Float32_new(1.33f);
     Float64   *f64 = Float64_new(1.33);
     Integer32 *i32 = Int32_new(INT32_MAX);
@@ -249,13 +254,13 @@ test_Mimic(TestBatch *batch) {
     Float64_Mimic(f64_dupe, (Obj*)f64);
     Int32_Mimic(i32_dupe, (Obj*)i32);
     Int64_Mimic(i64_dupe, (Obj*)i64);
-    TEST_TRUE(batch, Float32_Equals(f32, (Obj*)f32_dupe),
+    TEST_TRUE(runner, Float32_Equals(f32, (Obj*)f32_dupe),
               "Float32 Mimic");
-    TEST_TRUE(batch, Float64_Equals(f64, (Obj*)f64_dupe),
+    TEST_TRUE(runner, Float64_Equals(f64, (Obj*)f64_dupe),
               "Float64 Mimic");
-    TEST_TRUE(batch, Int32_Equals(i32, (Obj*)i32_dupe),
+    TEST_TRUE(runner, Int32_Equals(i32, (Obj*)i32_dupe),
               "Integer32 Mimic");
-    TEST_TRUE(batch, Int64_Equals(i64, (Obj*)i64_dupe),
+    TEST_TRUE(runner, Int64_Equals(i64, (Obj*)i64_dupe),
               "Integer64 Mimic");
     DECREF(i64_dupe);
     DECREF(i32_dupe);
@@ -268,17 +273,13 @@ test_Mimic(TestBatch *batch) {
 }
 
 void
-TestNum_run_tests() {
-    TestBatch *batch = TestBatch_new(53);
-    TestBatch_Plan(batch);
-
-    test_To_String(batch);
-    test_accessors(batch);
-    test_Equals_and_Compare_To(batch);
-    test_Clone(batch);
-    test_Mimic(batch);
-
-    DECREF(batch);
+TestNum_run(TestNum *self, TestBatchRunner *runner) {
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 53);
+    test_To_String(runner);
+    test_accessors(runner);
+    test_Equals_and_Compare_To(runner);
+    test_Clone(runner);
+    test_Mimic(runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestNum.cfh b/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
index a088789..6d1f663 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
+++ b/clownfish/runtime/core/Clownfish/Test/TestNum.cfh
@@ -14,11 +14,16 @@
  * limitations under the License.
  */
 
-parcel Clownfish;
+parcel TestClownfish;
 
-inert class Clownfish::Test::TestNum {
-    inert void
-    run_tests();
+class Clownfish::Test::TestNum
+    inherits Clownfish::TestHarness::TestBatch {
+
+    inert incremented TestNum*
+    new();
+
+    void
+    Run(TestNum *self, TestBatchRunner *runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestObj.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.c b/clownfish/runtime/core/Clownfish/Test/TestObj.c
index b2a4414..f1d6d90 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestObj.c
@@ -16,16 +16,22 @@
 
 #include <stdio.h>
 
-#define C_LUCY_TESTOBJ
-#define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
 #define CHY_USE_SHORT_NAMES
+#define CFISH_USE_SHORT_NAMES
+#define TESTCFISH_USE_SHORT_NAMES
 
-#include "Clownfish/Test.h"
 #include "Clownfish/Test/TestObj.h"
+
 #include "Clownfish/CharBuf.h"
-#include "Clownfish/VTable.h"
 #include "Clownfish/Err.h"
+#include "Clownfish/Test.h"
+#include "Clownfish/TestHarness/TestBatchRunner.h"
+#include "Clownfish/VTable.h"
+
+TestObj*
+TestObj_new() {
+    return (TestObj*)VTable_Make_Obj(TESTOBJ);
+}
 
 static Obj*
 S_new_testobj() {
@@ -40,23 +46,23 @@ S_new_testobj() {
 }
 
 static void
-test_refcounts(TestBatch *batch) {
+test_refcounts(TestBatchRunner *runner) {
     Obj *obj = S_new_testobj();
 
-    TEST_INT_EQ(batch, Obj_Get_RefCount(obj), 1,
+    TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 1,
                 "Correct starting refcount");
 
     Obj_Inc_RefCount(obj);
-    TEST_INT_EQ(batch, Obj_Get_RefCount(obj), 2, "Inc_RefCount");
+    TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 2, "Inc_RefCount");
 
     Obj_Dec_RefCount(obj);
-    TEST_INT_EQ(batch, Obj_Get_RefCount(obj), 1, "Dec_RefCount");
+    TEST_INT_EQ(runner, Obj_Get_RefCount(obj), 1, "Dec_RefCount");
 
     DECREF(obj);
 }
 
 static void
-test_To_String(TestBatch *batch) {
+test_To_String(TestBatchRunner *runner) {
     Obj *testobj = S_new_testobj();
     CharBuf *string = Obj_To_String(testobj);
     ZombieCharBuf *temp = ZCB_WRAP(string);
@@ -64,17 +70,17 @@ test_To_String(TestBatch *batch) {
         if (ZCB_Starts_With_Str(temp, "TestObj", 7)) { break; }
         ZCB_Nip_One(temp);
     }
-    TEST_TRUE(batch, ZCB_Starts_With_Str(temp, "TestObj", 7), "To_String");
+    TEST_TRUE(runner, ZCB_Starts_With_Str(temp, "TestObj", 7), "To_String");
     DECREF(string);
     DECREF(testobj);
 }
 
 static void
-test_Dump(TestBatch *batch) {
+test_Dump(TestBatchRunner *runner) {
     Obj *testobj = S_new_testobj();
     CharBuf *string = Obj_To_String(testobj);
     Obj *dump = Obj_Dump(testobj);
-    TEST_TRUE(batch, Obj_Equals(dump, (Obj*)string),
+    TEST_TRUE(runner, Obj_Equals(dump, (Obj*)string),
               "Default Dump returns To_String");
     DECREF(dump);
     DECREF(string);
@@ -82,13 +88,13 @@ test_Dump(TestBatch *batch) {
 }
 
 static void
-test_Equals(TestBatch *batch) {
+test_Equals(TestBatchRunner *runner) {
     Obj *testobj = S_new_testobj();
     Obj *other   = S_new_testobj();
 
-    TEST_TRUE(batch, Obj_Equals(testobj, testobj),
+    TEST_TRUE(runner, Obj_Equals(testobj, testobj),
               "Equals is true for the same object");
-    TEST_FALSE(batch, Obj_Equals(testobj, other),
+    TEST_FALSE(runner, Obj_Equals(testobj, other),
                "Distinct objects are not equal");
 
     DECREF(testobj);
@@ -96,25 +102,25 @@ test_Equals(TestBatch *batch) {
 }
 
 static void
-test_Hash_Sum(TestBatch *batch) {
+test_Hash_Sum(TestBatchRunner *runner) {
     Obj *testobj = S_new_testobj();
     int64_t address64 = PTR_TO_I64(testobj);
     int32_t address32 = (int32_t)address64;
-    TEST_TRUE(batch, (Obj_Hash_Sum(testobj) == address32),
+    TEST_TRUE(runner, (Obj_Hash_Sum(testobj) == address32),
               "Hash_Sum uses memory address");
     DECREF(testobj);
 }
 
 static void
-test_Is_A(TestBatch *batch) {
+test_Is_A(TestBatchRunner *runner) {
     CharBuf *charbuf   = CB_new(0);
     VTable  *bb_vtable = CB_Get_VTable(charbuf);
     CharBuf *klass     = CB_Get_Class_Name(charbuf);
 
-    TEST_TRUE(batch, CB_Is_A(charbuf, CHARBUF), "CharBuf Is_A CharBuf.");
-    TEST_TRUE(batch, CB_Is_A(charbuf, OBJ), "CharBuf Is_A Obj.");
-    TEST_TRUE(batch, bb_vtable == CHARBUF, "Get_VTable");
-    TEST_TRUE(batch, CB_Equals(VTable_Get_Name(CHARBUF), (Obj*)klass),
+    TEST_TRUE(runner, CB_Is_A(charbuf, CHARBUF), "CharBuf Is_A CharBuf.");
+    TEST_TRUE(runner, CB_Is_A(charbuf, OBJ), "CharBuf Is_A Obj.");
+    TEST_TRUE(runner, bb_vtable == CHARBUF, "Get_VTable");
+    TEST_TRUE(runner, CB_Equals(VTable_Get_Name(CHARBUF), (Obj*)klass),
               "Get_Class_Name");
 
     DECREF(charbuf);
@@ -161,12 +167,12 @@ S_attempt_Mimic(void *context) {
 }
 
 static void
-S_verify_abstract_error(TestBatch *batch, Err_Attempt_t routine,
+S_verify_abstract_error(TestBatchRunner *runner, Err_Attempt_t routine,
                         void *context, const char *name) {
     char message[100];
     sprintf(message, "%s() is abstract", name);
     Err *error = Err_trap(routine, context);
-    TEST_TRUE(batch, error != NULL
+    TEST_TRUE(runner, error != NULL
               && Err_Is_A(error, ERR) 
               && CB_Find_Str(Err_Get_Mess(error), "bstract", 7) != -1,
               message);
@@ -174,36 +180,31 @@ S_verify_abstract_error(TestBatch *batch, Err_Attempt_t routine,
 }
 
 static void
-test_abstract_routines(TestBatch *batch) {
+test_abstract_routines(TestBatchRunner *runner) {
     Obj *blank = VTable_Make_Obj(OBJ);
-    S_verify_abstract_error(batch, S_attempt_init, blank, "init");
+    S_verify_abstract_error(runner, S_attempt_init, blank, "init");
 
     Obj *obj = S_new_testobj();
-    S_verify_abstract_error(batch, S_attempt_Clone,      obj, "Clone");
-    S_verify_abstract_error(batch, S_attempt_Make,       obj, "Make");
-    S_verify_abstract_error(batch, S_attempt_Compare_To, obj, "Compare_To");
-    S_verify_abstract_error(batch, S_attempt_To_I64,     obj, "To_I64");
-    S_verify_abstract_error(batch, S_attempt_To_F64,     obj, "To_F64");
-    S_verify_abstract_error(batch, S_attempt_Load,       obj, "Load");
-    S_verify_abstract_error(batch, S_attempt_Mimic,      obj, "Mimic");
+    S_verify_abstract_error(runner, S_attempt_Clone,      obj, "Clone");
+    S_verify_abstract_error(runner, S_attempt_Make,       obj, "Make");
+    S_verify_abstract_error(runner, S_attempt_Compare_To, obj, "Compare_To");
+    S_verify_abstract_error(runner, S_attempt_To_I64,     obj, "To_I64");
+    S_verify_abstract_error(runner, S_attempt_To_F64,     obj, "To_F64");
+    S_verify_abstract_error(runner, S_attempt_Load,       obj, "Load");
+    S_verify_abstract_error(runner, S_attempt_Mimic,      obj, "Mimic");
     DECREF(obj);
 }
 
 void
-TestObj_run_tests() {
-    TestBatch *batch = TestBatch_new(20);
-
-    TestBatch_Plan(batch);
-
-    test_refcounts(batch);
-    test_To_String(batch);
-    test_Dump(batch);
-    test_Equals(batch);
-    test_Hash_Sum(batch);
-    test_Is_A(batch);
-    test_abstract_routines(batch);
-
-    DECREF(batch);
+TestObj_run(TestObj *self, TestBatchRunner *runner) {
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 20);
+    test_refcounts(runner);
+    test_To_String(runner);
+    test_Dump(runner);
+    test_Equals(runner);
+    test_Hash_Sum(runner);
+    test_Is_A(runner);
+    test_abstract_routines(runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestObj.cfh b/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
index 20afa06..eb4a0b6 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
+++ b/clownfish/runtime/core/Clownfish/Test/TestObj.cfh
@@ -14,11 +14,16 @@
  * limitations under the License.
  */
 
-parcel Clownfish;
+parcel TestClownfish;
 
-inert class Clownfish::Test::TestObj {
-    inert void
-    run_tests();
+class Clownfish::Test::TestObj
+    inherits Clownfish::TestHarness::TestBatch {
+
+    inert incremented TestObj*
+    new();
+
+    void
+    Run(TestObj *self, TestBatchRunner *runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestUtils.c b/clownfish/runtime/core/Clownfish/Test/TestUtils.c
deleted file mode 100644
index db1000a..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestUtils.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <string.h>
-#include <stdlib.h>
-
-#define C_LUCY_TESTUTILS
-#define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
-
-#include "Clownfish/Test/TestUtils.h"
-#include "Clownfish/Test.h"
-#include "Clownfish/Util/Memory.h"
-#include "Clownfish/CharBuf.h"
-
-uint64_t
-TestUtils_random_u64() {
-    uint64_t num = ((uint64_t)(rand()   & 0x7FFF) << 60)
-                   | ((uint64_t)(rand() & 0x7FFF) << 45)
-                   | ((uint64_t)(rand() & 0x7FFF) << 30)
-                   | ((uint64_t)(rand() & 0x7FFF) << 15)
-                   | ((uint64_t)(rand() & 0x7FFF) << 0);
-    return num;
-}
-
-int64_t*
-TestUtils_random_i64s(int64_t *buf, size_t count, int64_t min,
-                      int64_t limit) {
-    uint64_t  range = min < limit ? limit - min : 0;
-    int64_t *ints = buf ? buf : (int64_t*)CALLOCATE(count, sizeof(int64_t));
-    for (size_t i = 0; i < count; i++) {
-        ints[i] = min + TestUtils_random_u64() % range;
-    }
-    return ints;
-}
-
-uint64_t*
-TestUtils_random_u64s(uint64_t *buf, size_t count, uint64_t min,
-                      uint64_t limit) {
-    uint64_t  range = min < limit ? limit - min : 0;
-    uint64_t *ints = buf ? buf : (uint64_t*)CALLOCATE(count, sizeof(uint64_t));
-    for (size_t i = 0; i < count; i++) {
-        ints[i] = min + TestUtils_random_u64() % range;
-    }
-    return ints;
-}
-
-double*
-TestUtils_random_f64s(double *buf, size_t count) {
-    double *f64s = buf ? buf : (double*)CALLOCATE(count, sizeof(double));
-    for (size_t i = 0; i < count; i++) {
-        uint64_t num = TestUtils_random_u64();
-        f64s[i] = (double)num / UINT64_MAX;
-    }
-    return f64s;
-}
-
-uint32_t
-S_random_code_point(void) {
-    uint32_t code_point = 0;
-    while (1) {
-        uint8_t chance = (rand() % 9) + 1;
-        switch (chance) {
-            case 1: case 2: case 3:
-                code_point = rand() % 0x80;
-                break;
-            case 4: case 5: case 6:
-                code_point = (rand() % (0x0800  - 0x0080)) + 0x0080;
-                break;
-            case 7: case 8:
-                code_point = (rand() % (0x10000 - 0x0800)) + 0x0800;
-                break;
-            case 9: {
-                    uint64_t num = TestUtils_random_u64();
-                    code_point = (num % (0x10FFFF - 0x10000)) + 0x10000;
-                }
-        }
-        if (code_point > 0x10FFFF) {
-            continue; // Too high.
-        }
-        if (code_point > 0xD7FF && code_point < 0xE000) {
-            continue; // UTF-16 surrogate.
-        }
-        break;
-    }
-    return code_point;
-}
-
-CharBuf*
-TestUtils_random_string(size_t length) {
-    CharBuf *string = CB_new(length);
-    while (length--) {
-        CB_Cat_Char(string, S_random_code_point());
-    }
-    return string;
-}
-
-CharBuf*
-TestUtils_get_cb(const char *ptr) {
-    return CB_new_from_utf8(ptr, strlen(ptr));
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestUtils.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestUtils.cfh b/clownfish/runtime/core/Clownfish/Test/TestUtils.cfh
deleted file mode 100644
index 7f4d8b2..0000000
--- a/clownfish/runtime/core/Clownfish/Test/TestUtils.cfh
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-parcel Clownfish;
-
-inert class Clownfish::Test::TestUtils  {
-
-    /** Testing-only CharBuf factory which uses strlen().
-     */
-    inert incremented CharBuf*
-    get_cb(const char *utf8);
-
-    /** Return a random unsigned 64-bit integer.
-     */
-    inert uint64_t
-    random_u64();
-
-    /** Return an array of <code>count</code> random 64-bit integers where
-     * <code>min <= n < limit</code>.
-     *
-     * If <code>buf</code> is NULL, it will be allocated, otherwise it will
-     * be used.
-     */
-    inert int64_t*
-    random_i64s(int64_t *buf, size_t count, int64_t min, int64_t limit);
-
-    /** Return an array of <code>count</code> random unsigned, 64-bit integers
-     * where <code>min <= n < limit</code>.
-     *
-     * If <code>buf</code> is NULL, it will be allocated, otherwise it will
-     * be used.
-     */
-    inert uint64_t*
-    random_u64s(uint64_t *buf, size_t count, uint64_t min, uint64_t limit);
-
-    /** Return an array of <code>count</code> random double-precision floating
-     * point numbers between 0 and 1.
-     *
-     * If <code>buf</code> is NULL, it will be allocated, otherwise it will
-     * be used.
-     */
-    inert double*
-    random_f64s(double *buf, size_t count);
-
-    /** Return a string with a random (legal) sequence of code points.
-     * @param length Length of the string in code points.
-     */
-    inert incremented CharBuf*
-    random_string(size_t length);
-}
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestVArray.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.c b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
index b30d7b1..b012d7c 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.c
+++ b/clownfish/runtime/core/Clownfish/Test/TestVArray.c
@@ -16,18 +16,24 @@
 
 #include <string.h>
 
-#define C_LUCY_TESTVARRAY
 #define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
+#define TESTCFISH_USE_SHORT_NAMES
 
-#include "Clownfish/Test.h"
-#include "Clownfish/Test/TestUtils.h"
 #include "Clownfish/Test/TestVArray.h"
-#include "Clownfish/VArray.h"
+
 #include "Clownfish/CharBuf.h"
-#include "Clownfish/Num.h"
 #include "Clownfish/Err.h"
+#include "Clownfish/Num.h"
+#include "Clownfish/Test.h"
+#include "Clownfish/TestHarness/TestBatchRunner.h"
+#include "Clownfish/TestHarness/TestUtils.h"
+#include "Clownfish/VArray.h"
+#include "Clownfish/VTable.h"
+
+TestVArray*
+TestVArray_new() {
+    return (TestVArray*)VTable_Make_Obj(TESTVARRAY);
+}
 
 static CharBuf*
 S_new_cb(const char *text) {
@@ -35,38 +41,38 @@ S_new_cb(const char *text) {
 }
 
 static void
-test_Equals(TestBatch *batch) {
+test_Equals(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
     VArray *other = VA_new(0);
     ZombieCharBuf *stuff = ZCB_WRAP_STR("stuff", 5);
 
-    TEST_TRUE(batch, VA_Equals(array, (Obj*)other),
+    TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
               "Empty arrays are equal");
 
     VA_Push(array, (Obj*)CFISH_TRUE);
-    TEST_FALSE(batch, VA_Equals(array, (Obj*)other),
+    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
                "Add one elem and Equals returns false");
 
     VA_Push(other, (Obj*)CFISH_TRUE);
-    TEST_TRUE(batch, VA_Equals(array, (Obj*)other),
+    TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
               "Add a matching elem and Equals returns true");
 
     VA_Store(array, 2, (Obj*)CFISH_TRUE);
-    TEST_FALSE(batch, VA_Equals(array, (Obj*)other),
+    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
                "Add elem after a NULL and Equals returns false");
 
     VA_Store(other, 2, (Obj*)CFISH_TRUE);
-    TEST_TRUE(batch, VA_Equals(array, (Obj*)other),
+    TEST_TRUE(runner, VA_Equals(array, (Obj*)other),
               "Empty elems don't spoil Equals");
 
     VA_Store(other, 2, INCREF(stuff));
-    TEST_FALSE(batch, VA_Equals(array, (Obj*)other),
+    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
                "Non-matching value spoils Equals");
 
     VA_Excise(array, 1, 2); // removes empty elems
     VA_Delete(other, 1);    // leaves NULL in place of deleted elem
     VA_Delete(other, 2);
-    TEST_FALSE(batch, VA_Equals(array, (Obj*)other),
+    TEST_FALSE(runner, VA_Equals(array, (Obj*)other),
                "Empty trailing elements spoil Equals");
 
     DECREF(array);
@@ -74,63 +80,63 @@ test_Equals(TestBatch *batch) {
 }
 
 static void
-test_Store_Fetch(TestBatch *batch) {
+test_Store_Fetch(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
     CharBuf *elem;
 
-    TEST_TRUE(batch, VA_Fetch(array, 2) == NULL, "Fetch beyond end");
+    TEST_TRUE(runner, VA_Fetch(array, 2) == NULL, "Fetch beyond end");
 
     VA_Store(array, 2, (Obj*)CB_newf("foo"));
     elem = (CharBuf*)CERTIFY(VA_Fetch(array, 2), CHARBUF);
-    TEST_INT_EQ(batch, 3, VA_Get_Size(array), "Store updates size");
-    TEST_TRUE(batch, CB_Equals_Str(elem, "foo", 3), "Store");
+    TEST_INT_EQ(runner, 3, VA_Get_Size(array), "Store updates size");
+    TEST_TRUE(runner, CB_Equals_Str(elem, "foo", 3), "Store");
 
     INCREF(elem);
-    TEST_INT_EQ(batch, 2, CB_Get_RefCount(elem),
+    TEST_INT_EQ(runner, 2, CB_Get_RefCount(elem),
                 "start with refcount of 2");
     VA_Store(array, 2, (Obj*)CB_newf("bar"));
-    TEST_INT_EQ(batch, 1, CB_Get_RefCount(elem),
+    TEST_INT_EQ(runner, 1, CB_Get_RefCount(elem),
                 "Displacing elem via Store updates refcount");
     DECREF(elem);
     elem = (CharBuf*)CERTIFY(VA_Fetch(array, 2), CHARBUF);
-    TEST_TRUE(batch, CB_Equals_Str(elem, "bar", 3), "Store displacement");
+    TEST_TRUE(runner, CB_Equals_Str(elem, "bar", 3), "Store displacement");
 
     DECREF(array);
 }
 
 static void
-test_Push_Pop_Shift_Unshift(TestBatch *batch) {
+test_Push_Pop_Shift_Unshift(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
     CharBuf *elem;
 
-    TEST_INT_EQ(batch, VA_Get_Size(array), 0, "size starts at 0");
+    TEST_INT_EQ(runner, VA_Get_Size(array), 0, "size starts at 0");
     VA_Push(array, (Obj*)CB_newf("a"));
     VA_Push(array, (Obj*)CB_newf("b"));
     VA_Push(array, (Obj*)CB_newf("c"));
 
-    TEST_INT_EQ(batch, VA_Get_Size(array), 3, "size after Push");
-    TEST_TRUE(batch, NULL != CERTIFY(VA_Fetch(array, 2), CHARBUF), "Push");
+    TEST_INT_EQ(runner, VA_Get_Size(array), 3, "size after Push");
+    TEST_TRUE(runner, NULL != CERTIFY(VA_Fetch(array, 2), CHARBUF), "Push");
 
     elem = (CharBuf*)CERTIFY(VA_Shift(array), CHARBUF);
-    TEST_TRUE(batch, CB_Equals_Str(elem, "a", 1), "Shift");
-    TEST_INT_EQ(batch, VA_Get_Size(array), 2, "size after Shift");
+    TEST_TRUE(runner, CB_Equals_Str(elem, "a", 1), "Shift");
+    TEST_INT_EQ(runner, VA_Get_Size(array), 2, "size after Shift");
     DECREF(elem);
 
     elem = (CharBuf*)CERTIFY(VA_Pop(array), CHARBUF);
-    TEST_TRUE(batch, CB_Equals_Str(elem, "c", 1), "Pop");
-    TEST_INT_EQ(batch, VA_Get_Size(array), 1, "size after Pop");
+    TEST_TRUE(runner, CB_Equals_Str(elem, "c", 1), "Pop");
+    TEST_INT_EQ(runner, VA_Get_Size(array), 1, "size after Pop");
     DECREF(elem);
 
     VA_Unshift(array, (Obj*)CB_newf("foo"));
     elem = (CharBuf*)CERTIFY(VA_Fetch(array, 0), CHARBUF);
-    TEST_TRUE(batch, CB_Equals_Str(elem, "foo", 3), "Unshift");
-    TEST_INT_EQ(batch, VA_Get_Size(array), 2, "size after Shift");
+    TEST_TRUE(runner, CB_Equals_Str(elem, "foo", 3), "Unshift");
+    TEST_INT_EQ(runner, VA_Get_Size(array), 2, "size after Shift");
 
     DECREF(array);
 }
 
 static void
-test_Delete(TestBatch *batch) {
+test_Delete(TestBatchRunner *runner) {
     VArray *wanted = VA_new(5);
     VArray *got    = VA_new(5);
     uint32_t i;
@@ -141,34 +147,34 @@ test_Delete(TestBatch *batch) {
     VA_Store(wanted, 4, (Obj*)CB_newf("4", i));
     DECREF(VA_Delete(got, 2));
     DECREF(VA_Delete(got, 3));
-    TEST_TRUE(batch, VA_Equals(wanted, (Obj*)got), "Delete");
+    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "Delete");
 
     DECREF(wanted);
     DECREF(got);
 }
 
 static void
-test_Resize(TestBatch *batch) {
+test_Resize(TestBatchRunner *runner) {
     VArray *array = VA_new(3);
     uint32_t i;
 
     for (i = 0; i < 2; i++) { VA_Push(array, (Obj*)CB_newf("%u32", i)); }
-    TEST_INT_EQ(batch, VA_Get_Capacity(array), 3, "Start with capacity 3");
+    TEST_INT_EQ(runner, VA_Get_Capacity(array), 3, "Start with capacity 3");
 
     VA_Resize(array, 4);
-    TEST_INT_EQ(batch, VA_Get_Size(array), 4, "Resize up");
-    TEST_INT_EQ(batch, VA_Get_Capacity(array), 4,
+    TEST_INT_EQ(runner, VA_Get_Size(array), 4, "Resize up");
+    TEST_INT_EQ(runner, VA_Get_Capacity(array), 4,
                 "Resize changes capacity");
 
     VA_Resize(array, 2);
-    TEST_INT_EQ(batch, VA_Get_Size(array), 2, "Resize down");
-    TEST_TRUE(batch, VA_Fetch(array, 2) == NULL, "Resize down zaps elem");
+    TEST_INT_EQ(runner, VA_Get_Size(array), 2, "Resize down");
+    TEST_TRUE(runner, VA_Fetch(array, 2) == NULL, "Resize down zaps elem");
 
     DECREF(array);
 }
 
 static void
-test_Excise(TestBatch *batch) {
+test_Excise(TestBatchRunner *runner) {
     VArray *wanted = VA_new(5);
     VArray *got    = VA_new(5);
 
@@ -178,7 +184,7 @@ test_Excise(TestBatch *batch) {
     }
 
     VA_Excise(got, 7, 1);
-    TEST_TRUE(batch, VA_Equals(wanted, (Obj*)got),
+    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
               "Excise outside of range is no-op");
 
     VA_Excise(got, 2, 2);
@@ -186,18 +192,18 @@ test_Excise(TestBatch *batch) {
     DECREF(VA_Delete(wanted, 3));
     VA_Store(wanted, 2, VA_Delete(wanted, 4));
     VA_Resize(wanted, 3);
-    TEST_TRUE(batch, VA_Equals(wanted, (Obj*)got),
+    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
               "Excise multiple elems");
 
     VA_Excise(got, 2, 2);
     VA_Resize(wanted, 2);
-    TEST_TRUE(batch, VA_Equals(wanted, (Obj*)got),
+    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
               "Splicing too many elems truncates");
 
     VA_Excise(got, 0, 1);
     VA_Store(wanted, 0, VA_Delete(wanted, 1));
     VA_Resize(wanted, 1);
-    TEST_TRUE(batch, VA_Equals(wanted, (Obj*)got),
+    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got),
               "Excise first elem");
 
     DECREF(got);
@@ -205,7 +211,7 @@ test_Excise(TestBatch *batch) {
 }
 
 static void
-test_Push_VArray(TestBatch *batch) {
+test_Push_VArray(TestBatchRunner *runner) {
     VArray *wanted  = VA_new(0);
     VArray *got     = VA_new(0);
     VArray *scratch = VA_new(0);
@@ -216,7 +222,7 @@ test_Push_VArray(TestBatch *batch) {
     for (i = 2; i < 4; i++) { VA_Push(scratch, (Obj*)CB_newf("%u32", i)); }
 
     VA_Push_VArray(got, scratch);
-    TEST_TRUE(batch, VA_Equals(wanted, (Obj*)got), "Push_VArray");
+    TEST_TRUE(runner, VA_Equals(wanted, (Obj*)got), "Push_VArray");
 
     DECREF(wanted);
     DECREF(got);
@@ -224,17 +230,17 @@ test_Push_VArray(TestBatch *batch) {
 }
 
 static void
-test_Slice(TestBatch *batch) {
+test_Slice(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
     for (uint32_t i = 0; i < 10; i++) { VA_Push(array, (Obj*)CB_newf("%u32", i)); }
     {
         VArray *slice = VA_Slice(array, 0, 10);
-        TEST_TRUE(batch, VA_Equals(array, (Obj*)slice), "Slice entire array");
+        TEST_TRUE(runner, VA_Equals(array, (Obj*)slice), "Slice entire array");
         DECREF(slice);
     }
     {
         VArray *slice = VA_Slice(array, 0, 11);
-        TEST_TRUE(batch, VA_Equals(array, (Obj*)slice),
+        TEST_TRUE(runner, VA_Equals(array, (Obj*)slice),
             "Exceed length");
         DECREF(slice);
     }
@@ -242,26 +248,26 @@ test_Slice(TestBatch *batch) {
         VArray *wanted = VA_new(0);
         VA_Push(wanted, (Obj*)CB_newf("9"));
         VArray *slice = VA_Slice(array, 9, 11);
-        TEST_TRUE(batch, VA_Equals(slice, (Obj*)wanted),
+        TEST_TRUE(runner, VA_Equals(slice, (Obj*)wanted),
             "Exceed length, start near end");
         DECREF(slice);
         DECREF(wanted);
     }
     {
         VArray *slice = VA_Slice(array, 0, 0);
-        TEST_TRUE(batch, VA_Get_Size(slice) == 0, "empty slice");
+        TEST_TRUE(runner, VA_Get_Size(slice) == 0, "empty slice");
         DECREF(slice);
     }
     {
         VArray *slice = VA_Slice(array, 20, 1);
-        TEST_TRUE(batch, VA_Get_Size(slice) ==  0, "exceed offset");
+        TEST_TRUE(runner, VA_Get_Size(slice) ==  0, "exceed offset");
         DECREF(slice);
     }
     {
         VArray *wanted = VA_new(0);
         VA_Push(wanted, (Obj*)CB_newf("9"));
         VArray *slice = VA_Slice(array, 9, UINT32_MAX - 1);
-        TEST_TRUE(batch, VA_Get_Size(slice) == 1, "guard against overflow");
+        TEST_TRUE(runner, VA_Get_Size(slice) == 1, "guard against overflow");
         DECREF(slice);
         DECREF(wanted);
     }
@@ -269,7 +275,7 @@ test_Slice(TestBatch *batch) {
 }
 
 static void
-test_Clone_and_Shallow_Copy(TestBatch *batch) {
+test_Clone_and_Shallow_Copy(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
     VArray *twin;
     uint32_t i;
@@ -278,14 +284,14 @@ test_Clone_and_Shallow_Copy(TestBatch *batch) {
         VA_Push(array, (Obj*)CB_newf("%u32", i));
     }
     twin = VA_Shallow_Copy(array);
-    TEST_TRUE(batch, VA_Equals(array, (Obj*)twin), "Shallow_Copy");
-    TEST_TRUE(batch, VA_Fetch(array, 1) == VA_Fetch(twin, 1),
+    TEST_TRUE(runner, VA_Equals(array, (Obj*)twin), "Shallow_Copy");
+    TEST_TRUE(runner, VA_Fetch(array, 1) == VA_Fetch(twin, 1),
               "Shallow_Copy doesn't clone elements");
     DECREF(twin);
 
     twin = VA_Clone(array);
-    TEST_TRUE(batch, VA_Equals(array, (Obj*)twin), "Clone");
-    TEST_TRUE(batch, VA_Fetch(array, 1) != VA_Fetch(twin, 1),
+    TEST_TRUE(runner, VA_Equals(array, (Obj*)twin), "Clone");
+    TEST_TRUE(runner, VA_Fetch(array, 1) != VA_Fetch(twin, 1),
               "Clone performs deep clone");
 
     DECREF(array);
@@ -293,7 +299,7 @@ test_Clone_and_Shallow_Copy(TestBatch *batch) {
 }
 
 static void
-test_Dump_and_Load(TestBatch *batch) {
+test_Dump_and_Load(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
     Obj    *dump;
     VArray *loaded;
@@ -301,7 +307,7 @@ test_Dump_and_Load(TestBatch *batch) {
     VA_Push(array, (Obj*)S_new_cb("foo"));
     dump = (Obj*)VA_Dump(array);
     loaded = (VArray*)Obj_Load(dump, dump);
-    TEST_TRUE(batch, VA_Equals(array, (Obj*)loaded),
+    TEST_TRUE(runner, VA_Equals(array, (Obj*)loaded),
               "Dump => Load round trip");
 
     DECREF(array);
@@ -310,23 +316,18 @@ test_Dump_and_Load(TestBatch *batch) {
 }
 
 void
-TestVArray_run_tests() {
-    TestBatch *batch = TestBatch_new(44);
-
-    TestBatch_Plan(batch);
-
-    test_Equals(batch);
-    test_Store_Fetch(batch);
-    test_Push_Pop_Shift_Unshift(batch);
-    test_Delete(batch);
-    test_Resize(batch);
-    test_Excise(batch);
-    test_Push_VArray(batch);
-    test_Slice(batch);
-    test_Clone_and_Shallow_Copy(batch);
-    test_Dump_and_Load(batch);
-
-    DECREF(batch);
+TestVArray_run(TestVArray *self, TestBatchRunner *runner) {
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 44);
+    test_Equals(runner);
+    test_Store_Fetch(runner);
+    test_Push_Pop_Shift_Unshift(runner);
+    test_Delete(runner);
+    test_Resize(runner);
+    test_Excise(runner);
+    test_Push_VArray(runner);
+    test_Slice(runner);
+    test_Clone_and_Shallow_Copy(runner);
+    test_Dump_and_Load(runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh b/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
index 21a9aef..735fccb 100644
--- a/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
+++ b/clownfish/runtime/core/Clownfish/Test/TestVArray.cfh
@@ -14,11 +14,16 @@
  * limitations under the License.
  */
 
-parcel Clownfish;
+parcel TestClownfish;
 
-inert class Clownfish::Test::TestVArray {
-    inert void
-    run_tests();
+class Clownfish::Test::TestVArray
+    inherits Clownfish::TestHarness::TestBatch {
+
+    inert incremented TestVArray*
+    new();
+
+    void
+    Run(TestVArray *self, TestBatchRunner *runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
index 9adae1c..d2cb408 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.c
@@ -15,49 +15,51 @@
  */
 
 #define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
+#define TESTCFISH_USE_SHORT_NAMES
 
-#include "Clownfish/Test.h"
 #include "Clownfish/Test/Util/TestAtomic.h"
+
+#include "Clownfish/Test.h"
+#include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/Util/Atomic.h"
+#include "Clownfish/VTable.h"
+
+TestAtomic*
+TestAtomic_new() {
+    return (TestAtomic*)VTable_Make_Obj(TESTATOMIC);
+}
 
 static void
-test_cas_ptr(TestBatch *batch) {
+test_cas_ptr(TestBatchRunner *runner) {
     int    foo = 1;
     int    bar = 2;
     int   *foo_pointer = &foo;
     int   *bar_pointer = &bar;
     int   *target      = NULL;
 
-    TEST_TRUE(batch,
+    TEST_TRUE(runner,
               Atomic_cas_ptr((void**)&target, NULL, foo_pointer),
               "cas_ptr returns true on success");
-    TEST_TRUE(batch, target == foo_pointer, "cas_ptr sets target");
+    TEST_TRUE(runner, target == foo_pointer, "cas_ptr sets target");
 
     target = NULL;
-    TEST_FALSE(batch,
+    TEST_FALSE(runner,
                Atomic_cas_ptr((void**)&target, bar_pointer, foo_pointer),
                "cas_ptr returns false when it old_value doesn't match");
-    TEST_TRUE(batch, target == NULL,
+    TEST_TRUE(runner, target == NULL,
               "cas_ptr doesn't do anything to target when old_value doesn't match");
 
     target = foo_pointer;
-    TEST_TRUE(batch,
+    TEST_TRUE(runner,
               Atomic_cas_ptr((void**)&target, foo_pointer, bar_pointer),
               "cas_ptr from one value to another");
-    TEST_TRUE(batch, target == bar_pointer, "cas_ptr sets target");
+    TEST_TRUE(runner, target == bar_pointer, "cas_ptr sets target");
 }
 
 void
-TestAtomic_run_tests() {
-    TestBatch *batch = TestBatch_new(6);
-
-    TestBatch_Plan(batch);
-
-    test_cas_ptr(batch);
-
-    DECREF(batch);
+TestAtomic_run(TestAtomic *self, TestBatchRunner *runner) {
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 6);
+    test_cas_ptr(runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
index 4f62047..2788342 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestAtomic.cfh
@@ -14,11 +14,16 @@
  * limitations under the License.
  */
 
-parcel Clownfish;
+parcel TestClownfish;
 
-inert class Clownfish::Test::Util::TestAtomic {
-    inert void
-    run_tests();
+class Clownfish::Test::Util::TestAtomic
+    inherits Clownfish::TestHarness::TestBatch {
+
+    inert incremented TestAtomic*
+    new();
+
+    void
+    Run(TestAtomic *self, TestBatchRunner *runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
index 65c5850..24c8ad3 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.c
@@ -14,16 +14,24 @@
  * limitations under the License.
  */
 
-#define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
 #define CHY_USE_SHORT_NAMES
+#define CFISH_USE_SHORT_NAMES
+#define TESTCFISH_USE_SHORT_NAMES
 
-#include "Clownfish/Test.h"
 #include "Clownfish/Test/Util/TestMemory.h"
+
+#include "Clownfish/Test.h"
+#include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/Util/Memory.h"
+#include "Clownfish/VTable.h"
+
+TestMemory*
+TestMemory_new() {
+    return (TestMemory*)VTable_Make_Obj(TESTMEMORY);
+}
 
 static void
-test_oversize__growth_rate(TestBatch *batch) {
+test_oversize__growth_rate(TestBatchRunner *runner) {
     bool     success             = true;
     uint64_t size                = 0;
     double   growth_count        = 0;
@@ -33,7 +41,7 @@ test_oversize__growth_rate(TestBatch *batch) {
         uint64_t next_size = Memory_oversize((size_t)size + 1, sizeof(void*));
         if (next_size < size) {
             success = false;
-            FAIL(batch, "Asked for %" PRId64 ", got smaller amount %" PRId64,
+            FAIL(runner, "Asked for %" PRId64 ", got smaller amount %" PRId64,
                  size + 1, next_size);
             break;
         }
@@ -44,7 +52,7 @@ test_oversize__growth_rate(TestBatch *batch) {
             double sum = growth_rate + (growth_count - 1) * average_growth_rate;
             average_growth_rate = sum / growth_count;
             if (average_growth_rate < 1.1) {
-                FAIL(batch, "Average growth rate dropped below 1.1x: %f",
+                FAIL(runner, "Average growth rate dropped below 1.1x: %f",
                      average_growth_rate);
                 success = false;
                 break;
@@ -52,9 +60,9 @@ test_oversize__growth_rate(TestBatch *batch) {
         }
         size = next_size;
     }
-    TEST_TRUE(batch, growth_count > 0, "Grew %f times", growth_count);
+    TEST_TRUE(runner, growth_count > 0, "Grew %f times", growth_count);
     if (success) {
-        TEST_TRUE(batch, average_growth_rate > 1.1,
+        TEST_TRUE(runner, average_growth_rate > 1.1,
                   "Growth rate of oversize() averages above 1.1: %.3f",
                   average_growth_rate);
     }
@@ -62,26 +70,26 @@ test_oversize__growth_rate(TestBatch *batch) {
     for (int minimum = 1; minimum < 8; minimum++) {
         uint64_t next_size = Memory_oversize(minimum, sizeof(void*));
         double growth_rate = U64_TO_DOUBLE(next_size) / (double)minimum;
-        TEST_TRUE(batch, growth_rate > 1.2,
+        TEST_TRUE(runner, growth_rate > 1.2,
                   "Growth rate is higher for smaller arrays (%d, %.3f)", minimum,
                   growth_rate);
     }
 }
 
 static void
-test_oversize__ceiling(TestBatch *batch) {
+test_oversize__ceiling(TestBatchRunner *runner) {
     for (int width = 0; width < 10; width++) {
         size_t size = Memory_oversize(SIZE_MAX, width);
-        TEST_TRUE(batch, size == SIZE_MAX,
+        TEST_TRUE(runner, size == SIZE_MAX,
                   "Memory_oversize hits ceiling at SIZE_MAX (width %d)", width);
         size = Memory_oversize(SIZE_MAX - 1, width);
-        TEST_TRUE(batch, size == SIZE_MAX,
+        TEST_TRUE(runner, size == SIZE_MAX,
                   "Memory_oversize hits ceiling at SIZE_MAX (width %d)", width);
     }
 }
 
 static void
-test_oversize__rounding(TestBatch *batch) {
+test_oversize__rounding(TestBatchRunner *runner) {
     int widths[] = { 1, 2, 4, 0 };
 
     for (int width_tick = 0; widths[width_tick] != 0; width_tick++) {
@@ -90,25 +98,21 @@ test_oversize__rounding(TestBatch *batch) {
             size_t size = Memory_oversize(i, width);
             size_t bytes = size * width;
             if (bytes % sizeof(void*) != 0) {
-                FAIL(batch, "Rounding failure for %d, width %d",
+                FAIL(runner, "Rounding failure for %d, width %d",
                      i, width);
                 return;
             }
         }
     }
-    PASS(batch, "Round allocations up to the size of a pointer");
+    PASS(runner, "Round allocations up to the size of a pointer");
 }
 
 void
-TestMemory_run_tests() {
-    TestBatch *batch = TestBatch_new(30);
-
-    TestBatch_Plan(batch);
-    test_oversize__growth_rate(batch);
-    test_oversize__ceiling(batch);
-    test_oversize__rounding(batch);
-
-    DECREF(batch);
+TestMemory_run(TestMemory *self, TestBatchRunner *runner) {
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 30);
+    test_oversize__growth_rate(runner);
+    test_oversize__ceiling(runner);
+    test_oversize__rounding(runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
index 0c3728e..d0b5803 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestMemory.cfh
@@ -14,11 +14,16 @@
  * limitations under the License.
  */
 
-parcel Clownfish;
+parcel TestClownfish;
 
-inert class Clownfish::Test::Util::TestMemory {
-    inert void
-    run_tests();
+class Clownfish::Test::Util::TestMemory
+    inherits Clownfish::TestHarness::TestBatch {
+
+    inert incremented TestMemory*
+    new();
+
+    void
+    Run(TestMemory *self, TestBatchRunner *runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
index 66db928..0ae476d 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.c
@@ -18,18 +18,25 @@
 #include <time.h>
 
 #define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
+#define TESTCFISH_USE_SHORT_NAMES
 
-#include "Clownfish/Test.h"
-#include "Clownfish/Test/TestUtils.h"
 #include "Clownfish/Test/Util/TestNumberUtils.h"
-#include "Clownfish/Util/NumberUtils.h"
-#include "Clownfish/Util/Memory.h"
+
 #include "Clownfish/Err.h"
+#include "Clownfish/Test.h"
+#include "Clownfish/TestHarness/TestBatchRunner.h"
+#include "Clownfish/TestHarness/TestUtils.h"
+#include "Clownfish/Util/Memory.h"
+#include "Clownfish/Util/NumberUtils.h"
+#include "Clownfish/VTable.h"
+
+TestNumberUtils*
+TestNumUtil_new() {
+    return (TestNumberUtils*)VTable_Make_Obj(TESTNUMBERUTILS);
+}
 
 static void
-test_u1(TestBatch *batch) {
+test_u1(TestBatchRunner *runner) {
     size_t    count   = 64;
     uint64_t *ints    = TestUtils_random_u64s(NULL, count, 0, 2);
     size_t    amount  = count / 8;
@@ -39,7 +46,7 @@ test_u1(TestBatch *batch) {
         if (ints[i]) { NumUtil_u1set(bits, i); }
     }
     for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(batch, NumUtil_u1get(bits, i), (long)ints[i],
+        TEST_INT_EQ(runner, NumUtil_u1get(bits, i), (long)ints[i],
                     "u1 set/get");
     }
 
@@ -47,7 +54,7 @@ test_u1(TestBatch *batch) {
         NumUtil_u1flip(bits, i);
     }
     for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(batch, NumUtil_u1get(bits, i), !ints[i], "u1 flip");
+        TEST_INT_EQ(runner, NumUtil_u1get(bits, i), !ints[i], "u1 flip");
     }
 
     FREEMEM(bits);
@@ -55,7 +62,7 @@ test_u1(TestBatch *batch) {
 }
 
 static void
-test_u2(TestBatch *batch) {
+test_u2(TestBatchRunner *runner) {
     size_t    count = 32;
     uint64_t *ints = TestUtils_random_u64s(NULL, count, 0, 4);
     uint8_t  *bits = (uint8_t*)CALLOCATE((count / 4), sizeof(uint8_t));
@@ -64,7 +71,7 @@ test_u2(TestBatch *batch) {
         NumUtil_u2set(bits, i, (uint8_t)ints[i]);
     }
     for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(batch, NumUtil_u2get(bits, i), (long)ints[i], "u2");
+        TEST_INT_EQ(runner, NumUtil_u2get(bits, i), (long)ints[i], "u2");
     }
 
     FREEMEM(bits);
@@ -72,7 +79,7 @@ test_u2(TestBatch *batch) {
 }
 
 static void
-test_u4(TestBatch *batch) {
+test_u4(TestBatchRunner *runner) {
     size_t    count = 128;
     uint64_t *ints  = TestUtils_random_u64s(NULL, count, 0, 16);
     uint8_t  *bits  = (uint8_t*)CALLOCATE((count / 2), sizeof(uint8_t));
@@ -81,7 +88,7 @@ test_u4(TestBatch *batch) {
         NumUtil_u4set(bits, i, (uint8_t)ints[i]);
     }
     for (size_t i = 0; i < count; i++) {
-        TEST_INT_EQ(batch, NumUtil_u4get(bits, i), (long)ints[i], "u4");
+        TEST_INT_EQ(runner, NumUtil_u4get(bits, i), (long)ints[i], "u4");
     }
 
     FREEMEM(bits);
@@ -89,7 +96,7 @@ test_u4(TestBatch *batch) {
 }
 
 static void
-test_c32(TestBatch *batch) {
+test_c32(TestBatchRunner *runner) {
     uint64_t  mins[]   = { 0,   0x4000 - 100, (uint32_t)INT32_MAX - 100, UINT32_MAX - 10 };
     uint64_t  limits[] = { 500, 0x4000 + 100, (uint32_t)INT32_MAX + 100, UINT32_MAX      };
     uint32_t  set_num;
@@ -112,44 +119,44 @@ test_c32(TestBatch *batch) {
         target = encoded;
         skip   = encoded;
         for (size_t i = 0; i < count; i++) {
-            TEST_INT_EQ(batch, NumUtil_decode_c32(&target), (long)ints[i],
+            TEST_INT_EQ(runner, NumUtil_decode_c32(&target), (long)ints[i],
                         "c32 %lu", (long)ints[i]);
             NumUtil_skip_cint(&skip);
             if (target > limit) { THROW(ERR, "overrun"); }
         }
-        TEST_TRUE(batch, skip == target, "skip %lu == %lu",
+        TEST_TRUE(runner, skip == target, "skip %lu == %lu",
                   (unsigned long)skip, (unsigned long)target);
 
         target = encoded;
         for (size_t i = 0; i < count; i++) {
             NumUtil_encode_padded_c32((uint32_t)ints[i], &target);
         }
-        TEST_TRUE(batch, target == limit,
+        TEST_TRUE(runner, target == limit,
                   "padded c32 uses 5 bytes (%lu == %lu)", (unsigned long)target,
                   (unsigned long)limit);
         target = encoded;
         skip   = encoded;
         for (size_t i = 0; i < count; i++) {
-            TEST_INT_EQ(batch, NumUtil_decode_c32(&target), (long)ints[i],
+            TEST_INT_EQ(runner, NumUtil_decode_c32(&target), (long)ints[i],
                         "padded c32 %lu", (long)ints[i]);
             NumUtil_skip_cint(&skip);
             if (target > limit) { THROW(ERR, "overrun"); }
         }
-        TEST_TRUE(batch, skip == target, "skip padded %lu == %lu",
+        TEST_TRUE(runner, skip == target, "skip padded %lu == %lu",
                   (unsigned long)skip, (unsigned long)target);
     }
 
     target = encoded;
     NumUtil_encode_c32(UINT32_MAX, &target);
     target = encoded;
-    TEST_INT_EQ(batch, NumUtil_decode_c32(&target), UINT32_MAX, "c32 UINT32_MAX");
+    TEST_INT_EQ(runner, NumUtil_decode_c32(&target), UINT32_MAX, "c32 UINT32_MAX");
 
     FREEMEM(encoded);
     FREEMEM(ints);
 }
 
 static void
-test_c64(TestBatch *batch) {
+test_c64(TestBatchRunner *runner) {
     uint64_t  mins[]    = { 0,   0x4000 - 100, (uint64_t)UINT32_MAX - 100,  UINT64_MAX - 10 };
     uint64_t  limits[]  = { 500, 0x4000 + 100, (uint64_t)UINT32_MAX + 1000, UINT64_MAX      };
     uint32_t  set_num;
@@ -173,12 +180,12 @@ test_c64(TestBatch *batch) {
         skip   = encoded;
         for (size_t i = 0; i < count; i++) {
             uint64_t got = NumUtil_decode_c64(&target);
-            TEST_TRUE(batch, got == ints[i],
+            TEST_TRUE(runner, got == ints[i],
                       "c64 %" PRIu64 " == %" PRIu64, got, ints[i]);
             if (target > limit) { THROW(ERR, "overrun"); }
             NumUtil_skip_cint(&skip);
         }
-        TEST_TRUE(batch, skip == target, "skip %lu == %lu",
+        TEST_TRUE(runner, skip == target, "skip %lu == %lu",
                   (unsigned long)skip, (unsigned long)target);
     }
 
@@ -187,14 +194,14 @@ test_c64(TestBatch *batch) {
     target = encoded;
 
     uint64_t got = NumUtil_decode_c64(&target);
-    TEST_TRUE(batch, got == UINT64_MAX, "c64 UINT64_MAX");
+    TEST_TRUE(runner, got == UINT64_MAX, "c64 UINT64_MAX");
 
     FREEMEM(encoded);
     FREEMEM(ints);
 }
 
 static void
-test_bigend_u16(TestBatch *batch) {
+test_bigend_u16(TestBatchRunner *runner) {
     size_t    count     = 32;
     uint64_t *ints      = TestUtils_random_u64s(NULL, count, 0, UINT16_MAX + 1);
     size_t    amount    = (count + 1) * sizeof(uint16_t);
@@ -209,21 +216,21 @@ test_bigend_u16(TestBatch *batch) {
     target = encoded;
     for (size_t i = 0; i < count; i++) {
         uint16_t got = NumUtil_decode_bigend_u16(target);
-        TEST_INT_EQ(batch, got, (long)ints[i], "bigend u16");
+        TEST_INT_EQ(runner, got, (long)ints[i], "bigend u16");
         target += sizeof(uint16_t);
     }
 
     target = encoded;
     NumUtil_encode_bigend_u16(1, &target);
-    TEST_INT_EQ(batch, encoded[0], 0, "Truly big-endian u16");
-    TEST_INT_EQ(batch, encoded[1], 1, "Truly big-endian u16");
+    TEST_INT_EQ(runner, encoded[0], 0, "Truly big-endian u16");
+    TEST_INT_EQ(runner, encoded[1], 1, "Truly big-endian u16");
 
     FREEMEM(allocated);
     FREEMEM(ints);
 }
 
 static void
-test_bigend_u32(TestBatch *batch) {
+test_bigend_u32(TestBatchRunner *runner) {
     size_t    count     = 32;
     uint64_t *ints      = TestUtils_random_u64s(NULL, count, 0, UINT64_C(1) + UINT32_MAX);
     size_t    amount    = (count + 1) * sizeof(uint32_t);
@@ -238,21 +245,21 @@ test_bigend_u32(TestBatch *batch) {
     target = encoded;
     for (size_t i = 0; i < count; i++) {
         uint32_t got = NumUtil_decode_bigend_u32(target);
-        TEST_INT_EQ(batch, got, (long)ints[i], "bigend u32");
+        TEST_INT_EQ(runner, got, (long)ints[i], "bigend u32");
         target += sizeof(uint32_t);
     }
 
     target = encoded;
     NumUtil_encode_bigend_u32(1, &target);
-    TEST_INT_EQ(batch, encoded[0], 0, "Truly big-endian u32");
-    TEST_INT_EQ(batch, encoded[3], 1, "Truly big-endian u32");
+    TEST_INT_EQ(runner, encoded[0], 0, "Truly big-endian u32");
+    TEST_INT_EQ(runner, encoded[3], 1, "Truly big-endian u32");
 
     FREEMEM(allocated);
     FREEMEM(ints);
 }
 
 static void
-test_bigend_u64(TestBatch *batch) {
+test_bigend_u64(TestBatchRunner *runner) {
     size_t    count     = 32;
     uint64_t *ints      = TestUtils_random_u64s(NULL, count, 0, UINT64_MAX);
     size_t    amount    = (count + 1) * sizeof(uint64_t);
@@ -267,21 +274,21 @@ test_bigend_u64(TestBatch *batch) {
     target = encoded;
     for (size_t i = 0; i < count; i++) {
         uint64_t got = NumUtil_decode_bigend_u64(target);
-        TEST_TRUE(batch, got == ints[i], "bigend u64");
+        TEST_TRUE(runner, got == ints[i], "bigend u64");
         target += sizeof(uint64_t);
     }
 
     target = encoded;
     NumUtil_encode_bigend_u64(1, &target);
-    TEST_INT_EQ(batch, encoded[0], 0, "Truly big-endian");
-    TEST_INT_EQ(batch, encoded[7], 1, "Truly big-endian");
+    TEST_INT_EQ(runner, encoded[0], 0, "Truly big-endian");
+    TEST_INT_EQ(runner, encoded[7], 1, "Truly big-endian");
 
     FREEMEM(allocated);
     FREEMEM(ints);
 }
 
 static void
-test_bigend_f32(TestBatch *batch) {
+test_bigend_f32(TestBatchRunner *runner) {
     float    source[]  = { -1.3f, 0.0f, 100.2f };
     size_t   count     = 3;
     size_t   amount    = (count + 1) * sizeof(float);
@@ -296,18 +303,18 @@ test_bigend_f32(TestBatch *batch) {
     target = encoded;
     for (size_t i = 0; i < count; i++) {
         float got = NumUtil_decode_bigend_f32(target);
-        TEST_TRUE(batch, got == source[i], "bigend f32");
+        TEST_TRUE(runner, got == source[i], "bigend f32");
         target += sizeof(float);
     }
 
     target = encoded;
     NumUtil_encode_bigend_f32(-2.0f, &target);
-    TEST_INT_EQ(batch, (encoded[0] & 0x80), 0x80,
+    TEST_INT_EQ(runner, (encoded[0] & 0x80), 0x80,
                 "Truly big-endian (IEEE 754 sign bit set for negative number)");
-    TEST_INT_EQ(batch, encoded[0], 0xC0,
+    TEST_INT_EQ(runner, encoded[0], 0xC0,
                 "IEEE 754 representation of -2.0f, byte 0");
     for (size_t i = 1; i < sizeof(float); i++) {
-        TEST_INT_EQ(batch, encoded[i], 0,
+        TEST_INT_EQ(runner, encoded[i], 0,
                     "IEEE 754 representation of -2.0f, byte %d", (int)i);
     }
 
@@ -315,7 +322,7 @@ test_bigend_f32(TestBatch *batch) {
 }
 
 static void
-test_bigend_f64(TestBatch *batch) {
+test_bigend_f64(TestBatchRunner *runner) {
     double   source[]  = { -1.3, 0.0, 100.2 };
     size_t   count     = 3;
     size_t   amount    = (count + 1) * sizeof(double);
@@ -330,18 +337,18 @@ test_bigend_f64(TestBatch *batch) {
     target = encoded;
     for (size_t i = 0; i < count; i++) {
         double got = NumUtil_decode_bigend_f64(target);
-        TEST_TRUE(batch, got == source[i], "bigend f64");
+        TEST_TRUE(runner, got == source[i], "bigend f64");
         target += sizeof(double);
     }
 
     target = encoded;
     NumUtil_encode_bigend_f64(-2.0, &target);
-    TEST_INT_EQ(batch, (encoded[0] & 0x80), 0x80,
+    TEST_INT_EQ(runner, (encoded[0] & 0x80), 0x80,
                 "Truly big-endian (IEEE 754 sign bit set for negative number)");
-    TEST_INT_EQ(batch, encoded[0], 0xC0,
+    TEST_INT_EQ(runner, encoded[0], 0xC0,
                 "IEEE 754 representation of -2.0, byte 0");
     for (size_t i = 1; i < sizeof(double); i++) {
-        TEST_INT_EQ(batch, encoded[i], 0,
+        TEST_INT_EQ(runner, encoded[i], 0,
                     "IEEE 754 representation of -2.0, byte %d", (int)i);
     }
 
@@ -349,24 +356,19 @@ test_bigend_f64(TestBatch *batch) {
 }
 
 void
-TestNumUtil_run_tests() {
-    TestBatch *batch = TestBatch_new(1196);
-
-    TestBatch_Plan(batch);
+TestNumUtil_run(TestNumberUtils *self, TestBatchRunner *runner) {
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 1196);
     srand((unsigned int)time((time_t*)NULL));
-
-    test_u1(batch);
-    test_u2(batch);
-    test_u4(batch);
-    test_c32(batch);
-    test_c64(batch);
-    test_bigend_u16(batch);
-    test_bigend_u32(batch);
-    test_bigend_u64(batch);
-    test_bigend_f32(batch);
-    test_bigend_f64(batch);
-
-    DECREF(batch);
+    test_u1(runner);
+    test_u2(runner);
+    test_u4(runner);
+    test_c32(runner);
+    test_c64(runner);
+    test_bigend_u16(runner);
+    test_bigend_u32(runner);
+    test_bigend_u64(runner);
+    test_bigend_f32(runner);
+    test_bigend_f64(runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh
index c55887b..cd9e165 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestNumberUtils.cfh
@@ -14,11 +14,16 @@
  * limitations under the License.
  */
 
-parcel Clownfish;
+parcel TestClownfish;
 
-inert class Clownfish::Test::Util::TestNumberUtils cnick TestNumUtil {
-    inert void
-    run_tests();
+class Clownfish::Test::Util::TestNumberUtils cnick TestNumUtil
+    inherits Clownfish::TestHarness::TestBatch {
+
+    inert incremented TestNumberUtils*
+    new();
+
+    void
+    Run(TestNumberUtils *self, TestBatchRunner *runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
index 08a9d72..ccadd1c 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.c
@@ -14,19 +14,29 @@
  * limitations under the License.
  */
 
+#include <string.h>
+
 #define CFISH_USE_SHORT_NAMES
-#define LUCY_USE_SHORT_NAMES
-#define CHY_USE_SHORT_NAMES
+#define TESTCFISH_USE_SHORT_NAMES
 
-#include "Clownfish/Test.h"
 #include "Clownfish/Test/Util/TestStringHelper.h"
-#include "Clownfish/Test/TestUtils.h"
+
+#include "Clownfish/CharBuf.h"
+#include "Clownfish/Err.h"
+#include "Clownfish/Test.h"
+#include "Clownfish/TestHarness/TestBatchRunner.h"
 #include "Clownfish/Util/StringHelper.h"
+#include "Clownfish/VTable.h"
 
 /* This alternative implementation of utf8_valid() is (presumably) slower, but
  * it implements the standard in a more linear, easy-to-grok way.
  */
 #define TRAIL_OK(n) (n >= 0x80 && n <= 0xBF)
+TestStringHelper*
+TestStrHelp_new() {
+    return (TestStringHelper*)VTable_Make_Obj(TESTSTRINGHELPER);
+}
+
 static bool
 S_utf8_valid_alt(const char *maybe_utf8, size_t size) {
     const uint8_t *string = (const uint8_t*)maybe_utf8;
@@ -117,35 +127,35 @@ S_utf8_valid_alt(const char *maybe_utf8, size_t size) {
 }
 
 static void
-test_overlap(TestBatch *batch) {
+test_overlap(TestBatchRunner *runner) {
     int32_t result;
     result = StrHelp_overlap("", "", 0, 0);
-    TEST_INT_EQ(batch, result, 0, "two empty strings");
+    TEST_INT_EQ(runner, result, 0, "two empty strings");
     result = StrHelp_overlap("", "foo", 0, 3);
-    TEST_INT_EQ(batch, result, 0, "first string is empty");
+    TEST_INT_EQ(runner, result, 0, "first string is empty");
     result = StrHelp_overlap("foo", "", 3, 0);
-    TEST_INT_EQ(batch, result, 0, "second string is empty");
+    TEST_INT_EQ(runner, result, 0, "second string is empty");
     result = StrHelp_overlap("foo", "foo", 3, 3);
-    TEST_INT_EQ(batch, result, 3, "equal strings");
+    TEST_INT_EQ(runner, result, 3, "equal strings");
     result = StrHelp_overlap("foo bar", "foo", 7, 3);
-    TEST_INT_EQ(batch, result, 3, "first string is longer");
+    TEST_INT_EQ(runner, result, 3, "first string is longer");
     result = StrHelp_overlap("foo", "foo bar", 3, 7);
-    TEST_INT_EQ(batch, result, 3, "second string is longer");
+    TEST_INT_EQ(runner, result, 3, "second string is longer");
 }
 
 
 static void
-test_to_base36(TestBatch *batch) {
+test_to_base36(TestBatchRunner *runner) {
     char buffer[StrHelp_MAX_BASE36_BYTES];
     StrHelp_to_base36(UINT64_MAX, buffer);
-    TEST_STR_EQ(batch, "3w5e11264sgsf", buffer, "base36 UINT64_MAX");
+    TEST_STR_EQ(runner, "3w5e11264sgsf", buffer, "base36 UINT64_MAX");
     StrHelp_to_base36(1, buffer);
-    TEST_STR_EQ(batch, "1", buffer, "base36 1");
-    TEST_INT_EQ(batch, buffer[1], 0, "base36 NULL termination");
+    TEST_STR_EQ(runner, "1", buffer, "base36 1");
+    TEST_INT_EQ(runner, buffer[1], 0, "base36 NULL termination");
 }
 
 static void
-test_utf8_round_trip(TestBatch *batch) {
+test_utf8_round_trip(TestBatchRunner *runner) {
     uint32_t code_point;
     for (code_point = 0; code_point <= 0x10FFFF; code_point++) {
         char buffer[4];
@@ -175,120 +185,115 @@ test_utf8_round_trip(TestBatch *batch) {
         }
     }
     if (code_point == 0x110000) {
-        PASS(batch, "Successfully round tripped 0 - 0x10FFFF");
+        PASS(runner, "Successfully round tripped 0 - 0x10FFFF");
     }
     else {
-        FAIL(batch, "Failed round trip at 0x%.1X", (unsigned)code_point);
+        FAIL(runner, "Failed round trip at 0x%.1X", (unsigned)code_point);
     }
 }
 
 static void
-S_test_validity(TestBatch *batch, const char *content, size_t size,
+S_test_validity(TestBatchRunner *runner, const char *content, size_t size,
                 bool expected, const char *description) {
     bool sane = StrHelp_utf8_valid(content, size);
     bool double_check = S_utf8_valid_alt(content, size);
     if (sane != double_check) {
-        FAIL(batch, "Disagreement: %s", description);
+        FAIL(runner, "Disagreement: %s", description);
     }
     else {
-        TEST_TRUE(batch, sane == expected, "%s", description);
+        TEST_TRUE(runner, sane == expected, "%s", description);
     }
 }
 
 static void
-test_utf8_valid(TestBatch *batch) {
+test_utf8_valid(TestBatchRunner *runner) {
     // Musical symbol G clef:
     // Code point: U+1D11E
     // UTF-16:     0xD834 0xDD1E
     // UTF-8       0xF0 0x9D 0x84 0x9E
-    S_test_validity(batch, "\xF0\x9D\x84\x9E", 4, true,
+    S_test_validity(runner, "\xF0\x9D\x84\x9E", 4, true,
                     "Musical symbol G clef");
-    S_test_validity(batch, "\xED\xA0\xB4\xED\xB4\x9E", 6, false,
+    S_test_validity(runner, "\xED\xA0\xB4\xED\xB4\x9E", 6, false,
                     "G clef as UTF-8 encoded UTF-16 surrogates");
-    S_test_validity(batch, ".\xED\xA0\xB4.", 5, false,
+    S_test_validity(runner, ".\xED\xA0\xB4.", 5, false,
                     "Isolated high surrogate");
-    S_test_validity(batch, ".\xED\xB4\x9E.", 5, false,
+    S_test_validity(runner, ".\xED\xB4\x9E.", 5, false,
                     "Isolated low surrogate");
 
     // Shortest form.
-    S_test_validity(batch, ".\xC1\x9C.", 4, false,
+    S_test_validity(runner, ".\xC1\x9C.", 4, false,
                     "Non-shortest form ASCII backslash");
-    S_test_validity(batch, ".\xC0\xAF.", 4, false,
+    S_test_validity(runner, ".\xC0\xAF.", 4, false,
                     "Non-shortest form ASCII slash");
-    S_test_validity(batch, ".\xC0\x80.", 4, false,
+    S_test_validity(runner, ".\xC0\x80.", 4, false,
                     "Non-shortest form ASCII NUL character");
 
     // Range.
-    S_test_validity(batch, "\xF8\x88\x80\x80\x80", 5, false, "5-byte UTF-8");
+    S_test_validity(runner, "\xF8\x88\x80\x80\x80", 5, false, "5-byte UTF-8");
 
     // Bad continuations.
-    S_test_validity(batch, "\xE2\x98\xBA\xE2\x98\xBA", 6, true,
+    S_test_validity(runner, "\xE2\x98\xBA\xE2\x98\xBA", 6, true,
                     "SmileySmiley");
-    S_test_validity(batch, "\xE2\xBA\xE2\x98\xBA", 5, false,
+    S_test_validity(runner, "\xE2\xBA\xE2\x98\xBA", 5, false,
                     "missing first continuation byte");
-    S_test_validity(batch, "\xE2\x98\xE2\x98\xBA", 5, false,
+    S_test_validity(runner, "\xE2\x98\xE2\x98\xBA", 5, false,
                     "missing second continuation byte");
-    S_test_validity(batch, "\xE2\xE2\x98\xBA", 4, false,
+    S_test_validity(runner, "\xE2\xE2\x98\xBA", 4, false,
                     "missing both continuation bytes");
-    S_test_validity(batch, "\xBA\xE2\x98\xBA\xE2\xBA", 5, false,
+    S_test_validity(runner, "\xBA\xE2\x98\xBA\xE2\xBA", 5, false,
                     "missing first continuation byte (end)");
-    S_test_validity(batch, "\xE2\x98\xBA\xE2\x98", 5, false,
+    S_test_validity(runner, "\xE2\x98\xBA\xE2\x98", 5, false,
                     "missing second continuation byte (end)");
-    S_test_validity(batch, "\xE2\x98\xBA\xE2", 4, false,
+    S_test_validity(runner, "\xE2\x98\xBA\xE2", 4, false,
                     "missing both continuation bytes (end)");
-    S_test_validity(batch, "\xBA\xE2\x98\xBA", 4, false,
+    S_test_validity(runner, "\xBA\xE2\x98\xBA", 4, false,
                     "isolated continuation byte 0xBA");
-    S_test_validity(batch, "\x98\xE2\x98\xBA", 4, false,
+    S_test_validity(runner, "\x98\xE2\x98\xBA", 4, false,
                     "isolated continuation byte 0x98");
-    S_test_validity(batch, "\xE2\x98\xBA\xBA", 4, false,
+    S_test_validity(runner, "\xE2\x98\xBA\xBA", 4, false,
                     "isolated continuation byte 0xBA (end)");
-    S_test_validity(batch, "\xE2\x98\xBA\x98", 4, false,
+    S_test_validity(runner, "\xE2\x98\xBA\x98", 4, false,
                     "isolated continuation byte 0x98 (end)");
 }
 
 static void
-test_is_whitespace(TestBatch *batch) {
-    TEST_TRUE(batch, StrHelp_is_whitespace(' '), "space is whitespace");
-    TEST_TRUE(batch, StrHelp_is_whitespace('\n'), "newline is whitespace");
-    TEST_TRUE(batch, StrHelp_is_whitespace('\t'), "tab is whitespace");
-    TEST_TRUE(batch, StrHelp_is_whitespace('\v'),
+test_is_whitespace(TestBatchRunner *runner) {
+    TEST_TRUE(runner, StrHelp_is_whitespace(' '), "space is whitespace");
+    TEST_TRUE(runner, StrHelp_is_whitespace('\n'), "newline is whitespace");
+    TEST_TRUE(runner, StrHelp_is_whitespace('\t'), "tab is whitespace");
+    TEST_TRUE(runner, StrHelp_is_whitespace('\v'),
               "vertical tab is whitespace");
-    TEST_TRUE(batch, StrHelp_is_whitespace(0x180E),
+    TEST_TRUE(runner, StrHelp_is_whitespace(0x180E),
               "Mongolian vowel separator is whitespace");
-    TEST_FALSE(batch, StrHelp_is_whitespace('a'), "'a' isn't whitespace");
-    TEST_FALSE(batch, StrHelp_is_whitespace(0), "NULL isn't whitespace");
-    TEST_FALSE(batch, StrHelp_is_whitespace(0x263A),
+    TEST_FALSE(runner, StrHelp_is_whitespace('a'), "'a' isn't whitespace");
+    TEST_FALSE(runner, StrHelp_is_whitespace(0), "NULL isn't whitespace");
+    TEST_FALSE(runner, StrHelp_is_whitespace(0x263A),
                "Smiley isn't whitespace");
 }
 
 static void
-test_back_utf8_char(TestBatch *batch) {
+test_back_utf8_char(TestBatchRunner *runner) {
     char buffer[4];
     char *buf = buffer + 1;
     uint32_t len = StrHelp_encode_utf8_char(0x263A, buffer);
     char *end = buffer + len;
-    TEST_TRUE(batch, StrHelp_back_utf8_char(end, buffer) == buffer,
+    TEST_TRUE(runner, StrHelp_back_utf8_char(end, buffer) == buffer,
               "back_utf8_char");
-    TEST_TRUE(batch, StrHelp_back_utf8_char(end, buf) == NULL,
+    TEST_TRUE(runner, StrHelp_back_utf8_char(end, buf) == NULL,
               "back_utf8_char returns NULL rather than back up beyond start");
-    TEST_TRUE(batch, StrHelp_back_utf8_char(buffer, buffer) == NULL,
+    TEST_TRUE(runner, StrHelp_back_utf8_char(buffer, buffer) == NULL,
               "back_utf8_char returns NULL when end == start");
 }
 
 void
-TestStrHelp_run_tests() {
-    TestBatch *batch = TestBatch_new(40);
-
-    TestBatch_Plan(batch);
-
-    test_overlap(batch);
-    test_to_base36(batch);
-    test_utf8_round_trip(batch);
-    test_utf8_valid(batch);
-    test_is_whitespace(batch);
-    test_back_utf8_char(batch);
-
-    DECREF(batch);
+TestStrHelp_run(TestStringHelper *self, TestBatchRunner *runner) {
+    TestBatchRunner_Plan(runner, (TestBatch*)self, 40);
+    test_overlap(runner);
+    test_to_base36(runner);
+    test_utf8_round_trip(runner);
+    test_utf8_valid(runner);
+    test_is_whitespace(runner);
+    test_back_utf8_char(runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh
index ac7276e..0f8351a 100644
--- a/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh
+++ b/clownfish/runtime/core/Clownfish/Test/Util/TestStringHelper.cfh
@@ -14,11 +14,16 @@
  * limitations under the License.
  */
 
-parcel Clownfish;
+parcel TestClownfish;
 
-inert class Clownfish::Test::Util::TestStringHelper cnick TestStrHelp {
-    inert void
-    run_tests();
+class Clownfish::Test::Util::TestStringHelper cnick TestStrHelp
+    inherits Clownfish::TestHarness::TestBatch {
+
+    inert incremented TestStringHelper*
+    new();
+
+    void
+    Run(TestStringHelper *self, TestBatchRunner *runner);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/84508991/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh
----------------------------------------------------------------------
diff --git a/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh b/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh
new file mode 100644
index 0000000..21b1117
--- /dev/null
+++ b/clownfish/runtime/core/Clownfish/TestHarness/TestBatch.cfh
@@ -0,0 +1,28 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+parcel Clownfish;
+
+/** Abstract base class for test modules.
+ */
+abstract class Clownfish::TestHarness::TestBatch inherits Clownfish::Obj {
+    /** Run the tests of the test batch.
+     */
+    abstract void
+    Run(TestBatch *self, TestBatchRunner *runner);
+}
+
+