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/02/18 20:50:20 UTC

[lucy-commits] [2/9] Refactor core tests

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestLeafQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestLeafQuery.cfh b/core/Lucy/Test/Search/TestLeafQuery.cfh
index 5a16779..0dbfd2d 100644
--- a/core/Lucy/Test/Search/TestLeafQuery.cfh
+++ b/core/Lucy/Test/Search/TestLeafQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestLeafQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestLeafQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestLeafQuery*
+    new();
+
+    inert TestLeafQuery*
+    init(TestLeafQuery *self);
+
+    void
+    Run_Tests(TestLeafQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestMatchAllQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestMatchAllQuery.c b/core/Lucy/Test/Search/TestMatchAllQuery.c
index e5760a2..cb24920 100644
--- a/core/Lucy/Test/Search/TestMatchAllQuery.c
+++ b/core/Lucy/Test/Search/TestMatchAllQuery.c
@@ -23,6 +23,17 @@
 #include "Lucy/Test/Search/TestMatchAllQuery.h"
 #include "Lucy/Search/MatchAllQuery.h"
 
+TestMatchAllQuery*
+TestMatchAllQuery_new() {
+    TestMatchAllQuery *self = (TestMatchAllQuery*)VTable_Make_Obj(TESTMATCHALLQUERY);
+    return TestMatchAllQuery_init(self);
+}
+
+TestMatchAllQuery*
+TestMatchAllQuery_init(TestMatchAllQuery *self) {
+    return (TestMatchAllQuery*)TestBatch_init((TestBatch*)self, 2);
+}
+
 static void
 test_Dump_Load_and_Equals(TestBatch *batch) {
     MatchAllQuery *query = MatchAllQuery_new();
@@ -41,11 +52,9 @@ test_Dump_Load_and_Equals(TestBatch *batch) {
 
 
 void
-TestMatchAllQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(2);
-    TestBatch_Plan(batch);
+TestMatchAllQuery_run_tests(TestMatchAllQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestMatchAllQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestMatchAllQuery.cfh b/core/Lucy/Test/Search/TestMatchAllQuery.cfh
index e56f29b..fab7a22 100644
--- a/core/Lucy/Test/Search/TestMatchAllQuery.cfh
+++ b/core/Lucy/Test/Search/TestMatchAllQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestMatchAllQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestMatchAllQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestMatchAllQuery*
+    new();
+
+    inert TestMatchAllQuery*
+    init(TestMatchAllQuery *self);
+
+    void
+    Run_Tests(TestMatchAllQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestNOTQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestNOTQuery.c b/core/Lucy/Test/Search/TestNOTQuery.c
index 9a345fc..780f3c7 100644
--- a/core/Lucy/Test/Search/TestNOTQuery.c
+++ b/core/Lucy/Test/Search/TestNOTQuery.c
@@ -24,6 +24,17 @@
 #include "Lucy/Search/NOTQuery.h"
 #include "Lucy/Search/LeafQuery.h"
 
+TestNOTQuery*
+TestNOTQuery_new() {
+    TestNOTQuery *self = (TestNOTQuery*)VTable_Make_Obj(TESTNOTQUERY);
+    return TestNOTQuery_init(self);
+}
+
+TestNOTQuery*
+TestNOTQuery_init(TestNOTQuery *self) {
+    return (TestNOTQuery*)TestBatch_init((TestBatch*)self, 4);
+}
+
 static void
 test_Dump_Load_and_Equals(TestBatch *batch) {
     Query    *a_leaf        = (Query*)TestUtils_make_leaf_query(NULL, "a");
@@ -54,11 +65,9 @@ test_Dump_Load_and_Equals(TestBatch *batch) {
 }
 
 void
-TestNOTQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(4);
-    TestBatch_Plan(batch);
+TestNOTQuery_run_tests(TestNOTQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestNOTQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestNOTQuery.cfh b/core/Lucy/Test/Search/TestNOTQuery.cfh
index 3bfa4cd..1d267f3 100644
--- a/core/Lucy/Test/Search/TestNOTQuery.cfh
+++ b/core/Lucy/Test/Search/TestNOTQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestNOTQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestNOTQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestNOTQuery*
+    new();
+
+    inert TestNOTQuery*
+    init(TestNOTQuery *self);
+
+    void
+    Run_Tests(TestNOTQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestNoMatchQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestNoMatchQuery.c b/core/Lucy/Test/Search/TestNoMatchQuery.c
index ea00bc8..7477a34 100644
--- a/core/Lucy/Test/Search/TestNoMatchQuery.c
+++ b/core/Lucy/Test/Search/TestNoMatchQuery.c
@@ -23,6 +23,17 @@
 #include "Lucy/Test/Search/TestNoMatchQuery.h"
 #include "Lucy/Search/NoMatchQuery.h"
 
+TestNoMatchQuery*
+TestNoMatchQuery_new() {
+    TestNoMatchQuery *self = (TestNoMatchQuery*)VTable_Make_Obj(TESTNOMATCHQUERY);
+    return TestNoMatchQuery_init(self);
+}
+
+TestNoMatchQuery*
+TestNoMatchQuery_init(TestNoMatchQuery *self) {
+    return (TestNoMatchQuery*)TestBatch_init((TestBatch*)self, 2);
+}
+
 static void
 test_Dump_Load_and_Equals(TestBatch *batch) {
     NoMatchQuery *query = NoMatchQuery_new();
@@ -41,11 +52,9 @@ test_Dump_Load_and_Equals(TestBatch *batch) {
 
 
 void
-TestNoMatchQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(2);
-    TestBatch_Plan(batch);
+TestNoMatchQuery_run_tests(TestNoMatchQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestNoMatchQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestNoMatchQuery.cfh b/core/Lucy/Test/Search/TestNoMatchQuery.cfh
index 2b4f1c9..3cfeec9 100644
--- a/core/Lucy/Test/Search/TestNoMatchQuery.cfh
+++ b/core/Lucy/Test/Search/TestNoMatchQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestNoMatchQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestNoMatchQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestNoMatchQuery*
+    new();
+
+    inert TestNoMatchQuery*
+    init(TestNoMatchQuery *self);
+
+    void
+    Run_Tests(TestNoMatchQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestPhraseQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestPhraseQuery.c b/core/Lucy/Test/Search/TestPhraseQuery.c
index 5685c4a..870d487 100644
--- a/core/Lucy/Test/Search/TestPhraseQuery.c
+++ b/core/Lucy/Test/Search/TestPhraseQuery.c
@@ -23,6 +23,17 @@
 #include "Lucy/Test/Search/TestPhraseQuery.h"
 #include "Lucy/Search/PhraseQuery.h"
 
+TestPhraseQuery*
+TestPhraseQuery_new() {
+    TestPhraseQuery *self = (TestPhraseQuery*)VTable_Make_Obj(TESTPHRASEQUERY);
+    return TestPhraseQuery_init(self);
+}
+
+TestPhraseQuery*
+TestPhraseQuery_init(TestPhraseQuery *self) {
+    return (TestPhraseQuery*)TestBatch_init((TestBatch*)self, 1);
+}
+
 static void
 test_Dump_And_Load(TestBatch *batch) {
     PhraseQuery *query
@@ -37,11 +48,9 @@ test_Dump_And_Load(TestBatch *batch) {
 }
 
 void
-TestPhraseQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(1);
-    TestBatch_Plan(batch);
+TestPhraseQuery_run_tests(TestPhraseQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_And_Load(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestPhraseQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestPhraseQuery.cfh b/core/Lucy/Test/Search/TestPhraseQuery.cfh
index ca1617a..d884be2 100644
--- a/core/Lucy/Test/Search/TestPhraseQuery.cfh
+++ b/core/Lucy/Test/Search/TestPhraseQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestPhraseQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestPhraseQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestPhraseQuery*
+    new();
+
+    inert TestPhraseQuery*
+    init(TestPhraseQuery *self);
+
+    void
+    Run_Tests(TestPhraseQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestPolyQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestPolyQuery.c b/core/Lucy/Test/Search/TestPolyQuery.c
index 89d73be..e39bdda 100644
--- a/core/Lucy/Test/Search/TestPolyQuery.c
+++ b/core/Lucy/Test/Search/TestPolyQuery.c
@@ -26,6 +26,28 @@
 #include "Lucy/Search/PolyQuery.h"
 #include "Lucy/Search/LeafQuery.h"
 
+TestANDQuery*
+TestANDQuery_new() {
+    TestANDQuery *self = (TestANDQuery*)VTable_Make_Obj(TESTANDQUERY);
+    return TestANDQuery_init(self);
+}
+
+TestANDQuery*
+TestANDQuery_init(TestANDQuery *self) {
+    return (TestANDQuery*)TestBatch_init((TestBatch*)self, 4);
+}
+
+TestORQuery*
+TestORQuery_new() {
+    TestORQuery *self = (TestORQuery*)VTable_Make_Obj(TESTORQUERY);
+    return TestORQuery_init(self);
+}
+
+TestORQuery*
+TestORQuery_init(TestORQuery *self) {
+    return (TestORQuery*)TestBatch_init((TestBatch*)self, 4);
+}
+
 static void
 test_Dump_Load_and_Equals(TestBatch *batch, uint32_t boolop) {
     LeafQuery *a_leaf  = TestUtils_make_leaf_query(NULL, "a");
@@ -66,19 +88,15 @@ test_Dump_Load_and_Equals(TestBatch *batch, uint32_t boolop) {
 }
 
 void
-TestANDQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(4);
-    TestBatch_Plan(batch);
+TestANDQuery_run_tests(TestANDQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch, BOOLOP_AND);
-    DECREF(batch);
 }
 
 void
-TestORQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(4);
-    TestBatch_Plan(batch);
+TestORQuery_run_tests(TestORQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch, BOOLOP_OR);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestPolyQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestPolyQuery.cfh b/core/Lucy/Test/Search/TestPolyQuery.cfh
index 710f523..7c68c62 100644
--- a/core/Lucy/Test/Search/TestPolyQuery.cfh
+++ b/core/Lucy/Test/Search/TestPolyQuery.cfh
@@ -16,16 +16,30 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestPolyQuery { }
+class Lucy::Test::Search::TestANDQuery
+    inherits Lucy::Test::TestBatch {
 
-inert class Lucy::Test::Search::TestANDQuery {
-    inert void
-    run_tests();
+    inert incremented TestANDQuery*
+    new();
+
+    inert TestANDQuery*
+    init(TestANDQuery *self);
+
+    void
+    Run_Tests(TestANDQuery *self);
 }
 
-inert class Lucy::Test::Search::TestORQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestORQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestORQuery*
+    new();
+
+    inert TestORQuery*
+    init(TestORQuery *self);
+
+    void
+    Run_Tests(TestORQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestQueryParserLogic.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestQueryParserLogic.c b/core/Lucy/Test/Search/TestQueryParserLogic.c
index 60c4127..ace6e4e 100644
--- a/core/Lucy/Test/Search/TestQueryParserLogic.c
+++ b/core/Lucy/Test/Search/TestQueryParserLogic.c
@@ -45,6 +45,17 @@
 #define make_not_query    (Query*)lucy_TestUtils_make_not_query
 #define make_poly_query   (Query*)lucy_TestUtils_make_poly_query
 
+TestQueryParserLogic*
+TestQPLogic_new() {
+    TestQueryParserLogic *self = (TestQueryParserLogic*)VTable_Make_Obj(TESTQUERYPARSERLOGIC);
+    return TestQPLogic_init(self);
+}
+
+TestQueryParserLogic*
+TestQPLogic_init(TestQueryParserLogic *self) {
+    return (TestQueryParserLogic*)TestBatch_init((TestBatch*)self, 258);
+}
+
 static TestQueryParser*
 logical_test_empty_phrase(uint32_t boolop) {
     Query   *tree = make_leaf_query(NULL, "\"\"");
@@ -875,9 +886,9 @@ S_create_index() {
 }
 
 void
-TestQPLogic_run_tests() {
+TestQPLogic_run_tests(TestQueryParserLogic *self) {
     uint32_t i;
-    TestBatch     *batch      = TestBatch_new(258);
+    TestBatch     *batch      = (TestBatch*)self;
     Folder        *folder     = S_create_index();
     IndexSearcher *searcher   = IxSearcher_new((Obj*)folder);
     QueryParser   *or_parser  = QParser_new(IxSearcher_Get_Schema(searcher),
@@ -888,8 +899,6 @@ TestQPLogic_run_tests() {
     QParser_Set_Heed_Colons(or_parser, true);
     QParser_Set_Heed_Colons(and_parser, true);
 
-    TestBatch_Plan(batch);
-
     // Run logical tests with default boolop of OR.
     for (i = 0; logical_test_funcs[i] != NULL; i++) {
         Lucy_TestQPLogic_Logical_Test_t test_func = logical_test_funcs[i];
@@ -957,6 +966,5 @@ TestQPLogic_run_tests() {
     DECREF(or_parser);
     DECREF(searcher);
     DECREF(folder);
-    DECREF(batch);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestQueryParserLogic.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestQueryParserLogic.cfh b/core/Lucy/Test/Search/TestQueryParserLogic.cfh
index 8732646..74e363a 100644
--- a/core/Lucy/Test/Search/TestQueryParserLogic.cfh
+++ b/core/Lucy/Test/Search/TestQueryParserLogic.cfh
@@ -19,9 +19,17 @@ parcel Lucy;
 /** Tests for logical structure of Query objects output by QueryParser.
  */
 
-inert class Lucy::Test::Search::TestQueryParserLogic cnick TestQPLogic {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestQueryParserLogic cnick TestQPLogic
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestQueryParserLogic*
+    new();
+
+    inert TestQueryParserLogic*
+    init(TestQueryParserLogic *self);
+
+    void
+    Run_Tests(TestQueryParserLogic *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestRangeQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestRangeQuery.c b/core/Lucy/Test/Search/TestRangeQuery.c
index 3004b11..c94da0f 100644
--- a/core/Lucy/Test/Search/TestRangeQuery.c
+++ b/core/Lucy/Test/Search/TestRangeQuery.c
@@ -23,6 +23,17 @@
 #include "Lucy/Test/Search/TestRangeQuery.h"
 #include "Lucy/Search/RangeQuery.h"
 
+TestRangeQuery*
+TestRangeQuery_new() {
+    TestRangeQuery *self = (TestRangeQuery*)VTable_Make_Obj(TESTRANGEQUERY);
+    return TestRangeQuery_init(self);
+}
+
+TestRangeQuery*
+TestRangeQuery_init(TestRangeQuery *self) {
+    return (TestRangeQuery*)TestBatch_init((TestBatch*)self, 5);
+}
+
 static void
 test_Dump_Load_and_Equals(TestBatch *batch) {
     RangeQuery *query 
@@ -60,11 +71,9 @@ test_Dump_Load_and_Equals(TestBatch *batch) {
 
 
 void
-TestRangeQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(5);
-    TestBatch_Plan(batch);
+TestRangeQuery_run_tests(TestRangeQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestRangeQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestRangeQuery.cfh b/core/Lucy/Test/Search/TestRangeQuery.cfh
index 8cf247f..7e71446 100644
--- a/core/Lucy/Test/Search/TestRangeQuery.cfh
+++ b/core/Lucy/Test/Search/TestRangeQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestRangeQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestRangeQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestRangeQuery*
+    new();
+
+    inert TestRangeQuery*
+    init(TestRangeQuery *self);
+
+    void
+    Run_Tests(TestRangeQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestReqOptQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestReqOptQuery.c b/core/Lucy/Test/Search/TestReqOptQuery.c
index d5dd329..9f8fc40 100644
--- a/core/Lucy/Test/Search/TestReqOptQuery.c
+++ b/core/Lucy/Test/Search/TestReqOptQuery.c
@@ -24,6 +24,17 @@
 #include "Lucy/Search/RequiredOptionalQuery.h"
 #include "Lucy/Search/LeafQuery.h"
 
+TestReqOptQuery*
+TestReqOptQuery_new() {
+    TestReqOptQuery *self = (TestReqOptQuery*)VTable_Make_Obj(TESTREQOPTQUERY);
+    return TestReqOptQuery_init(self);
+}
+
+TestReqOptQuery*
+TestReqOptQuery_init(TestReqOptQuery *self) {
+    return (TestReqOptQuery*)TestBatch_init((TestBatch*)self, 4);
+}
+
 static void
 test_Dump_Load_and_Equals(TestBatch *batch) {
     Query *a_leaf  = (Query*)TestUtils_make_leaf_query(NULL, "a");
@@ -57,11 +68,9 @@ test_Dump_Load_and_Equals(TestBatch *batch) {
 }
 
 void
-TestReqOptQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(4);
-    TestBatch_Plan(batch);
+TestReqOptQuery_run_tests(TestReqOptQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestReqOptQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestReqOptQuery.cfh b/core/Lucy/Test/Search/TestReqOptQuery.cfh
index b20f8d8..0853005 100644
--- a/core/Lucy/Test/Search/TestReqOptQuery.cfh
+++ b/core/Lucy/Test/Search/TestReqOptQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestReqOptQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestReqOptQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestReqOptQuery*
+    new();
+
+    inert TestReqOptQuery*
+    init(TestReqOptQuery *self);
+
+    void
+    Run_Tests(TestReqOptQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestSeriesMatcher.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSeriesMatcher.c b/core/Lucy/Test/Search/TestSeriesMatcher.c
index 81b5aa4..64a1565 100644
--- a/core/Lucy/Test/Search/TestSeriesMatcher.c
+++ b/core/Lucy/Test/Search/TestSeriesMatcher.c
@@ -23,6 +23,17 @@
 #include "Lucy/Search/BitVecMatcher.h"
 #include "Lucy/Search/SeriesMatcher.h"
 
+TestSeriesMatcher*
+TestSeriesMatcher_new() {
+    TestSeriesMatcher *self = (TestSeriesMatcher*)VTable_Make_Obj(TESTSERIESMATCHER);
+    return TestSeriesMatcher_init(self);
+}
+
+TestSeriesMatcher*
+TestSeriesMatcher_init(TestSeriesMatcher *self) {
+    return (TestSeriesMatcher*)TestBatch_init((TestBatch*)self, 135);
+}
+
 static SeriesMatcher*
 S_make_series_matcher(I32Array *doc_ids, I32Array *offsets, int32_t doc_max) {
     int32_t  num_doc_ids  = I32Arr_Get_Size(doc_ids);
@@ -123,11 +134,9 @@ test_matrix(TestBatch *batch) {
 }
 
 void
-TestSeriesMatcher_run_tests() {
-    TestBatch *batch = TestBatch_new(135);
-    TestBatch_Plan(batch);
+TestSeriesMatcher_run_tests(TestSeriesMatcher *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_matrix(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestSeriesMatcher.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSeriesMatcher.cfh b/core/Lucy/Test/Search/TestSeriesMatcher.cfh
index 2b7729c..30e2b17 100644
--- a/core/Lucy/Test/Search/TestSeriesMatcher.cfh
+++ b/core/Lucy/Test/Search/TestSeriesMatcher.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestSeriesMatcher {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestSeriesMatcher
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestSeriesMatcher*
+    new();
+
+    inert TestSeriesMatcher*
+    init(TestSeriesMatcher *self);
+
+    void
+    Run_Tests(TestSeriesMatcher *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestSortSpec.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSortSpec.c b/core/Lucy/Test/Search/TestSortSpec.c
index fdb9aa6..284bcdf 100644
--- a/core/Lucy/Test/Search/TestSortSpec.c
+++ b/core/Lucy/Test/Search/TestSortSpec.c
@@ -67,6 +67,17 @@ static CharBuf *random_float64s_cb;
 static CharBuf *random_int32s_cb;
 static CharBuf *random_int64s_cb;
 
+TestSortSpec*
+TestSortSpec_new() {
+    TestSortSpec *self = (TestSortSpec*)VTable_Make_Obj(TESTSORTSPEC);
+    return TestSortSpec_init(self);
+}
+
+TestSortSpec*
+TestSortSpec_init(TestSortSpec *self) {
+    return (TestSortSpec*)TestBatch_init((TestBatch*)self, 18);
+}
+
 static void
 S_init_strings() {
     air_cb      = CB_newf("air");
@@ -623,13 +634,11 @@ test_sort_spec(TestBatch *batch) {
 }
 
 void
-TestSortSpec_run_tests() {
-    TestBatch *batch = TestBatch_new(18);
-    TestBatch_Plan(batch);
+TestSortSpec_run_tests(TestSortSpec *self) {
+    TestBatch *batch = (TestBatch*)self;
     S_init_strings();
     test_sort_spec(batch);
     S_destroy_strings();
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestSortSpec.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSortSpec.cfh b/core/Lucy/Test/Search/TestSortSpec.cfh
index 254212d..b178efc 100644
--- a/core/Lucy/Test/Search/TestSortSpec.cfh
+++ b/core/Lucy/Test/Search/TestSortSpec.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestSortSpec {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestSortSpec
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestSortSpec*
+    new();
+
+    inert TestSortSpec*
+    init(TestSortSpec *self);
+
+    void
+    Run_Tests(TestSortSpec *self);
 }
 
 class Lucy::Test::Search::TestReverseType inherits Lucy::Plan::Int32Type {

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestSpan.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSpan.c b/core/Lucy/Test/Search/TestSpan.c
index 5046efd..ee4b4ab 100644
--- a/core/Lucy/Test/Search/TestSpan.c
+++ b/core/Lucy/Test/Search/TestSpan.c
@@ -21,6 +21,17 @@
 #include "Lucy/Test/Search/TestSpan.h"
 #include "Lucy/Search/Span.h"
 
+TestSpan*
+TestSpan_new() {
+    TestSpan *self = (TestSpan*)VTable_Make_Obj(TESTSPAN);
+    return TestSpan_init(self);
+}
+
+TestSpan*
+TestSpan_init(TestSpan *self) {
+    return (TestSpan*)TestBatch_init((TestBatch*)self, 6);
+}
+
 void 
 test_span_init_values(TestBatch *batch) {
     Span* span = Span_new(2,3,7);
@@ -40,10 +51,7 @@ test_span_init_values(TestBatch *batch) {
 }
 
 void
-TestSpan_run_tests() {
-    TestBatch *batch = TestBatch_new(6);
-    TestBatch_Plan(batch);
+TestSpan_run_tests(TestSpan *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_span_init_values(batch);
-
-    DECREF(batch);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestSpan.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestSpan.cfh b/core/Lucy/Test/Search/TestSpan.cfh
index e5a877a..ce90b17 100644
--- a/core/Lucy/Test/Search/TestSpan.cfh
+++ b/core/Lucy/Test/Search/TestSpan.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestSpan {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestSpan
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestSpan*
+    new();
+
+    inert TestSpan*
+    init(TestSpan *self);
+
+    void
+    Run_Tests(TestSpan *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestTermQuery.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestTermQuery.c b/core/Lucy/Test/Search/TestTermQuery.c
index 8fd3738..3d3cc9b 100644
--- a/core/Lucy/Test/Search/TestTermQuery.c
+++ b/core/Lucy/Test/Search/TestTermQuery.c
@@ -23,6 +23,17 @@
 #include "Lucy/Test/TestUtils.h"
 #include "Lucy/Search/TermQuery.h"
 
+TestTermQuery*
+TestTermQuery_new() {
+    TestTermQuery *self = (TestTermQuery*)VTable_Make_Obj(TESTTERMQUERY);
+    return TestTermQuery_init(self);
+}
+
+TestTermQuery*
+TestTermQuery_init(TestTermQuery *self) {
+    return (TestTermQuery*)TestBatch_init((TestBatch*)self, 4);
+}
+
 static void
 test_Dump_Load_and_Equals(TestBatch *batch) {
     TermQuery *query         = TestUtils_make_term_query("content", "foo");
@@ -51,11 +62,9 @@ test_Dump_Load_and_Equals(TestBatch *batch) {
 }
 
 void
-TestTermQuery_run_tests() {
-    TestBatch *batch = TestBatch_new(4);
-    TestBatch_Plan(batch);
+TestTermQuery_run_tests(TestTermQuery *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Dump_Load_and_Equals(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Search/TestTermQuery.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Search/TestTermQuery.cfh b/core/Lucy/Test/Search/TestTermQuery.cfh
index 2b8a031..1e4d152 100644
--- a/core/Lucy/Test/Search/TestTermQuery.cfh
+++ b/core/Lucy/Test/Search/TestTermQuery.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Search::TestTermQuery {
-    inert void
-    run_tests();
+class Lucy::Test::Search::TestTermQuery
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestTermQuery*
+    new();
+
+    inert TestTermQuery*
+    init(TestTermQuery *self);
+
+    void
+    Run_Tests(TestTermQuery *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestCompoundFileReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileReader.c b/core/Lucy/Test/Store/TestCompoundFileReader.c
index d5b49d0..a0dc5d2 100644
--- a/core/Lucy/Test/Store/TestCompoundFileReader.c
+++ b/core/Lucy/Test/Store/TestCompoundFileReader.c
@@ -36,6 +36,17 @@ static CharBuf *baz         = NULL;
 static CharBuf *seg_1       = NULL;
 static CharBuf *stuff       = NULL;
 
+TestCompoundFileReader*
+TestCFReader_new() {
+    TestCompoundFileReader *self = (TestCompoundFileReader*)VTable_Make_Obj(TESTCOMPOUNDFILEREADER);
+    return TestCFReader_init(self);
+}
+
+TestCompoundFileReader*
+TestCFReader_init(TestCompoundFileReader *self) {
+    return (TestCompoundFileReader*)TestBatch_init((TestBatch*)self, 48);
+}
+
 static void
 S_init_strings(void) {
     cfmeta_file = CB_newf("cfmeta.json");
@@ -353,11 +364,9 @@ test_Close(TestBatch *batch) {
 }
 
 void
-TestCFReader_run_tests() {
-    TestBatch *batch = TestBatch_new(48);
-
+TestCFReader_run_tests(TestCompoundFileReader *self) {
+    TestBatch *batch = (TestBatch*)self;
     S_init_strings();
-    TestBatch_Plan(batch);
     test_open(batch);
     test_Local_MkDir_and_Find_Folder(batch);
     test_Local_Delete_and_Exists(batch);
@@ -366,8 +375,6 @@ TestCFReader_run_tests() {
     test_Local_Open_In(batch);
     test_Close(batch);
     S_destroy_strings();
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestCompoundFileReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileReader.cfh b/core/Lucy/Test/Store/TestCompoundFileReader.cfh
index 713f7d7..cf9940b 100644
--- a/core/Lucy/Test/Store/TestCompoundFileReader.cfh
+++ b/core/Lucy/Test/Store/TestCompoundFileReader.cfh
@@ -16,10 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestCompoundFileReader
-    cnick TestCFReader {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestCompoundFileReader cnick TestCFReader
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestCompoundFileReader*
+    new();
+
+    inert TestCompoundFileReader*
+    init(TestCompoundFileReader *self);
+
+    void
+    Run_Tests(TestCompoundFileReader *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestCompoundFileWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileWriter.c b/core/Lucy/Test/Store/TestCompoundFileWriter.c
index e24e623..e0e9db5 100644
--- a/core/Lucy/Test/Store/TestCompoundFileWriter.c
+++ b/core/Lucy/Test/Store/TestCompoundFileWriter.c
@@ -31,6 +31,17 @@ static CharBuf *foo         = NULL;
 static CharBuf *bar         = NULL;
 static CharBuf *seg_1       = NULL;
 
+TestCompoundFileWriter*
+TestCFWriter_new() {
+    TestCompoundFileWriter *self = (TestCompoundFileWriter*)VTable_Make_Obj(TESTCOMPOUNDFILEWRITER);
+    return TestCFWriter_init(self);
+}
+
+TestCompoundFileWriter*
+TestCFWriter_init(TestCompoundFileWriter *self) {
+    return (TestCompoundFileWriter*)TestBatch_init((TestBatch*)self, 7);
+}
+
 static void
 S_init_strings(void) {
     cfmeta_file = CB_newf("cfmeta.json");
@@ -137,16 +148,12 @@ test_offsets(TestBatch *batch) {
 }
 
 void
-TestCFWriter_run_tests() {
-    TestBatch *batch = TestBatch_new(7);
-
+TestCFWriter_run_tests(TestCompoundFileWriter *self) {
+    TestBatch *batch = (TestBatch*)self;
     S_init_strings();
-    TestBatch_Plan(batch);
     test_Consolidate(batch);
     test_offsets(batch);
     S_destroy_strings();
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestCompoundFileWriter.cfh b/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
index b11462e..5c52e92 100644
--- a/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
+++ b/core/Lucy/Test/Store/TestCompoundFileWriter.cfh
@@ -16,10 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestCompoundFileWriter
-    cnick TestCFWriter {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestCompoundFileWriter cnick TestCFWriter
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestCompoundFileWriter*
+    new();
+
+    inert TestCompoundFileWriter*
+    init(TestCompoundFileWriter *self);
+
+    void
+    Run_Tests(TestCompoundFileWriter *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSDirHandle.c b/core/Lucy/Test/Store/TestFSDirHandle.c
index bc03d31..d8d1d63 100644
--- a/core/Lucy/Test/Store/TestFSDirHandle.c
+++ b/core/Lucy/Test/Store/TestFSDirHandle.c
@@ -32,6 +32,17 @@
 #include "Lucy/Store/FSFolder.h"
 #include "Lucy/Store/OutStream.h"
 
+TestFSDirHandle*
+TestFSDH_new() {
+    TestFSDirHandle *self = (TestFSDirHandle*)VTable_Make_Obj(TESTFSDIRHANDLE);
+    return TestFSDH_init(self);
+}
+
+TestFSDirHandle*
+TestFSDH_init(TestFSDirHandle *self) {
+    return (TestFSDirHandle*)TestBatch_init((TestBatch*)self, 5);
+}
+
 static void
 test_all(TestBatch *batch) {
     CharBuf  *foo           = (CharBuf*)ZCB_WRAP_STR("foo", 3);
@@ -88,13 +99,9 @@ test_all(TestBatch *batch) {
 }
 
 void
-TestFSDH_run_tests() {
-    TestBatch *batch = TestBatch_new(5);
-
-    TestBatch_Plan(batch);
+TestFSDH_run_tests(TestFSDirHandle *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_all(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFSDirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSDirHandle.cfh b/core/Lucy/Test/Store/TestFSDirHandle.cfh
index 1ea21e0..1af12e4 100644
--- a/core/Lucy/Test/Store/TestFSDirHandle.cfh
+++ b/core/Lucy/Test/Store/TestFSDirHandle.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestFSDirHandle cnick TestFSDH {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestFSDirHandle cnick TestFSDH
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestFSDirHandle*
+    new();
+
+    inert TestFSDirHandle*
+    init(TestFSDirHandle *self);
+
+    void
+    Run_Tests(TestFSDirHandle *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFSFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFileHandle.c b/core/Lucy/Test/Store/TestFSFileHandle.c
index 40ecabb..1151fc4 100644
--- a/core/Lucy/Test/Store/TestFSFileHandle.c
+++ b/core/Lucy/Test/Store/TestFSFileHandle.c
@@ -31,6 +31,17 @@
 #include "Lucy/Store/FSFileHandle.h"
 #include "Lucy/Store/FileWindow.h"
 
+TestFSFileHandle*
+TestFSFH_new() {
+    TestFSFileHandle *self = (TestFSFileHandle*)VTable_Make_Obj(TESTFSFILEHANDLE);
+    return TestFSFH_init(self);
+}
+
+TestFSFileHandle*
+TestFSFH_init(TestFSFileHandle *self) {
+    return (TestFSFileHandle*)TestBatch_init((TestBatch*)self, 46);
+}
+
 static void
 test_open(TestBatch *batch) {
 
@@ -241,16 +252,12 @@ test_Window(TestBatch *batch) {
 }
 
 void
-TestFSFH_run_tests() {
-    TestBatch *batch = TestBatch_new(46);
-
-    TestBatch_Plan(batch);
+TestFSFH_run_tests(TestFSFileHandle *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_open(batch);
     test_Read_Write(batch);
     test_Close(batch);
     test_Window(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFSFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFileHandle.cfh b/core/Lucy/Test/Store/TestFSFileHandle.cfh
index dffaeee..dc7c99a 100644
--- a/core/Lucy/Test/Store/TestFSFileHandle.cfh
+++ b/core/Lucy/Test/Store/TestFSFileHandle.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestFSFileHandle cnick TestFSFH {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestFSFileHandle cnick TestFSFH
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestFSFileHandle*
+    new();
+
+    inert TestFSFileHandle*
+    init(TestFSFileHandle *self);
+
+    void
+    Run_Tests(TestFSFileHandle *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFolder.c b/core/Lucy/Test/Store/TestFSFolder.c
index 66030e6..6986963 100644
--- a/core/Lucy/Test/Store/TestFSFolder.c
+++ b/core/Lucy/Test/Store/TestFSFolder.c
@@ -47,6 +47,18 @@ static bool
 S_create_test_symlinks(void);
 #endif /* CHY_HAS_WINDOWS_H */
 
+TestFSFolder*
+TestFSFolder_new() {
+    TestFSFolder *self = (TestFSFolder*)VTable_Make_Obj(TESTFSFOLDER);
+    return TestFSFolder_init(self);
+}
+
+TestFSFolder*
+TestFSFolder_init(TestFSFolder *self) {
+    uint32_t num_tests = TestFolderCommon_num_tests() + 9;
+    return (TestFSFolder*)TestBatch_init((TestBatch*)self, num_tests);
+}
+
 static Folder*
 S_set_up() {
     rmdir("_fstest");
@@ -163,17 +175,12 @@ test_disallow_updir(TestBatch *batch) {
 }
 
 void
-TestFSFolder_run_tests() {
-    uint32_t num_tests = TestFolderCommon_num_tests() + 9;
-    TestBatch *batch = TestBatch_new(num_tests);
-
-    TestBatch_Plan(batch);
+TestFSFolder_run_tests(TestFSFolder *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Initialize_and_Check(batch);
     TestFolderCommon_run_tests(batch, S_set_up, S_tear_down);
     test_protect_symlinks(batch);
     test_disallow_updir(batch);
-
-    DECREF(batch);
 }
 
 #ifdef ENABLE_SYMLINK_TESTS

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFSFolder.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFolder.cfh b/core/Lucy/Test/Store/TestFSFolder.cfh
index 726e149..185bd29 100644
--- a/core/Lucy/Test/Store/TestFSFolder.cfh
+++ b/core/Lucy/Test/Store/TestFSFolder.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestFSFolder {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestFSFolder
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestFSFolder*
+    new();
+
+    inert TestFSFolder*
+    init(TestFSFolder *self);
+
+    void
+    Run_Tests(TestFSFolder *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFileHandle.c b/core/Lucy/Test/Store/TestFileHandle.c
index 14aa1e3..6f26b49 100644
--- a/core/Lucy/Test/Store/TestFileHandle.c
+++ b/core/Lucy/Test/Store/TestFileHandle.c
@@ -24,6 +24,17 @@
 #include "Lucy/Store/FileHandle.h"
 #include "Lucy/Store/FileWindow.h"
 
+TestFileHandle*
+TestFH_new() {
+    TestFileHandle *self = (TestFileHandle*)VTable_Make_Obj(TESTFILEHANDLE);
+    return TestFH_init(self);
+}
+
+TestFileHandle*
+TestFH_init(TestFileHandle *self) {
+    return (TestFileHandle*)TestBatch_init((TestBatch*)self, 2);
+}
+
 static void
 S_no_op_method(const void *vself) {
     UNUSED_VAR(vself);
@@ -43,19 +54,16 @@ S_new_filehandle() {
 }
 
 void
-TestFH_run_tests() {
-    TestBatch     *batch  = TestBatch_new(2);
-    FileHandle    *fh     = S_new_filehandle();
-    ZombieCharBuf *foo    = ZCB_WRAP_STR("foo", 3);
-
-    TestBatch_Plan(batch);
+TestFH_run_tests(TestFileHandle *self) {
+    TestBatch     *batch = (TestBatch*)self;
+    FileHandle    *fh    = S_new_filehandle();
+    ZombieCharBuf *foo   = ZCB_WRAP_STR("foo", 3);
 
     TEST_TRUE(batch, CB_Equals_Str(FH_Get_Path(fh), "", 0), "Get_Path");
     FH_Set_Path(fh, (CharBuf*)foo);
     TEST_TRUE(batch, CB_Equals(FH_Get_Path(fh), (Obj*)foo), "Set_Path");
 
     DECREF(fh);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFileHandle.cfh b/core/Lucy/Test/Store/TestFileHandle.cfh
index ebe12ea..b50cae5 100644
--- a/core/Lucy/Test/Store/TestFileHandle.cfh
+++ b/core/Lucy/Test/Store/TestFileHandle.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestFileHandle cnick TestFH {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestFileHandle cnick TestFH
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestFileHandle*
+    new();
+
+    inert TestFileHandle*
+    init(TestFileHandle *self);
+
+    void
+    Run_Tests(TestFileHandle *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFolder.c b/core/Lucy/Test/Store/TestFolder.c
index 9264301..251a056 100644
--- a/core/Lucy/Test/Store/TestFolder.c
+++ b/core/Lucy/Test/Store/TestFolder.c
@@ -37,6 +37,17 @@ static CharBuf *foo_boffo         = NULL;
 static CharBuf *foo_foo           = NULL;
 static CharBuf *nope              = NULL;
 
+TestFolder*
+TestFolder_new() {
+    TestFolder *self = (TestFolder*)VTable_Make_Obj(TESTFOLDER);
+    return TestFolder_init(self);
+}
+
+TestFolder*
+TestFolder_init(TestFolder *self) {
+    return (TestFolder*)TestBatch_init((TestBatch*)self, 79);
+}
+
 static void
 S_init_strings(void) {
     foo               = CB_newf("foo");
@@ -512,10 +523,8 @@ test_Slurp_File(TestBatch *batch) {
 }
 
 void
-TestFolder_run_tests() {
-    TestBatch *batch = TestBatch_new(79);
-
-    TestBatch_Plan(batch);
+TestFolder_run_tests(TestFolder *self) {
+    TestBatch *batch = (TestBatch*)self;
     S_init_strings();
     test_Exists(batch);
     test_Set_Path_and_Get_Path(batch);
@@ -530,7 +539,5 @@ TestFolder_run_tests() {
     test_Delete_Tree(batch);
     test_Slurp_File(batch);
     S_destroy_strings();
-
-    DECREF(batch);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestFolder.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFolder.cfh b/core/Lucy/Test/Store/TestFolder.cfh
index 6d874b7..31e6947 100644
--- a/core/Lucy/Test/Store/TestFolder.cfh
+++ b/core/Lucy/Test/Store/TestFolder.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestFolder {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestFolder
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestFolder*
+    new();
+
+    inert TestFolder*
+    init(TestFolder *self);
+
+    void
+    Run_Tests(TestFolder *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestIOChunks.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestIOChunks.c b/core/Lucy/Test/Store/TestIOChunks.c
index 2d535a8..e16de71 100644
--- a/core/Lucy/Test/Store/TestIOChunks.c
+++ b/core/Lucy/Test/Store/TestIOChunks.c
@@ -30,6 +30,17 @@
 #include "Lucy/Store/RAMFileHandle.h"
 #include "Clownfish/Util/NumberUtils.h"
 
+TestIOChunks*
+TestIOChunks_new() {
+    TestIOChunks *self = (TestIOChunks*)VTable_Make_Obj(TESTIOCHUNKS);
+    return TestIOChunks_init(self);
+}
+
+TestIOChunks*
+TestIOChunks_init(TestIOChunks *self) {
+    return (TestIOChunks*)TestBatch_init((TestBatch*)self, 36);
+}
+
 static void
 test_Align(TestBatch *batch) {
     RAMFile    *file      = RAMFile_new(NULL, false);
@@ -105,17 +116,12 @@ test_Buf(TestBatch *batch) {
 }
 
 void
-TestIOChunks_run_tests() {
-    TestBatch *batch = TestBatch_new(36);
-
+TestIOChunks_run_tests(TestIOChunks *self) {
+    TestBatch *batch = (TestBatch*)self;
     srand((unsigned int)time((time_t*)NULL));
-    TestBatch_Plan(batch);
-
     test_Align(batch);
     test_Read_Write_Bytes(batch);
     test_Buf(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestIOChunks.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestIOChunks.cfh b/core/Lucy/Test/Store/TestIOChunks.cfh
index 821b981..56eeae2 100644
--- a/core/Lucy/Test/Store/TestIOChunks.cfh
+++ b/core/Lucy/Test/Store/TestIOChunks.cfh
@@ -18,9 +18,17 @@ parcel Lucy;
 
 /** Tests reading and writing of composite types using InStream/OutStream.
  */
-inert class Lucy::Test::Store::TestIOChunks {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestIOChunks
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestIOChunks*
+    new();
+
+    inert TestIOChunks*
+    init(TestIOChunks *self);
+
+    void
+    Run_Tests(TestIOChunks *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestIOPrimitives.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestIOPrimitives.c b/core/Lucy/Test/Store/TestIOPrimitives.c
index 64e9c56..6a598f4 100644
--- a/core/Lucy/Test/Store/TestIOPrimitives.c
+++ b/core/Lucy/Test/Store/TestIOPrimitives.c
@@ -30,6 +30,17 @@
 #include "Lucy/Store/RAMFileHandle.h"
 #include "Clownfish/Util/NumberUtils.h"
 
+TestIOPrimitives*
+TestIOPrimitives_new() {
+    TestIOPrimitives *self = (TestIOPrimitives*)VTable_Make_Obj(TESTIOPRIMITIVES);
+    return TestIOPrimitives_init(self);
+}
+
+TestIOPrimitives*
+TestIOPrimitives_init(TestIOPrimitives *self) {
+    return (TestIOPrimitives*)TestBatch_init((TestBatch*)self, 11);
+}
+
 static void
 test_i8(TestBatch *batch) {
     RAMFile    *file      = RAMFile_new(NULL, false);
@@ -410,12 +421,9 @@ test_f64(TestBatch *batch) {
 }
 
 void
-TestIOPrimitives_run_tests() {
-    TestBatch *batch = TestBatch_new(11);
-
+TestIOPrimitives_run_tests(TestIOPrimitives *self) {
+    TestBatch *batch = (TestBatch*)self;
     srand((unsigned int)time((time_t*)NULL));
-    TestBatch_Plan(batch);
-
     test_i8(batch);
     test_u8(batch);
     test_i32(batch);
@@ -426,8 +434,6 @@ TestIOPrimitives_run_tests() {
     test_c64(batch);
     test_f32(batch);
     test_f64(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestIOPrimitives.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestIOPrimitives.cfh b/core/Lucy/Test/Store/TestIOPrimitives.cfh
index 9a0ae56..bf37a9a 100644
--- a/core/Lucy/Test/Store/TestIOPrimitives.cfh
+++ b/core/Lucy/Test/Store/TestIOPrimitives.cfh
@@ -18,9 +18,17 @@ parcel Lucy;
 
 /** Tests reading and writing of primitive types using InStream/OutStream.
  */
-inert class Lucy::Test::Store::TestIOPrimitives {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestIOPrimitives
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestIOPrimitives*
+    new();
+
+    inert TestIOPrimitives*
+    init(TestIOPrimitives *self);
+
+    void
+    Run_Tests(TestIOPrimitives *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestInStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestInStream.c b/core/Lucy/Test/Store/TestInStream.c
index 586b106..e3921f1 100644
--- a/core/Lucy/Test/Store/TestInStream.c
+++ b/core/Lucy/Test/Store/TestInStream.c
@@ -30,6 +30,17 @@
 #include "Lucy/Store/RAMFileHandle.h"
 #include "Clownfish/Util/NumberUtils.h"
 
+TestInStream*
+TestInStream_new() {
+    TestInStream *self = (TestInStream*)VTable_Make_Obj(TESTINSTREAM);
+    return TestInStream_init(self);
+}
+
+TestInStream*
+TestInStream_init(TestInStream *self) {
+    return (TestInStream*)TestBatch_init((TestBatch*)self, 37);
+}
+
 static void
 test_refill(TestBatch *batch) {
     RAMFile    *file      = RAMFile_new(NULL, false);
@@ -201,17 +212,12 @@ test_Seek_and_Tell(TestBatch *batch) {
 }
 
 void
-TestInStream_run_tests() {
-    TestBatch *batch = TestBatch_new(37);
-
-    TestBatch_Plan(batch);
-
+TestInStream_run_tests(TestInStream *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_refill(batch);
     test_Clone_and_Reopen(batch);
     test_Close(batch);
     test_Seek_and_Tell(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestInStream.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestInStream.cfh b/core/Lucy/Test/Store/TestInStream.cfh
index 75d35c2..98314ab 100644
--- a/core/Lucy/Test/Store/TestInStream.cfh
+++ b/core/Lucy/Test/Store/TestInStream.cfh
@@ -20,9 +20,17 @@ parcel Lucy;
  * streamed sources.
  */
 
-inert class Lucy::Test::Store::TestInStream {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestInStream
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestInStream*
+    new();
+
+    inert TestInStream*
+    init(TestInStream *self);
+
+    void
+    Run_Tests(TestInStream *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestRAMDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMDirHandle.c b/core/Lucy/Test/Store/TestRAMDirHandle.c
index 65a886c..4767f65 100644
--- a/core/Lucy/Test/Store/TestRAMDirHandle.c
+++ b/core/Lucy/Test/Store/TestRAMDirHandle.c
@@ -23,6 +23,17 @@
 #include "Lucy/Store/RAMFolder.h"
 #include "Lucy/Store/RAMDirHandle.h"
 
+TestRAMDirHandle*
+TestRAMDH_new() {
+    TestRAMDirHandle *self = (TestRAMDirHandle*)VTable_Make_Obj(TESTRAMDIRHANDLE);
+    return TestRAMDH_init(self);
+}
+
+TestRAMDirHandle*
+TestRAMDH_init(TestRAMDirHandle *self) {
+    return (TestRAMDirHandle*)TestBatch_init((TestBatch*)self, 6);
+}
+
 static void
 test_all(TestBatch *batch) {
     RAMFolder *folder        = RAMFolder_new(NULL);
@@ -75,13 +86,9 @@ test_all(TestBatch *batch) {
 }
 
 void
-TestRAMDH_run_tests() {
-    TestBatch *batch = TestBatch_new(6);
-
-    TestBatch_Plan(batch);
+TestRAMDH_run_tests(TestRAMDirHandle *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_all(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestRAMDirHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMDirHandle.cfh b/core/Lucy/Test/Store/TestRAMDirHandle.cfh
index 362f58b..31e7edc 100644
--- a/core/Lucy/Test/Store/TestRAMDirHandle.cfh
+++ b/core/Lucy/Test/Store/TestRAMDirHandle.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestRAMDirHandle cnick TestRAMDH {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestRAMDirHandle cnick TestRAMDH
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestRAMDirHandle*
+    new();
+
+    inert TestRAMDirHandle*
+    init(TestRAMDirHandle *self);
+
+    void
+    Run_Tests(TestRAMDirHandle *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestRAMFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFileHandle.c b/core/Lucy/Test/Store/TestRAMFileHandle.c
index 446cfab..2b254d2 100644
--- a/core/Lucy/Test/Store/TestRAMFileHandle.c
+++ b/core/Lucy/Test/Store/TestRAMFileHandle.c
@@ -27,6 +27,17 @@
 #include "Lucy/Store/FileWindow.h"
 #include "Lucy/Store/RAMFile.h"
 
+TestRAMFileHandle*
+TestRAMFH_new() {
+    TestRAMFileHandle *self = (TestRAMFileHandle*)VTable_Make_Obj(TESTRAMFILEHANDLE);
+    return TestRAMFH_init(self);
+}
+
+TestRAMFileHandle*
+TestRAMFH_init(TestRAMFileHandle *self) {
+    return (TestRAMFileHandle*)TestBatch_init((TestBatch*)self, 32);
+}
+
 static void
 test_open(TestBatch *batch) {
     RAMFileHandle *fh;
@@ -157,17 +168,13 @@ test_Window(TestBatch *batch) {
 }
 
 void
-TestRAMFH_run_tests() {
-    TestBatch *batch = TestBatch_new(32);
-
-    TestBatch_Plan(batch);
+TestRAMFH_run_tests(TestRAMFileHandle *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_open(batch);
     test_Read_Write(batch);
     test_Grow_and_Get_File(batch);
     test_Close(batch);
     test_Window(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestRAMFileHandle.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFileHandle.cfh b/core/Lucy/Test/Store/TestRAMFileHandle.cfh
index 3621839..7691fab 100644
--- a/core/Lucy/Test/Store/TestRAMFileHandle.cfh
+++ b/core/Lucy/Test/Store/TestRAMFileHandle.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestRAMFileHandle cnick TestRAMFH {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestRAMFileHandle cnick TestRAMFH
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestRAMFileHandle*
+    new();
+
+    inert TestRAMFileHandle*
+    init(TestRAMFileHandle *self);
+
+    void
+    Run_Tests(TestRAMFileHandle *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestRAMFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFolder.c b/core/Lucy/Test/Store/TestRAMFolder.c
index 1da1b5c..3b1f6d8 100644
--- a/core/Lucy/Test/Store/TestRAMFolder.c
+++ b/core/Lucy/Test/Store/TestRAMFolder.c
@@ -37,6 +37,17 @@ static CharBuf *foo_foo       = NULL;
 static CharBuf *nope          = NULL;
 static CharBuf *nope_nyet     = NULL;
 
+TestRAMFolder*
+TestRAMFolder_new() {
+    TestRAMFolder *self = (TestRAMFolder*)VTable_Make_Obj(TESTRAMFOLDER);
+    return TestRAMFolder_init(self);
+}
+
+TestRAMFolder*
+TestRAMFolder_init(TestRAMFolder *self) {
+    return (TestRAMFolder*)TestBatch_init((TestBatch*)self, 98);
+}
+
 static void
 S_init_strings(void) {
     foo           = CB_newf("foo");
@@ -494,10 +505,8 @@ test_Close(TestBatch *batch) {
 }
 
 void
-TestRAMFolder_run_tests() {
-    TestBatch *batch = TestBatch_new(98);
-
-    TestBatch_Plan(batch);
+TestRAMFolder_run_tests(TestRAMFolder *self) {
+    TestBatch *batch = (TestBatch*)self;
     S_init_strings();
     test_Initialize_and_Check(batch);
     test_Local_Exists(batch);
@@ -511,8 +520,6 @@ TestRAMFolder_run_tests() {
     test_Hard_Link(batch);
     test_Close(batch);
     S_destroy_strings();
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Store/TestRAMFolder.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFolder.cfh b/core/Lucy/Test/Store/TestRAMFolder.cfh
index 2b80d2b..a910409 100644
--- a/core/Lucy/Test/Store/TestRAMFolder.cfh
+++ b/core/Lucy/Test/Store/TestRAMFolder.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Store::TestRAMFolder {
-    inert void
-    run_tests();
+class Lucy::Test::Store::TestRAMFolder
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestRAMFolder*
+    new();
+
+    inert TestRAMFolder*
+    init(TestRAMFolder *self);
+
+    void
+    Run_Tests(TestRAMFolder *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/TestSchema.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/TestSchema.c b/core/Lucy/Test/TestSchema.c
index a493e10..9cedef1 100644
--- a/core/Lucy/Test/TestSchema.c
+++ b/core/Lucy/Test/TestSchema.c
@@ -51,6 +51,17 @@ TestSchema_architecture(TestSchema *self) {
     return (Architecture*)TestArch_new();
 }
 
+TestBatchSchema*
+TestBatchSchema_new() {
+    TestBatchSchema *self = (TestBatchSchema*)VTable_Make_Obj(TESTBATCHSCHEMA);
+    return TestBatchSchema_init(self);
+}
+
+TestBatchSchema*
+TestBatchSchema_init(TestBatchSchema *self) {
+    return (TestBatchSchema*)TestBatch_init((TestBatch*)self, 4);
+}
+
 static void
 test_Equals(TestBatch *batch) {
     TestSchema *schema = TestSchema_new();
@@ -91,12 +102,10 @@ test_Dump_and_Load(TestBatch *batch) {
 }
 
 void
-TestSchema_run_tests() {
-    TestBatch *batch = TestBatch_new(4);
-    TestBatch_Plan(batch);
+TestBatchSchema_run_tests(TestBatchSchema *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Equals(batch);
     test_Dump_and_Load(batch);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/TestSchema.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/TestSchema.cfh b/core/Lucy/Test/TestSchema.cfh
index 3a7b332..ac650ba 100644
--- a/core/Lucy/Test/TestSchema.cfh
+++ b/core/Lucy/Test/TestSchema.cfh
@@ -31,9 +31,19 @@ class Lucy::Test::TestSchema inherits Lucy::Plan::Schema {
 
     public incremented Architecture*
     Architecture(TestSchema *self);
+}
+
+class Lucy::Test::TestBatchSchema
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestBatchSchema*
+    new();
+
+    inert TestBatchSchema*
+    init(TestBatchSchema *self);
 
-    inert void
-    run_tests();
+    void
+    Run_Tests(TestBatchSchema *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestAtomic.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestAtomic.c b/core/Lucy/Test/Util/TestAtomic.c
index ea03571..cc23acf 100644
--- a/core/Lucy/Test/Util/TestAtomic.c
+++ b/core/Lucy/Test/Util/TestAtomic.c
@@ -20,6 +20,17 @@
 #include "Lucy/Test/Util/TestAtomic.h"
 #include "Clownfish/Util/Atomic.h"
 
+TestAtomic*
+TestAtomic_new() {
+    TestAtomic *self = (TestAtomic*)VTable_Make_Obj(TESTATOMIC);
+    return TestAtomic_init(self);
+}
+
+TestAtomic*
+TestAtomic_init(TestAtomic *self) {
+    return (TestAtomic*)TestBatch_init((TestBatch*)self, 6);
+}
+
 static void
 test_cas_ptr(TestBatch *batch) {
     int    foo = 1;
@@ -48,14 +59,9 @@ test_cas_ptr(TestBatch *batch) {
 }
 
 void
-TestAtomic_run_tests() {
-    TestBatch *batch = TestBatch_new(6);
-
-    TestBatch_Plan(batch);
-
+TestAtomic_run_tests(TestAtomic *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_cas_ptr(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestAtomic.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestAtomic.cfh b/core/Lucy/Test/Util/TestAtomic.cfh
index b359bd5..db92bb4 100644
--- a/core/Lucy/Test/Util/TestAtomic.cfh
+++ b/core/Lucy/Test/Util/TestAtomic.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Util::TestAtomic {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestAtomic
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestAtomic*
+    new();
+
+    inert TestAtomic*
+    init(TestAtomic *self);
+
+    void
+    Run_Tests(TestAtomic *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestIndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestIndexFileNames.c b/core/Lucy/Test/Util/TestIndexFileNames.c
index e450e76..72e0e3c 100644
--- a/core/Lucy/Test/Util/TestIndexFileNames.c
+++ b/core/Lucy/Test/Util/TestIndexFileNames.c
@@ -20,6 +20,17 @@
 #include "Lucy/Test/Util/TestIndexFileNames.h"
 #include "Lucy/Util/IndexFileNames.h"
 
+TestIndexFileNames*
+TestIxFileNames_new() {
+    TestIndexFileNames *self = (TestIndexFileNames*)VTable_Make_Obj(TESTINDEXFILENAMES);
+    return TestIxFileNames_init(self);
+}
+
+TestIndexFileNames*
+TestIxFileNames_init(TestIndexFileNames *self) {
+    return (TestIndexFileNames*)TestBatch_init((TestBatch*)self, 10);
+}
+
 static void
 test_local_part(TestBatch *batch) {
     ZombieCharBuf *source = ZCB_BLANK();
@@ -72,15 +83,10 @@ test_extract_gen(TestBatch *batch) {
 }
 
 void
-TestIxFileNames_run_tests() {
-    TestBatch *batch = TestBatch_new(10);
-
-    TestBatch_Plan(batch);
-
+TestIxFileNames_run_tests(TestIndexFileNames *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_local_part(batch);
     test_extract_gen(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestIndexFileNames.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestIndexFileNames.cfh b/core/Lucy/Test/Util/TestIndexFileNames.cfh
index e659d65..e86c150 100644
--- a/core/Lucy/Test/Util/TestIndexFileNames.cfh
+++ b/core/Lucy/Test/Util/TestIndexFileNames.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Util::TestIndexFileNames cnick TestIxFileNames {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestIndexFileNames cnick TestIxFileNames
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestIndexFileNames*
+    new();
+
+    inert TestIndexFileNames*
+    init(TestIndexFileNames *self);
+
+    void
+    Run_Tests(TestIndexFileNames *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestJson.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestJson.c b/core/Lucy/Test/Util/TestJson.c
index b5e646e..2ef1d16 100644
--- a/core/Lucy/Test/Util/TestJson.c
+++ b/core/Lucy/Test/Util/TestJson.c
@@ -23,6 +23,21 @@
 #include "Lucy/Store/FileHandle.h"
 #include "Lucy/Store/RAMFolder.h"
 
+TestJson*
+TestJson_new() {
+    TestJson *self = (TestJson*)VTable_Make_Obj(TESTJSON);
+    return TestJson_init(self);
+}
+
+TestJson*
+TestJson_init(TestJson *self) {
+    int num_tests = 107;
+#ifndef LUCY_VALGRIND
+    num_tests += 28; // FIXME: syntax errors leak memory.
+#endif
+    return (TestJson*)TestBatch_init((TestBatch*)self, num_tests);
+}
+
 // Create a test data structure including at least one each of Hash, VArray,
 // and CharBuf.
 static Obj*
@@ -346,13 +361,8 @@ test_illegal_keys(TestBatch *batch) {
 }
 
 void
-TestJson_run_tests() {
-    int num_tests = 107;
-#ifndef LUCY_VALGRIND
-    num_tests += 28; // FIXME: syntax errors leak memory.
-#endif
-    TestBatch *batch = TestBatch_new(num_tests);
-    TestBatch_Plan(batch);
+TestJson_run_tests(TestJson *self) {
+    TestBatch *batch = (TestBatch*)self;
 
     // Test tolerance, then liberalize for testing.
     test_tolerance(batch);
@@ -370,7 +380,5 @@ TestJson_run_tests() {
 #ifndef LUCY_VALGRIND
     test_syntax_errors(batch);
 #endif
-
-    DECREF(batch);
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestJson.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestJson.cfh b/core/Lucy/Test/Util/TestJson.cfh
index e54bb67..78bf2d9 100644
--- a/core/Lucy/Test/Util/TestJson.cfh
+++ b/core/Lucy/Test/Util/TestJson.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Util::TestJson  {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestJson
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestJson*
+    new();
+
+    inert TestJson*
+    init(TestJson *self);
+
+    void
+    Run_Tests(TestJson *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestMemory.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestMemory.c b/core/Lucy/Test/Util/TestMemory.c
index 5c2e4f7..8d2676f 100644
--- a/core/Lucy/Test/Util/TestMemory.c
+++ b/core/Lucy/Test/Util/TestMemory.c
@@ -21,6 +21,17 @@
 #include "Lucy/Test.h"
 #include "Lucy/Test/Util/TestMemory.h"
 
+TestMemory*
+TestMemory_new() {
+    TestMemory *self = (TestMemory*)VTable_Make_Obj(TESTMEMORY);
+    return TestMemory_init(self);
+}
+
+TestMemory*
+TestMemory_init(TestMemory *self) {
+    return (TestMemory*)TestBatch_init((TestBatch*)self, 30);
+}
+
 static void
 test_oversize__growth_rate(TestBatch *batch) {
     bool     success             = true;
@@ -99,15 +110,11 @@ test_oversize__rounding(TestBatch *batch) {
 }
 
 void
-TestMemory_run_tests() {
-    TestBatch *batch = TestBatch_new(30);
-
-    TestBatch_Plan(batch);
+TestMemory_run_tests(TestMemory *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_oversize__growth_rate(batch);
     test_oversize__ceiling(batch);
     test_oversize__rounding(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestMemory.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestMemory.cfh b/core/Lucy/Test/Util/TestMemory.cfh
index bf5e565..57ae65d 100644
--- a/core/Lucy/Test/Util/TestMemory.cfh
+++ b/core/Lucy/Test/Util/TestMemory.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Util::TestMemory {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestMemory
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestMemory*
+    new();
+
+    inert TestMemory*
+    init(TestMemory *self);
+
+    void
+    Run_Tests(TestMemory *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestMemoryPool.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestMemoryPool.c b/core/Lucy/Test/Util/TestMemoryPool.c
index 35551ed..90c5f7e 100644
--- a/core/Lucy/Test/Util/TestMemoryPool.c
+++ b/core/Lucy/Test/Util/TestMemoryPool.c
@@ -22,15 +22,24 @@
 #include "Lucy/Test/Util/TestMemoryPool.h"
 #include "Lucy/Util/MemoryPool.h"
 
+TestMemoryPool*
+TestMemPool_new() {
+    TestMemoryPool *self = (TestMemoryPool*)VTable_Make_Obj(TESTMEMORYPOOL);
+    return TestMemPool_init(self);
+}
+
+TestMemoryPool*
+TestMemPool_init(TestMemoryPool *self) {
+    return (TestMemoryPool*)TestBatch_init((TestBatch*)self, 4);
+}
+
 void
-TestMemPool_run_tests() {
-    TestBatch  *batch     = TestBatch_new(4);
-    MemoryPool *mem_pool  = MemPool_new(0);
-    MemoryPool *other     = MemPool_new(0);
+TestMemPool_run_tests(TestMemoryPool *self) {
+    TestBatch  *batch    = (TestBatch*)self;
+    MemoryPool *mem_pool = MemPool_new(0);
+    MemoryPool *other    = MemPool_new(0);
     char *ptr_a, *ptr_b;
 
-    TestBatch_Plan(batch);
-
     ptr_a = (char*)MemPool_Grab(mem_pool, 10);
     strcpy(ptr_a, "foo");
     MemPool_Release_All(mem_pool);
@@ -50,7 +59,6 @@ TestMemPool_run_tests() {
 
     DECREF(mem_pool);
     DECREF(other);
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestMemoryPool.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestMemoryPool.cfh b/core/Lucy/Test/Util/TestMemoryPool.cfh
index a61d8f5..84c9d46 100644
--- a/core/Lucy/Test/Util/TestMemoryPool.cfh
+++ b/core/Lucy/Test/Util/TestMemoryPool.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Util::TestMemoryPool cnick TestMemPool {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestMemoryPool cnick TestMemPool
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestMemoryPool*
+    new();
+
+    inert TestMemoryPool*
+    init(TestMemoryPool *self);
+
+    void
+    Run_Tests(TestMemoryPool *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestNumberUtils.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestNumberUtils.c b/core/Lucy/Test/Util/TestNumberUtils.c
index bad0f2b..8acee0a 100644
--- a/core/Lucy/Test/Util/TestNumberUtils.c
+++ b/core/Lucy/Test/Util/TestNumberUtils.c
@@ -24,6 +24,17 @@
 #include "Lucy/Test/Util/TestNumberUtils.h"
 #include "Clownfish/Util/NumberUtils.h"
 
+TestNumberUtils*
+TestNumUtil_new() {
+    TestNumberUtils *self = (TestNumberUtils*)VTable_Make_Obj(TESTNUMBERUTILS);
+    return TestNumUtil_init(self);
+}
+
+TestNumberUtils*
+TestNumUtil_init(TestNumberUtils *self) {
+    return (TestNumberUtils*)TestBatch_init((TestBatch*)self, 1196);
+}
+
 static void
 test_u1(TestBatch *batch) {
     size_t    count   = 64;
@@ -345,12 +356,9 @@ test_bigend_f64(TestBatch *batch) {
 }
 
 void
-TestNumUtil_run_tests() {
-    TestBatch *batch = TestBatch_new(1196);
-
-    TestBatch_Plan(batch);
+TestNumUtil_run_tests(TestNumberUtils *self) {
+    TestBatch *batch = (TestBatch*)self;
     srand((unsigned int)time((time_t*)NULL));
-
     test_u1(batch);
     test_u2(batch);
     test_u4(batch);
@@ -361,8 +369,6 @@ TestNumUtil_run_tests() {
     test_bigend_u64(batch);
     test_bigend_f32(batch);
     test_bigend_f64(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestNumberUtils.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestNumberUtils.cfh b/core/Lucy/Test/Util/TestNumberUtils.cfh
index 2b45719..0d001b5 100644
--- a/core/Lucy/Test/Util/TestNumberUtils.cfh
+++ b/core/Lucy/Test/Util/TestNumberUtils.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Util::TestNumberUtils cnick TestNumUtil {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestNumberUtils cnick TestNumUtil
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestNumberUtils*
+    new();
+
+    inert TestNumberUtils*
+    init(TestNumberUtils *self);
+
+    void
+    Run_Tests(TestNumberUtils *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestPriorityQueue.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestPriorityQueue.c b/core/Lucy/Test/Util/TestPriorityQueue.c
index a66446e..f756efc 100644
--- a/core/Lucy/Test/Util/TestPriorityQueue.c
+++ b/core/Lucy/Test/Util/TestPriorityQueue.c
@@ -21,6 +21,17 @@
 #include "Lucy/Test/Util/TestPriorityQueue.h"
 #include "Lucy/Util/PriorityQueue.h"
 
+TestPriorityQueue*
+TestPriQ_new() {
+    TestPriorityQueue *self = (TestPriorityQueue*)VTable_Make_Obj(TESTPRIORITYQUEUE);
+    return TestPriQ_init(self);
+}
+
+TestPriorityQueue*
+TestPriQ_init(TestPriorityQueue *self) {
+    return (TestPriorityQueue*)TestBatch_init((TestBatch*)self, 17);
+}
+
 NumPriorityQueue*
 NumPriQ_new(uint32_t max_size) {
     NumPriorityQueue *self
@@ -145,17 +156,12 @@ test_random_insertion(TestBatch *batch) {
 }
 
 void
-TestPriQ_run_tests() {
-    TestBatch *batch = TestBatch_new(17);
-
-    TestBatch_Plan(batch);
-
+TestPriQ_run_tests(TestPriorityQueue *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_Peek_and_Pop_All(batch);
     test_Insert_and_Pop(batch);
     test_discard(batch);
     test_random_insertion(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestPriorityQueue.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestPriorityQueue.cfh b/core/Lucy/Test/Util/TestPriorityQueue.cfh
index d575a2c..5210b66 100644
--- a/core/Lucy/Test/Util/TestPriorityQueue.cfh
+++ b/core/Lucy/Test/Util/TestPriorityQueue.cfh
@@ -26,9 +26,17 @@ class Lucy::Test::Util::NumPriorityQueue cnick NumPriQ
     Less_Than(NumPriorityQueue *self, Obj *a, Obj *b);
 }
 
-inert class Lucy::Test::Util::TestPriorityQueue cnick TestPriQ {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestPriorityQueue cnick TestPriQ
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestPriorityQueue*
+    new();
+
+    inert TestPriorityQueue*
+    init(TestPriorityQueue *self);
+
+    void
+    Run_Tests(TestPriorityQueue *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestStringHelper.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestStringHelper.c b/core/Lucy/Test/Util/TestStringHelper.c
index 650aad8..1c5ec8b 100644
--- a/core/Lucy/Test/Util/TestStringHelper.c
+++ b/core/Lucy/Test/Util/TestStringHelper.c
@@ -27,6 +27,17 @@
  * it implements the standard in a more linear, easy-to-grok way.
  */
 #define TRAIL_OK(n) (n >= 0x80 && n <= 0xBF)
+TestStringHelper*
+TestStrHelp_new() {
+    TestStringHelper *self = (TestStringHelper*)VTable_Make_Obj(TESTSTRINGHELPER);
+    return TestStrHelp_init(self);
+}
+
+TestStringHelper*
+TestStrHelp_init(TestStringHelper *self) {
+    return (TestStringHelper*)TestBatch_init((TestBatch*)self, 41);
+}
+
 static bool
 S_utf8_valid_alt(const char *maybe_utf8, size_t size) {
     const uint8_t *string = (const uint8_t*)maybe_utf8;
@@ -327,11 +338,8 @@ test_utf8proc_normalization(TestBatch *batch) {
 }
 
 void
-TestStrHelp_run_tests() {
-    TestBatch *batch = TestBatch_new(41);
-
-    TestBatch_Plan(batch);
-
+TestStrHelp_run_tests(TestStringHelper *self) {
+    TestBatch *batch = (TestBatch*)self;
     test_overlap(batch);
     test_to_base36(batch);
     test_utf8_round_trip(batch);
@@ -339,8 +347,6 @@ TestStrHelp_run_tests() {
     test_is_whitespace(batch);
     test_back_utf8_char(batch);
     test_utf8proc_normalization(batch);
-
-    DECREF(batch);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/core/Lucy/Test/Util/TestStringHelper.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestStringHelper.cfh b/core/Lucy/Test/Util/TestStringHelper.cfh
index 2cee286..93e4ebb 100644
--- a/core/Lucy/Test/Util/TestStringHelper.cfh
+++ b/core/Lucy/Test/Util/TestStringHelper.cfh
@@ -16,9 +16,17 @@
 
 parcel Lucy;
 
-inert class Lucy::Test::Util::TestStringHelper cnick TestStrHelp {
-    inert void
-    run_tests();
+class Lucy::Test::Util::TestStringHelper cnick TestStrHelp
+    inherits Lucy::Test::TestBatch {
+
+    inert incremented TestStringHelper*
+    new();
+
+    inert TestStringHelper*
+    init(TestStringHelper *self);
+
+    void
+    Run_Tests(TestStringHelper *self);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/buildlib/Lucy/Build/Binding/Misc.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build/Binding/Misc.pm b/perl/buildlib/Lucy/Build/Binding/Misc.pm
index 535dc7b..b9a8ca0 100644
--- a/perl/buildlib/Lucy/Build/Binding/Misc.pm
+++ b/perl/buildlib/Lucy/Build/Binding/Misc.pm
@@ -83,235 +83,19 @@ sub bind_test {
     my $xs_code = <<'END_XS_CODE';
 MODULE = Lucy   PACKAGE = Lucy::Test
 
-void
+bool
 run_tests(package)
     char *package;
-PPCODE:
-{
-    // Lucy::Analysis
-    if (strEQ(package, "TestAnalyzer")) {
-        lucy_TestAnalyzer_run_tests();
-    }
-    else if (strEQ(package, "TestCaseFolder")) {
-        lucy_TestCaseFolder_run_tests();
-    }
-    else if (strEQ(package, "TestPolyAnalyzer")) {
-        lucy_TestPolyAnalyzer_run_tests();
-    }
-    else if (strEQ(package, "TestSnowballStopFilter")) {
-        lucy_TestSnowStop_run_tests();
-    }
-    else if (strEQ(package, "TestSnowStemmer")) {
-        lucy_TestSnowStemmer_run_tests();
-    }
-    else if (strEQ(package, "TestNormalizer")) {
-        lucy_TestNormalizer_run_tests();
-    }
-    else if (strEQ(package, "TestRegexTokenizer")) {
-        lucy_TestRegexTokenizer_run_tests();
-    }
-    else if (strEQ(package, "TestStandardTokenizer")) {
-        lucy_TestStandardTokenizer_run_tests();
-    }
-    // Lucy::Object
-    else if (strEQ(package, "TestErr")) {
-        lucy_TestErr_run_tests();
-    }
-    else if (strEQ(package, "TestObj")) {
-        lucy_TestObj_run_tests();
-    }
-    else if (strEQ(package, "TestI32Array")) {
-        lucy_TestI32Arr_run_tests();
-    }
-    else if (strEQ(package, "TestByteBuf")) {
-        lucy_TestBB_run_tests();
-    }
-    else if (strEQ(package, "TestLockFreeRegistry")) {
-        lucy_TestLFReg_run_tests();
-    }
-    // Lucy::Plan
-    else if (strEQ(package, "TestBlobType")) {
-        lucy_TestBlobType_run_tests();
-    }
-    else if (strEQ(package, "TestFieldMisc")) {
-        lucy_TestFieldMisc_run_tests();
-    }
-    else if (strEQ(package, "TestFieldType")) {
-        lucy_TestFType_run_tests();
-    }
-    else if (strEQ(package, "TestFullTextType")) {
-        lucy_TestFullTextType_run_tests();
-    }
-    else if (strEQ(package, "TestNumericType")) {
-        lucy_TestNumericType_run_tests();
-    }
-    else if (strEQ(package, "TestSchema")) {
-        lucy_TestSchema_run_tests();
-    }
-    // Lucy::Index
-    else if (strEQ(package, "TestDocWriter")) {
-        lucy_TestDocWriter_run_tests();
-    }
-    else if (strEQ(package, "TestHighlightWriter")) {
-        lucy_TestHLWriter_run_tests();
-    }
-    else if (strEQ(package, "TestIndexManager")) {
-        lucy_TestIxManager_run_tests();
-    }
-    else if (strEQ(package, "TestPolyReader")) {
-        lucy_TestPolyReader_run_tests();
-    }
-    else if (strEQ(package, "TestPostingListWriter")) {
-        lucy_TestPListWriter_run_tests();
-    }
-    else if (strEQ(package, "TestSegment")) {
-        lucy_TestSeg_run_tests();
-    }
-    else if (strEQ(package, "TestSegWriter")) {
-        lucy_TestSegWriter_run_tests();
-    }
-    else if (strEQ(package, "TestSnapshot")) {
-        lucy_TestSnapshot_run_tests();
-    }
-    else if (strEQ(package, "TestTermInfo")) {
-        lucy_TestTermInfo_run_tests();
-    }
-    // Lucy::Search
-    else if (strEQ(package, "TestANDQuery")) {
-        lucy_TestANDQuery_run_tests();
-    }
-    else if (strEQ(package, "TestLeafQuery")) {
-        lucy_TestLeafQuery_run_tests();
-    }
-    else if (strEQ(package, "TestMatchAllQuery")) {
-        lucy_TestMatchAllQuery_run_tests();
-    }
-    else if (strEQ(package, "TestNoMatchQuery")) {
-        lucy_TestNoMatchQuery_run_tests();
-    }
-    else if (strEQ(package, "TestNOTQuery")) {
-        lucy_TestNOTQuery_run_tests();
-    }
-    else if (strEQ(package, "TestORQuery")) {
-        lucy_TestORQuery_run_tests();
-    }
-    else if (strEQ(package, "TestPhraseQuery")) {
-        lucy_TestPhraseQuery_run_tests();
-    }
-    else if (strEQ(package, "TestQueryParserLogic")) {
-        lucy_TestQPLogic_run_tests();
-    }
-    else if (strEQ(package, "TestRangeQuery")) {
-        lucy_TestRangeQuery_run_tests();
-    }
-    else if (strEQ(package, "TestReqOptQuery")) {
-        lucy_TestReqOptQuery_run_tests();
-    }
-    else if (strEQ(package, "TestSeriesMatcher")) {
-        lucy_TestSeriesMatcher_run_tests();
-    }
-    else if (strEQ(package, "TestSortSpec")) {
-        lucy_TestSortSpec_run_tests();
-    }
-    else if (strEQ(package, "TestSpan")) {
-        lucy_TestSpan_run_tests();
-    }
-    else if (strEQ(package, "TestTermQuery")) {
-        lucy_TestTermQuery_run_tests();
-    }
-    // Lucy::Store
-    else if (strEQ(package, "TestCompoundFileReader")) {
-        lucy_TestCFReader_run_tests();
-    }
-    else if (strEQ(package, "TestCompoundFileWriter")) {
-        lucy_TestCFWriter_run_tests();
-    }
-    else if (strEQ(package, "TestFileHandle")) {
-        lucy_TestFH_run_tests();
-    }
-    else if (strEQ(package, "TestFolder")) {
-        lucy_TestFolder_run_tests();
-    }
-    else if (strEQ(package, "TestFSDirHandle")) {
-        lucy_TestFSDH_run_tests();
-    }
-    else if (strEQ(package, "TestFSFolder")) {
-        lucy_TestFSFolder_run_tests();
-    }
-    else if (strEQ(package, "TestFSFileHandle")) {
-        lucy_TestFSFH_run_tests();
-    }
-    else if (strEQ(package, "TestInStream")) {
-        lucy_TestInStream_run_tests();
-    }
-    else if (strEQ(package, "TestIOChunks")) {
-        lucy_TestIOChunks_run_tests();
-    }
-    else if (strEQ(package, "TestIOPrimitives")) {
-        lucy_TestIOPrimitives_run_tests();
-    }
-    else if (strEQ(package, "TestRAMDirHandle")) {
-        lucy_TestRAMDH_run_tests();
-    }
-    else if (strEQ(package, "TestRAMFileHandle")) {
-        lucy_TestRAMFH_run_tests();
-    }
-    else if (strEQ(package, "TestRAMFolder")) {
-        lucy_TestRAMFolder_run_tests();
-    }
-    // Lucy::Util
-    else if (strEQ(package, "TestAtomic")) {
-        lucy_TestAtomic_run_tests();
-    }
-    else if (strEQ(package, "TestBitVector")) {
-        lucy_TestBitVector_run_tests();
-    }
-    else if (strEQ(package, "TestCharBuf")) {
-        lucy_TestCB_run_tests();
-    }
-    else if (strEQ(package, "TestHash")) {
-        lucy_TestHash_run_tests();
-    }
-    else if (strEQ(package, "TestJson")) {
-        lucy_TestJson_run_tests();
-    }
-    else if (strEQ(package, "TestMemory")) {
-        lucy_TestMemory_run_tests();
-    }
-    else if (strEQ(package, "TestIndexFileNames")) {
-        lucy_TestIxFileNames_run_tests();
-    }
-    else if (strEQ(package, "TestNumberUtils")) {
-        lucy_TestNumUtil_run_tests();
-    }
-    else if (strEQ(package, "TestNum")) {
-        lucy_TestNum_run_tests();
-    }
-    else if (strEQ(package, "TestPriorityQueue")) {
-        lucy_TestPriQ_run_tests();
-    }
-    else if (strEQ(package, "TestStringHelper")) {
-        lucy_TestStrHelp_run_tests();
-    }
-    else if (strEQ(package, "TestMemoryPool")) {
-        lucy_TestMemPool_run_tests();
-    }
-    else if (strEQ(package, "TestVArray")) {
-        lucy_TestVArray_run_tests();
-    }
-    // Lucy::Highlight
-    else if (strEQ(package, "TestHighlighter")) {
-        lucy_TestHighlighter_run_tests();
-    }
-    else {
-        lucy_CharBuf *class_name = lucy_CB_newf("%s", package);
-        lucy_TestFormatter *formatter
-            = (lucy_TestFormatter*)lucy_TestFormatterTAP_new();
-        lucy_Test_run_batch(class_name, formatter);
-        CFISH_DECREF(class_name);
-        CFISH_DECREF(formatter);
-    }
-}
+CODE:
+    lucy_CharBuf *class_name = lucy_CB_newf("%s", package);
+    lucy_TestFormatter *formatter
+        = (lucy_TestFormatter*)lucy_TestFormatterTAP_new();
+    bool result = lucy_Test_run_batch(class_name, formatter);
+    CFISH_DECREF(class_name);
+    CFISH_DECREF(formatter);
+
+    RETVAL = result;
+OUTPUT: RETVAL
 END_XS_CODE
 
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/610-queryparser_logic.t
----------------------------------------------------------------------
diff --git a/perl/t/610-queryparser_logic.t b/perl/t/610-queryparser_logic.t
deleted file mode 100644
index b2a4744..0000000
--- a/perl/t/610-queryparser_logic.t
+++ /dev/null
@@ -1,20 +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.
-
-use strict;
-use warnings;
-use Lucy::Test;
-Lucy::Test::run_tests("TestQueryParserLogic");
-

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/012-priority_queue.t
----------------------------------------------------------------------
diff --git a/perl/t/core/012-priority_queue.t b/perl/t/core/012-priority_queue.t
index ed63c97..061e732 100644
--- a/perl/t/core/012-priority_queue.t
+++ b/perl/t/core/012-priority_queue.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestPriorityQueue");
+my $success = Lucy::Test::run_tests("Lucy::Test::Util::TestPriorityQueue");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/013-bit_vector.t
----------------------------------------------------------------------
diff --git a/perl/t/core/013-bit_vector.t b/perl/t/core/013-bit_vector.t
index 5cb9a49..903574a 100644
--- a/perl/t/core/013-bit_vector.t
+++ b/perl/t/core/013-bit_vector.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestBitVector");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestBitVector");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/016-varray.t
----------------------------------------------------------------------
diff --git a/perl/t/core/016-varray.t b/perl/t/core/016-varray.t
index 21bb8f8..6e214c2 100644
--- a/perl/t/core/016-varray.t
+++ b/perl/t/core/016-varray.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestVArray");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestVArray");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/017-hash.t
----------------------------------------------------------------------
diff --git a/perl/t/core/017-hash.t b/perl/t/core/017-hash.t
index 00b04a1..36c61ec 100644
--- a/perl/t/core/017-hash.t
+++ b/perl/t/core/017-hash.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestHash");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestHash");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/019-obj.t
----------------------------------------------------------------------
diff --git a/perl/t/core/019-obj.t b/perl/t/core/019-obj.t
index 9e2b15e..470c8c7 100644
--- a/perl/t/core/019-obj.t
+++ b/perl/t/core/019-obj.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestObj");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestObj");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/020-err.t
----------------------------------------------------------------------
diff --git a/perl/t/core/020-err.t b/perl/t/core/020-err.t
index aa95bbf..2a9ccf1 100644
--- a/perl/t/core/020-err.t
+++ b/perl/t/core/020-err.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestErr");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestErr");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/022-bytebuf.t
----------------------------------------------------------------------
diff --git a/perl/t/core/022-bytebuf.t b/perl/t/core/022-bytebuf.t
index 74a0576..a6de264 100644
--- a/perl/t/core/022-bytebuf.t
+++ b/perl/t/core/022-bytebuf.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestByteBuf");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestByteBuf");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/024-memory_pool.t
----------------------------------------------------------------------
diff --git a/perl/t/core/024-memory_pool.t b/perl/t/core/024-memory_pool.t
index 3f72a01..4aea991 100644
--- a/perl/t/core/024-memory_pool.t
+++ b/perl/t/core/024-memory_pool.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestMemoryPool");
+my $success = Lucy::Test::run_tests("Lucy::Test::Util::TestMemoryPool");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/029-charbuf.t
----------------------------------------------------------------------
diff --git a/perl/t/core/029-charbuf.t b/perl/t/core/029-charbuf.t
index fb508da..33c28a5 100644
--- a/perl/t/core/029-charbuf.t
+++ b/perl/t/core/029-charbuf.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestCharBuf");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestCharBuf");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/030-number_utils.t
----------------------------------------------------------------------
diff --git a/perl/t/core/030-number_utils.t b/perl/t/core/030-number_utils.t
index 259129c..672f3cd 100644
--- a/perl/t/core/030-number_utils.t
+++ b/perl/t/core/030-number_utils.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestNumberUtils");
+my $success = Lucy::Test::run_tests("Lucy::Test::Util::TestNumberUtils");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/031-num.t
----------------------------------------------------------------------
diff --git a/perl/t/core/031-num.t b/perl/t/core/031-num.t
index b49a17c..e1d00fa 100644
--- a/perl/t/core/031-num.t
+++ b/perl/t/core/031-num.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestNum");
+my $success = Lucy::Test::run_tests("Lucy::Test::Object::TestNum");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/032-string_helper.t
----------------------------------------------------------------------
diff --git a/perl/t/core/032-string_helper.t b/perl/t/core/032-string_helper.t
index b340ded..d5e80d1 100644
--- a/perl/t/core/032-string_helper.t
+++ b/perl/t/core/032-string_helper.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestStringHelper");
+my $success = Lucy::Test::run_tests("Lucy::Test::Util::TestStringHelper");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/033-index_file_names.t
----------------------------------------------------------------------
diff --git a/perl/t/core/033-index_file_names.t b/perl/t/core/033-index_file_names.t
index cabd45e..dddf852 100644
--- a/perl/t/core/033-index_file_names.t
+++ b/perl/t/core/033-index_file_names.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestIndexFileNames");
+my $success = Lucy::Test::run_tests("Lucy::Test::Util::TestIndexFileNames");
+
+exit($success ? 0 : 1);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/c6b07c3a/perl/t/core/035-json.t
----------------------------------------------------------------------
diff --git a/perl/t/core/035-json.t b/perl/t/core/035-json.t
index 39078dc..ce59050 100644
--- a/perl/t/core/035-json.t
+++ b/perl/t/core/035-json.t
@@ -17,5 +17,7 @@ use strict;
 use warnings;
 
 use Lucy::Test;
-Lucy::Test::run_tests("TestJson");
+my $success = Lucy::Test::run_tests("Lucy::Test::Util::TestJson");
+
+exit($success ? 0 : 1);