You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ka...@apache.org on 2011/11/15 04:04:12 UTC
[lucy-commits] svn commit: r1202019 - in /incubator/lucy/trunk/c: Makefile.am README
build/liblucy.pl configure.ac t/ t/000-sanity-check.t.c t/Makefile.am
t/test.sh
Author: karpet
Date: Tue Nov 15 03:04:11 2011
New Revision: 1202019
URL: http://svn.apache.org/viewvc?rev=1202019&view=rev
Log:
first pass at C-based tests
Added:
incubator/lucy/trunk/c/t/
incubator/lucy/trunk/c/t/000-sanity-check.t.c
incubator/lucy/trunk/c/t/Makefile.am
incubator/lucy/trunk/c/t/test.sh (with props)
Modified:
incubator/lucy/trunk/c/Makefile.am
incubator/lucy/trunk/c/README
incubator/lucy/trunk/c/build/liblucy.pl
incubator/lucy/trunk/c/configure.ac
Modified: incubator/lucy/trunk/c/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/c/Makefile.am?rev=1202019&r1=1202018&r2=1202019&view=diff
==============================================================================
--- incubator/lucy/trunk/c/Makefile.am (original)
+++ incubator/lucy/trunk/c/Makefile.am Tue Nov 15 03:04:11 2011
@@ -15,7 +15,7 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src
+SUBDIRS = src t
test: check
Modified: incubator/lucy/trunk/c/README
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/c/README?rev=1202019&r1=1202018&r2=1202019&view=diff
==============================================================================
--- incubator/lucy/trunk/c/README (original)
+++ incubator/lucy/trunk/c/README Tue Nov 15 03:04:11 2011
@@ -22,3 +22,14 @@ The CFBind files are there to hold conve
Since it is impractical to impose a generic interface, they
are not defined in core.
+================================================================================
+ HACKING
+================================================================================
+
+The C host language uses the autotools toolchain. Get started with:
+
+ % ./bootstrap.sh
+ % ./configure && make test
+
+
+
Modified: incubator/lucy/trunk/c/build/liblucy.pl
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/c/build/liblucy.pl?rev=1202019&r1=1202018&r2=1202019&view=diff
==============================================================================
--- incubator/lucy/trunk/c/build/liblucy.pl (original)
+++ incubator/lucy/trunk/c/build/liblucy.pl Tue Nov 15 03:04:11 2011
@@ -30,6 +30,8 @@ my $base_dir = rel2abs( $is_distro_not_d
my $DEBUG = $ENV{LIBLUCY_DEBUG} || 0;
+$DEBUG and print "base_dir=$base_dir\n";
+
my $usage = "$0 make-cmd cc-cmd cc-flags\n";
die $usage if $ARGV[0] and $ARGV[0] =~ m/^\-\-?h/;
@@ -69,7 +71,10 @@ sub run_make {
my @command = @{ $params{args} };
my $dir = $params{dir};
my $current_directory = getcwd();
- chdir $dir if $dir;
+ $DEBUG and print "cur=$current_directory dir=$dir\n";
+ if ($dir) {
+ chdir $dir or die "failed to chdir $dir";
+ }
unshift @command, 'CC=' . $CC;
if ( $CC =~ /^cl\b/ ) {
unshift @command, "-f", "Makefile.MSVC";
Modified: incubator/lucy/trunk/c/configure.ac
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/c/configure.ac?rev=1202019&r1=1202018&r2=1202019&view=diff
==============================================================================
--- incubator/lucy/trunk/c/configure.ac (original)
+++ incubator/lucy/trunk/c/configure.ac Tue Nov 15 03:04:11 2011
@@ -24,6 +24,7 @@ AC_SUBST(ac_aux_dir)
AC_CONFIG_FILES([
Makefile
src/Makefile
+ t/Makefile
liblucy.pc
liblucy-config
])
Added: incubator/lucy/trunk/c/t/000-sanity-check.t.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/c/t/000-sanity-check.t.c?rev=1202019&view=auto
==============================================================================
--- incubator/lucy/trunk/c/t/000-sanity-check.t.c (added)
+++ incubator/lucy/trunk/c/t/000-sanity-check.t.c Tue Nov 15 03:04:11 2011
@@ -0,0 +1,23 @@
+#define CHAZ_USE_SHORT_NAMES
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "Charmonizer/Test.h";
+#include "Charmonizer/Test.c";
+
+static void
+S_run_tests(TestBatch *batch) {
+ TEST_INT_EQ(batch, 0, 0, "sanity check");
+}
+
+int main(int argc, char **argv) {
+ TestBatch *batch;
+
+ Test_init();
+ batch = Test_new_batch("sanity", 1, S_run_tests);
+ batch->run_test(batch);
+ batch->destroy(batch);
+ return 0;
+}
Added: incubator/lucy/trunk/c/t/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/c/t/Makefile.am?rev=1202019&view=auto
==============================================================================
--- incubator/lucy/trunk/c/t/Makefile.am (added)
+++ incubator/lucy/trunk/c/t/Makefile.am Tue Nov 15 03:04:11 2011
@@ -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.
+
+AM_CFLAGS= -Wall
+# -pg is for profiling
+#AM_CFLAGS= -Wall -pg
+LIBLUCY_VERSION = @LIBLUCY_VERSION@
+
+myldflags= -I$(top_srcdir)/src -I. -I$(top_srcdir)/../charmonizer/src -L$(top_srcdir)/src -llucy
+AM_LDFLAGS= $(myldflags)
+bin_PROGRAMS = 000-sanity-check.t
+000_sanity_check_t_SOURCES = 000-sanity-check.t.c
+000_sanity_check_t_LDFLAGS = $(myldflags)
+000_sanity_check_t_CFLAGS = $(myldflags)
+
+
+TESTS = $(check_PROGRAMS) test.sh
+
+test:
+ prove *t
Added: incubator/lucy/trunk/c/t/test.sh
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/c/t/test.sh?rev=1202019&view=auto
==============================================================================
--- incubator/lucy/trunk/c/t/test.sh (added)
+++ incubator/lucy/trunk/c/t/test.sh Tue Nov 15 03:04:11 2011
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+prove *t
Propchange: incubator/lucy/trunk/c/t/test.sh
------------------------------------------------------------------------------
svn:executable = *