Repository: lucy
Updated Branches:
  refs/heads/master 4f37426bf -> a347c8170


Run core tests from Go bindings.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/9eebf50f
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/9eebf50f
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/9eebf50f

Branch: refs/heads/master
Commit: 9eebf50f91f4e0420af15cbb3947208f992500c3
Parents: 874d4a3
Author: Marvin Humphrey <[email protected]>
Authored: Wed Sep 30 12:50:58 2015 -0700
Committer: Marvin Humphrey <[email protected]>
Committed: Wed Sep 30 19:13:30 2015 -0700

----------------------------------------------------------------------
 go/lucy/lucy.go      |  2 ++
 go/lucy/test.go      | 30 ++++++++++++++++++++++++++++++
 go/lucy/test_test.go | 30 ++++++++++++++++++++++++++++++
 3 files changed, 62 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/9eebf50f/go/lucy/lucy.go
----------------------------------------------------------------------
diff --git a/go/lucy/lucy.go b/go/lucy/lucy.go
index 595f777..42dc119 100644
--- a/go/lucy/lucy.go
+++ b/go/lucy/lucy.go
@@ -28,6 +28,7 @@ package lucy
 #define C_LUCY_POLYDOCREADER
 
 #include "lucy_parcel.h"
+#include "testlucy_parcel.h"
 #include "Lucy/Analysis/RegexTokenizer.h"
 #include "Lucy/Document/Doc.h"
 #include "Lucy/Index/DocReader.h"
@@ -196,6 +197,7 @@ var registry *objRegistry
 func init() {
        C.GOLUCY_glue_exported_symbols()
        C.lucy_bootstrap_parcel()
+       C.testlucy_bootstrap_parcel()
        registry = newObjRegistry(16)
        initWRAP()
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/9eebf50f/go/lucy/test.go
----------------------------------------------------------------------
diff --git a/go/lucy/test.go b/go/lucy/test.go
new file mode 100644
index 0000000..64e926b
--- /dev/null
+++ b/go/lucy/test.go
@@ -0,0 +1,30 @@
+/* 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.
+ */
+
+package lucy
+
+/*
+#include "Lucy/Test.h"
+*/
+import "C"
+import "unsafe"
+
+import 
"git-wip-us.apache.org/repos/asf/lucy-clownfish.git/runtime/go/clownfish"
+
+func createTestSuite() clownfish.TestSuite {
+       ts := C.testlucy_Test_create_test_suite()
+       return clownfish.WRAPAny(unsafe.Pointer(ts)).(clownfish.TestSuite)
+}

http://git-wip-us.apache.org/repos/asf/lucy/blob/9eebf50f/go/lucy/test_test.go
----------------------------------------------------------------------
diff --git a/go/lucy/test_test.go b/go/lucy/test_test.go
new file mode 100644
index 0000000..3c42fd3
--- /dev/null
+++ b/go/lucy/test_test.go
@@ -0,0 +1,30 @@
+/* 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.
+ */
+
+package lucy
+
+import "testing"
+
+import 
"git-wip-us.apache.org/repos/asf/lucy-clownfish.git/runtime/go/clownfish"
+
+func TestRunCoreTests(t *testing.T) {
+       suite := createTestSuite()
+       formatter := clownfish.NewTestFormatterCF()
+       success := suite.RunAllBatches(formatter)
+       if !success {
+               t.Error("Core tests failed")
+       }
+}

Reply via email to