gtkieembed r192 - in trunk: . src test



Author: hiikezoe
Date: Mon Jan 26 04:19:47 2009
New Revision: 192
URL: http://svn.gnome.org/viewvc/gtkieembed?rev=192&view=rev

Log:
2009-01-26  Hiroyuki Ikezoe  <poincare ikezoe net>

	* test/: Added simple test using Cutter <http://cutter.sf.net>.




Added:
   trunk/test/   (props changed)
   trunk/test/Makefile.am
   trunk/test/run-test.sh   (contents, props changed)
   trunk/test/test-gtk-ie-embed.c
Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/configure.ac
   trunk/src/gtk-ie-embed.h

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Mon Jan 26 04:19:47 2009
@@ -1,6 +1,6 @@
 # -*- Mode: Makefile; tab-width: 8; indent-tabs-mode: t; -*-
 
-SUBDIRS = src sample
+SUBDIRS = src sample test
 
 EXTRA_DIST = autogen.sh	\
 	gtkieembed.sln

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Mon Jan 26 04:19:47 2009
@@ -4,6 +4,7 @@
 AC_INIT(gtkieembed, 0.9.0)
 AM_INIT_AUTOMAKE(1.6)
 AM_CONFIG_HEADER(config.h)
+AC_CONFIG_MACRO_DIR([m4])
 
 AC_CANONICAL_HOST
 
@@ -188,6 +189,22 @@
 esac
 AM_CONDITIONAL([HAVE_WINDRES], [test x"$WINDRES" != x])
 
+dnl **************************************************************
+dnl Check for Cutter
+dnl **************************************************************
+m4_ifdef([AC_CHECK_GCUTTER], [
+AC_CHECK_GCUTTER(>= 1.0.6)
+],
+[ac_cv_use_cutter="no"])
+
+AM_CONDITIONAL([WITH_CUTTER], [test "$ac_cv_use_cutter" != "no"])
+if test "$ac_cv_use_cutter" != "no"; 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 'GtkIEEmbed Code Coverage'"
+
 AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([AM_CFLAGS])
 AC_SUBST([AM_CXXFLAGS])
@@ -199,6 +216,7 @@
 src/Makefile
 src/res/Makefile
 sample/Makefile
+test/Makefile
 ])
 
 AC_OUTPUT

Modified: trunk/src/gtk-ie-embed.h
==============================================================================
--- trunk/src/gtk-ie-embed.h	(original)
+++ trunk/src/gtk-ie-embed.h	Mon Jan 26 04:19:47 2009
@@ -150,7 +150,7 @@
                                           gboolean wrap);
 void        gtk_ie_embed_set_use_context_menu
                                          (GtkIEEmbed *ie,
-                                         gboolean use);
+                                          gboolean use);
 gboolean    gtk_ie_embed_get_use_context_menu
                                          (GtkIEEmbed *ie);
 

Added: trunk/test/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/test/Makefile.am	Mon Jan 26 04:19:47 2009
@@ -0,0 +1,34 @@
+if WITH_CUTTER
+TESTS = run-test.sh
+TESTS_ENVIRONMENT = NO_MAKE=yes CUTTER="$(CUTTER)"
+
+noinst_LTLIBRARIES =			\
+	test-gtk-ie-embed.la
+endif
+
+EXTRA_DIST =		\
+	run-test.sh
+
+INCLUDES =			\
+	-I$(srcdir)		\
+	-I$(top_srcdir)		\
+	-I$(top_srcdir)/src
+
+AM_CFLAGS = 			\
+	$(GCUTTER_CFLAGS)	\
+	$(GTK_CFLAGS)
+
+AM_LDFLAGS =			\
+	-module			\
+	-rpath "`pwd`/.libs"	\
+	-avoid-version		\
+	-no-undefined
+
+LIBS =								\
+	$(top_builddir)/src/libgtkieembed.la			\
+	$(GCUTTER_LIBS)
+
+test_gtk_ie_embed_la_SOURCES = test-gtk-ie-embed.c
+
+echo-cutter:
+	@echo $(CUTTER)

Added: trunk/test/run-test.sh
==============================================================================
--- (empty file)
+++ trunk/test/run-test.sh	Mon Jan 26 04:19:47 2009
@@ -0,0 +1,61 @@
+#!/bin/sh
+#
+# Copyright (C) 2008  Kouhei Sutou <kou cozmixng org>
+#
+# 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 library 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 Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with this library.  If not, see <http://www.gnu.org/licenses/>.
+
+unset LANG
+
+export BASE_DIR="`dirname $0`"
+top_dir="$BASE_DIR/.."
+top_dir="`cd $top_dir; pwd`"
+
+if test x"$NO_MAKE" != x"yes"; then
+    if which gmake > /dev/null; then
+	MAKE=${MAKE:-"gmake"}
+    else
+	MAKE=${MAKE:-"make"}
+    fi
+    $MAKE -C $top_dir/ > /dev/null || exit 1
+fi
+
+if test -z "$CUTTER"; then
+    CUTTER="`make -s -C $BASE_DIR echo-cutter`"
+fi
+
+CUTTER_ARGS=
+CUTTER_WRAPPER=
+if test x"$CUTTER_DEBUG" = x"yes"; then
+    CUTTER_WRAPPER="$top_dir/libtool --mode=execute gdb --args"
+    CUTTER_ARGS="--keep-opening-modules"
+elif test x"$CUTTER_CHECK_LEAK" = x"yes"; then
+    CUTTER_WRAPPER="$top_dir/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"
+if echo "$@" | grep -- --mode=analyze > /dev/null; then
+    :
+fi
+if test x"$USE_GTK" = x"yes"; then
+    CUTTER_ARGS="-u gtk $CUTTER_ARGS"
+fi
+
+ruby_dir=$top_dir/ext/ruby
+export RUBYLIB=$RUBYLIB:$ruby_dir/lib
+
+$CUTTER_WRAPPER $CUTTER $CUTTER_ARGS "$@" $BASE_DIR

Added: trunk/test/test-gtk-ie-embed.c
==============================================================================
--- (empty file)
+++ trunk/test/test-gtk-ie-embed.c	Mon Jan 26 04:19:47 2009
@@ -0,0 +1,31 @@
+#include <gcutter.h>
+
+#include "gtk-ie-embed.h"
+
+void test_new (void);
+
+static GtkWidget *ie;
+
+void
+setup (void)
+{
+    ie =  NULL;
+}
+
+void
+teardown (void)
+{
+    if (ie)
+        gtk_widget_destroy(ie);
+}
+
+void
+test_new (void)
+{
+    ie = gtk_ie_embed_new();
+    cut_assert(ie);
+}
+
+/*
+vi:ts=4:nowrap:ai:expandtab:sw=4
+*/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]