Run core tests under Go.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/fe2d3b63 Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/fe2d3b63 Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/fe2d3b63 Branch: refs/heads/master Commit: fe2d3b63c92dc70cb97ed650b613df089005a46c Parents: 276f924 Author: Marvin Humphrey <[email protected]> Authored: Wed Sep 30 18:52:39 2015 -0700 Committer: Marvin Humphrey <[email protected]> Committed: Wed Sep 30 18:52:39 2015 -0700 ---------------------------------------------------------------------- runtime/go/clownfish/clownfish.go | 4 ++++ runtime/go/clownfish/test.go | 28 ++++++++++++++++++++++++++++ runtime/go/clownfish/test_test.go | 28 ++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe2d3b63/runtime/go/clownfish/clownfish.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/clownfish.go b/runtime/go/clownfish/clownfish.go index 2cb012f..6b4dc28 100644 --- a/runtime/go/clownfish/clownfish.go +++ b/runtime/go/clownfish/clownfish.go @@ -22,6 +22,9 @@ package clownfish #include "charmony.h" +#include "cfish_parcel.h" +#include "testcfish_parcel.h" + #include "Clownfish/Obj.h" #include "Clownfish/Err.h" #include "Clownfish/Class.h" @@ -85,6 +88,7 @@ var wrapReg *map[unsafe.Pointer]WrapFunc func init() { C.GoCfish_glue_exported_symbols() C.cfish_bootstrap_parcel() + C.testcfish_bootstrap_parcel() initWRAP() } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe2d3b63/runtime/go/clownfish/test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/test.go b/runtime/go/clownfish/test.go new file mode 100644 index 0000000..6e0b6fc --- /dev/null +++ b/runtime/go/clownfish/test.go @@ -0,0 +1,28 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package clownfish + +/* +#include "Clownfish/Test.h" +*/ +import "C" +import "unsafe" + +func createTestSuite() TestSuite { + ts := C.testcfish_Test_create_test_suite() + return WRAPAny(unsafe.Pointer(ts)).(TestSuite) +} http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fe2d3b63/runtime/go/clownfish/test_test.go ---------------------------------------------------------------------- diff --git a/runtime/go/clownfish/test_test.go b/runtime/go/clownfish/test_test.go new file mode 100644 index 0000000..4c46885 --- /dev/null +++ b/runtime/go/clownfish/test_test.go @@ -0,0 +1,28 @@ +/* Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package clownfish + +import "testing" + +func TestRunCoreTests(t *testing.T) { + suite := createTestSuite() + formatter := NewTestFormatterCF() + success := suite.RunAllBatches(formatter) + if !success { + t.Error("Core tests failed") + } +}
