Kouhei Sutou
null+****@clear*****
Wed Jan 22 00:21:13 JST 2014
Kouhei Sutou 2014-01-22 00:21:13 +0900 (Wed, 22 Jan 2014) New Revision: 87539886e8a1cacdcdbb9714d26ff396266cf76d https://github.com/groonga/groonga-gobject/commit/87539886e8a1cacdcdbb9714d26ff396266cf76d Message: Enable Cutter Added files: test/run-test.sh test/suite-groonga-gobject-test.c Copied files: test/Makefile.am (from Makefile.am) Modified files: Makefile.am configure.ac Modified: Makefile.am (+4 -0) =================================================================== --- Makefile.am 2014-01-21 23:39:50 +0900 (63a0f1b) +++ Makefile.am 2014-01-22 00:21:13 +0900 (ae93cd8) @@ -20,8 +20,12 @@ DISTCHECK_CONFIGURE_FLAGS = \ SUBDIRS = \ groonga-gobject \ + test \ doc \ packages pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = groonga-gobject.pc + +echo-cutter: + @echo $(CUTTER) Modified: configure.ac (+15 -0) =================================================================== --- configure.ac 2014-01-21 23:39:50 +0900 (7939749) +++ configure.ac 2014-01-22 00:21:13 +0900 (f82dd40) @@ -91,10 +91,22 @@ GLIB_VERSION="${glib_config_major_version}.${glib_config_minor_version}.${glib_c GOBJECT_INTROSPECTION_REQUIRE([1.32.1]) GTK_DOC_CHECK([1.18]) +m4_ifdef([AC_CHECK_GCUTTER], + [AC_CHECK_GCUTTER(>= 1.1.6)], + [cutter_use_cutter="no"]) +AM_CONDITIONAL([WITH_CUTTER], [test "$cutter_use_cutter" = "yes"]) +if test "$cutter_use_cutter" = "yes"; then + AC_DEFINE(WITH_CUTTER, 1, [Define to 1 if you use Cutter]) +fi + +m4_ifdef([AC_CHECK_COVERAGE], [AC_CHECK_COVERAGE]) +GENHTML_OPTIONS="--title 'Groonga GObject Code Coverage'" + AC_CONFIG_FILES([ groonga-gobject.pc Makefile groonga-gobject/Makefile + test/Makefile doc/Makefile doc/reference/Makefile doc/reference/version.xml @@ -115,3 +127,6 @@ echo echo " GLib : $GLIB_VERSION" echo echo " GTK-Doc : $enable_gtk_doc" +echo +echo " Cutter : $CUTTER" +echo " LCOV : $LCOV" Copied: test/Makefile.am (+24 -10) 54% =================================================================== --- Makefile.am 2014-01-21 23:39:50 +0900 (63a0f1b) +++ test/Makefile.am 2014-01-22 00:21:13 +0900 (86d8a02) @@ -1,4 +1,4 @@ -# Copyright (C) 2013 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2014 Kouhei Sutou <kou �� clear-code.com> # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -13,15 +13,29 @@ # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} +AM_CPPFLAGS = \ + -I$(top_builddir) \ + -I$(top_srcdir) -DISTCHECK_CONFIGURE_FLAGS = \ - --enable-introspection +AM_CFLAGS = \ + $(GCUTTER_CFLAGS) -SUBDIRS = \ - groonga-gobject \ - doc \ - packages +AM_LDFLAGS = \ + -module \ + -rpath "`pwd`/.libs" \ + -avoid-version \ + -no-undefined -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = groonga-gobject.pc +LIBS = \ + $(top_builddir)/groonga-gobject/libgroonga-gobject.la \ + $(GCUTTER_LIBS) + +if WITH_CUTTER +noinst_LTLIBRARIES = \ + suite-groonga-gobject-test.la +endif + +suite_groonga_gobject_test_la_SOURCES = suite-groonga-gobject-test.c + +echo-abs-top-builddir: + @echo $(abs_top_builddir) Added: test/run-test.sh (+68 -0) 100755 =================================================================== --- /dev/null +++ test/run-test.sh 2014-01-22 00:21:13 +0900 (118510b) @@ -0,0 +1,68 @@ +#!/bin/bash +# +# Copyright (C) 2014 Kouhei Sutou <kou �� clear-code.com> +# +# This library is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +unset MAKELEVEL +unset MAKEFLAGS + +BASE_DIR="$(dirname $0)" + +if gmake --version > /dev/null 2>&1; then + MAKE=${MAKE:-"gmake"} +else + MAKE=${MAKE:-"make"} +fi + +if test -z "$abs_top_builddir"; then + abs_top_builddir="$(${MAKE} -C "${BASE_DIR}" -s echo-abs-top-builddir)" +fi + +if test "$NO_MAKE" != "yes"; then + MAKE_ARGS= + case "$(uname)" in + Linux) + MAKE_ARGS="-j$(grep '^processor' /proc/cpuinfo | wc -l)" + ;; + Darwin) + MAKE_ARGS="-j$(/usr/sbin/sysctl -n hw.ncpu)" + ;; + *) + : + ;; + esac + $MAKE $MAKE_ARGS -C "$abs_top_builddir" > /dev/null || exit 1 +fi + +if test -z "$CUTTER"; then + CUTTER="$(${MAKE} -s -C "$abs_top_builddir" echo-cutter)" +fi + +CUTTER_ARGS= +CUTTER_WRAPPER= +if test "$CUTTER_DEBUG" = "yes"; then + CUTTER_WRAPPER="$abs_top_builddir/libtool --mode=execute gdb --args" + CUTTER_ARGS="--keep-opening-modules" +elif test "$CUTTER_CHECK_LEAK" = "yes"; then + CUTTER_WRAPPER="$abs_top_builddir/libtool --mode=execute valgrind " + CUTTER_WRAPPER="$CUTTER_WRAPPER --leak-check=full --show-reachable=yes -v" + CUTTER_ARGS="--keep-opening-modules" +fi + +export CUTTER + +CUTTER_ARGS="$CUTTER_ARGS -s $BASE_DIR --exclude-directory fixtures" + +$CUTTER_WRAPPER $CUTTER $CUTTER_ARGS "$@" $BASE_DIR Added: test/suite-groonga-gobject-test.c (+38 -0) 100644 =================================================================== --- /dev/null +++ test/suite-groonga-gobject-test.c 2014-01-22 00:21:13 +0900 (18ded62) @@ -0,0 +1,38 @@ +/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Copyright (C) 2014 Kouhei Sutou <kou �� clear-code.com> + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <groonga-gobject/ggrn.h> + +void groonga_gobject_test_warmup(void); +void groonga_gobject_test_cooldown(void); + +void +groonga_gobject_test_warmup(void) +{ + ggrn_init(NULL); +} + +void +groonga_gobject_test_cooldown(void) +{ + ggrn_fin(NULL); +} -------------- next part -------------- HTML����������������������������...ダウンロード