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/03/11 22:52:48 UTC
[lucy-commits] [16/18] git commit: refs/heads/master - Core tests for C bindings
Core tests for C bindings
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/985b469d
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/985b469d
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/985b469d
Branch: refs/heads/master
Commit: 985b469db8f055be898e37ef61d7ca64d024a91a
Parents: 05d6117
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Feb 24 19:54:52 2013 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sat Mar 9 17:51:55 2013 +0100
----------------------------------------------------------------------
c/.gitignore | 1 +
c/t/test_lucy.c | 32 ++++++++++++++++++++++++++++++++
common/charmonizer.main | 15 +++++++++++++++
3 files changed, 48 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/985b469d/c/.gitignore
----------------------------------------------------------------------
diff --git a/c/.gitignore b/c/.gitignore
index 1076813..f030662 100644
--- a/c/.gitignore
+++ b/c/.gitignore
@@ -3,3 +3,4 @@
/charmonizer
/charmony.h
/liblucy.dylib
+/t/test_lucy
http://git-wip-us.apache.org/repos/asf/lucy/blob/985b469d/c/t/test_lucy.c
----------------------------------------------------------------------
diff --git a/c/t/test_lucy.c b/c/t/test_lucy.c
new file mode 100644
index 0000000..080bd45
--- /dev/null
+++ b/c/t/test_lucy.c
@@ -0,0 +1,32 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdlib.h>
+
+#include "Clownfish/Test/TestFormatter.h"
+#include "Lucy/Test.h"
+
+int
+main() {
+ lucy_bootstrap_parcel();
+
+ lucy_TestFormatterCF *formatter = lucy_TestFormatterCF_new();
+ bool success = lucy_Test_run_all_batches((lucy_TestFormatter*)formatter);
+ CFISH_DECREF(formatter);
+
+ return success ? EXIT_SUCCESS : EXIT_FAILURE;
+}
+
http://git-wip-us.apache.org/repos/asf/lucy/blob/985b469d/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/common/charmonizer.main b/common/charmonizer.main
index 8701d99..3567ce6 100644
--- a/common/charmonizer.main
+++ b/common/charmonizer.main
@@ -237,12 +237,17 @@ S_write_makefile() {
chaz_MakeVar_append(var, "$(AUTOGEN_DIR)" DIR_SEP "source" DIR_SEP
"parcel$(OBJ_EXT)");
+ chaz_MakeFile_add_var(makefile, "TEST_LUCY_OBJS",
+ "t" DIR_SEP "test_lucy$(OBJ_EXT)");
+
/* Executables */
chaz_MakeFile_add_var(makefile, "LEMON_EXE",
"$(LEMON_DIR)" DIR_SEP "lemon$(EXE_EXT)");
chaz_MakeFile_add_var(makefile, "CFC_EXE",
"$(CFC_DIR)" DIR_SEP "cfc$(EXE_EXT)");
+ chaz_MakeFile_add_var(makefile, "TEST_LUCY_EXE",
+ "t" DIR_SEP "test_lucy$(EXE_EXT)");
/* Shared library */
@@ -276,6 +281,16 @@ S_write_makefile() {
chaz_MakeFile_add_shared_obj(makefile, "$(LUCY_SHOBJ)", "$(LUCY_OBJS)",
"");
+ chaz_MakeFile_add_rule(makefile, "$(TEST_LUCY_OBJS)", "$(AUTOGEN_DIR)");
+
+ rule = chaz_MakeFile_add_exe(makefile, "$(TEST_LUCY_EXE)",
+ "$(TEST_LUCY_OBJS)", "-L. -llucy");
+ chaz_MakeRule_add_prereq(rule, "$(LUCY_SHOBJ)");
+
+ rule = chaz_MakeFile_add_rule(makefile, "test", "$(TEST_LUCY_EXE)");
+ chaz_MakeRule_add_command(rule, "$(TEST_LUCY_EXE)");
+
+ chaz_MakeFile_add_to_cleanup(makefile, "$(TEST_LUCY_OBJS)");
chaz_MakeFile_add_to_cleanup(makefile, "$(LUCY_OBJS)");
chaz_MakeFile_add_to_cleanup(makefile, json_parser_h);
chaz_MakeFile_add_to_cleanup(makefile, json_parser_c);