epiphany r8384 - in trunk: . tests



Author: diegoe
Date: Mon Aug  4 13:30:55 2008
New Revision: 8384
URL: http://svn.gnome.org/viewvc/epiphany?rev=8384&view=rev

Log:
Add the base for tests/ support.

Include a test for ephysearchentry, need to make them optional too.
Part of #544642.


Added:
   trunk/tests/
   trunk/tests/Makefile.am
   trunk/tests/testephysearchentry.c
Modified:
   trunk/Makefile.am
   trunk/configure.ac

Modified: trunk/Makefile.am
==============================================================================
--- trunk/Makefile.am	(original)
+++ trunk/Makefile.am	Mon Aug  4 13:30:55 2008
@@ -1,4 +1,4 @@
-SUBDIRS = lib embed src data po help doc
+SUBDIRS = lib embed src data po help doc tests
 
 ACLOCAL_AMFLAGS = -I m4
 

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Mon Aug  4 13:30:55 2008
@@ -554,6 +554,7 @@
 src/epiphany.h
 help/Makefile
 po/Makefile.in
+tests/Makefile
 ],
 [],
 [EPIPHANY_API_VERSION=$EPIPHANY_API_VERSION])

Added: trunk/tests/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/tests/Makefile.am	Mon Aug  4 13:30:55 2008
@@ -0,0 +1,18 @@
+noinst_PROGRAMS = \
+	testephysearchentry
+
+testephysearchentry_SOURCES = \
+	testephysearchentry.c
+testephysearchentry_LDADD = \
+    $(top_builddir)/lib/widgets/libephywidgets.la \
+    $(DEPENDENCIES_LIBS) 
+
+INCLUDES = \
+	-I$(top_builddir)/lib/widgets
+
+CFLAGS = \
+	$(DEPENDENCIES_CFLAGS) \
+	$(AM_CFLAGS)
+
+LDADD = \
+    $(DEPENDENCIES_LIBS) 

Added: trunk/tests/testephysearchentry.c
==============================================================================
--- (empty file)
+++ trunk/tests/testephysearchentry.c	Mon Aug  4 13:30:55 2008
@@ -0,0 +1,53 @@
+/*
+ * testephysearchentry.c
+ * This file is part of Epiphany
+ *
+ * Copyright (C) 2008 - Diego Escalante Urrelo
+ *
+ * Epiphany is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Epiphany 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 General Public License
+ * along with Epiphany; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, 
+ * Boston, MA  02110-1301  USA
+ */
+ 
+#include "config.h"
+#include "ephy-search-entry.h"
+#include "ephy-icon-entry.h"
+#include <gtk/gtk.h>
+
+GtkWidget *entry;
+
+static void
+test_entry_clear (void)
+{
+    const char *text;
+
+    ephy_search_entry_clear (EPHY_SEARCH_ENTRY (entry));
+    text = gtk_entry_get_text (GTK_ENTRY (ephy_icon_entry_get_entry
+                                   (EPHY_ICON_ENTRY (entry))));
+    g_assert_cmpstr (text, ==, "");
+}
+
+int
+main (int argc, char *argv[])
+{
+    gtk_test_init (&argc, &argv);
+    
+    entry = ephy_search_entry_new ();
+    gtk_entry_set_text (GTK_ENTRY (ephy_icon_entry_get_entry
+                                   (EPHY_ICON_ENTRY (entry))), "Test");
+    
+    g_test_add_func ("/lib/widgets/ephy-search-entry/clear", test_entry_clear);
+    
+    return g_test_run ();
+}



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