[evolution-data-server] Collect all test code into a top-level "tests" directory



commit 450e98c83234f6d82f46c0124f874f47b785923f
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Mar 22 13:57:21 2011 -0400

    Collect all test code into a top-level "tests" directory
    
    This includes both automated unit tests and standalone demo programs.
    
    Test code is partitioned by library.  So far we have:
    
        tests/libebook
        tests/libecal
        tests/libedata-cal
        tests/libedataserver
        tests/libedataserverui
    
    This makes for a natural place to put additional E-D-S test code, but
    still have it compartmentalized in one place (excluding Camel, which is
    still tagging along with E-D-S but is not really part of E-D-S).

 .gitignore                                         |    2 +-
 Makefile.am                                        |    4 +-
 addressbook/Makefile.am                            |    2 +-
 addressbook/tests/Makefile.am                      |    3 -
 calendar/Makefile.am                               |    2 +-
 calendar/libedata-cal/Makefile.am                  |   59 ------------------
 calendar/libedata-cal/e-cal-backend-sexp.c         |   47 --------------
 calendar/tests/Makefile.am                         |    2 -
 configure.ac                                       |   12 ++--
 .../libecal/tmpl/e-cal-check-timezones.sgml        |    1 +
 .../calendar/libecal/tmpl/libecal-unused.sgml      |   18 ------
 .../reference/camel/tmpl/camel-cipher-context.sgml |    2 +
 libedataserver/Makefile.am                         |   12 ----
 libedataserverui/Makefile.am                       |   52 +---------------
 tests/Makefile.am                                  |    3 +
 .../tests/ebook => tests/libebook}/Makefile.am     |    2 +
 .../libebook}/data/vcards/name-only.vcf            |    0
 .../libebook}/data/vcards/simple-1.vcf             |    0
 .../libebook}/data/vcards/simple-2.vcf             |    0
 .../ebook => tests/libebook}/ebook-test-utils.c    |    0
 .../ebook => tests/libebook}/ebook-test-utils.h    |    0
 .../ebook => tests/libebook}/test-categories.c     |    0
 .../tests/ebook => tests/libebook}/test-changes.c  |    0
 .../tests/ebook => tests/libebook}/test-date.c     |    0
 .../libebook}/test-ebook-add-contact.c             |    0
 .../ebook => tests/libebook}/test-ebook-async.c    |    0
 .../libebook}/test-ebook-commit-contact.c          |    0
 .../libebook}/test-ebook-get-book-view.c           |    0
 .../libebook}/test-ebook-get-contact.c             |    0
 .../libebook}/test-ebook-get-required-fields.c     |    0
 .../libebook}/test-ebook-get-static-capabilities.c |    0
 .../test-ebook-get-supported-auth-methods.c        |    0
 .../libebook}/test-ebook-get-supported-fields.c    |    0
 .../libebook}/test-ebook-remove-contact-by-id.c    |    0
 .../libebook}/test-ebook-remove-contact.c          |    0
 .../libebook}/test-ebook-remove-contacts.c         |    0
 .../ebook => tests/libebook}/test-ebook-remove.c   |    0
 .../libebook}/test-ebook-stress-factory--fifo.c    |    0
 .../libebook}/test-ebook-stress-factory--serial.c  |    0
 .../test-ebook-stress-factory--single-book.c       |    0
 .../tests/ebook => tests/libebook}/test-ebook.c    |    0
 .../ebook => tests/libebook}/test-nonexistent-id.c |    0
 .../tests/ebook => tests/libebook}/test-photo.c    |    0
 .../tests/ebook => tests/libebook}/test-query.c    |    0
 .../tests/ebook => tests/libebook}/test-search.c   |    0
 .../tests/ebook => tests/libebook}/test-self.c     |    0
 .../libebook}/test-stress-bookviews.c              |    0
 .../tests/ebook => tests/libebook}/test-string.c   |    0
 .../ebook => tests/libebook}/test-undefinedfield.c |    0
 .../ebook => tests/libebook}/test-untyped-phones.c |    0
 {addressbook/tests => tests/libebook}/vcard/1.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/10.vcf |    0
 {addressbook/tests => tests/libebook}/vcard/11.vcf |    0
 {addressbook/tests => tests/libebook}/vcard/12.vcf |    0
 {addressbook/tests => tests/libebook}/vcard/13.vcf |    0
 {addressbook/tests => tests/libebook}/vcard/2.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/3.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/4.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/5.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/6.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/7.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/8.vcf  |    0
 {addressbook/tests => tests/libebook}/vcard/9.vcf  |    0
 .../tests => tests/libebook}/vcard/Makefile.am     |    0
 {addressbook/tests => tests/libebook}/vcard/README |    0
 .../tests => tests/libebook}/vcard/dump-vcard.c    |    0
 {calendar/tests/ecal => tests/libecal}/Makefile.am |    0
 {calendar/tests/ecal => tests/libecal}/cleanup.sh  |    0
 .../tests/ecal => tests/libecal}/ecal-test-utils.c |    0
 .../tests/ecal => tests/libecal}/ecal-test-utils.h |    0
 .../libecal}/test-ecal-add-timezone.c              |    0
 .../libecal}/test-ecal-create-object--2.c          |    0
 .../libecal}/test-ecal-create-object.c             |    0
 .../libecal}/test-ecal-get-alarm-email-address.c   |    0
 .../libecal}/test-ecal-get-cal-address.c           |    0
 .../libecal}/test-ecal-get-capabilities.c          |    0
 .../libecal}/test-ecal-get-default-object.c        |    0
 .../libecal}/test-ecal-get-free-busy.c             |    0
 .../libecal}/test-ecal-get-ldap-attribute.c        |    0
 .../libecal}/test-ecal-get-object-list.c           |    0
 .../libecal}/test-ecal-get-objects-for-uid.c       |    0
 .../ecal => tests/libecal}/test-ecal-get-query.c   |    0
 .../libecal}/test-ecal-get-timezone.c              |    0
 .../libecal}/test-ecal-modify-object.c             |    0
 .../tests/ecal => tests/libecal}/test-ecal-open.c  |    0
 .../libecal}/test-ecal-receive-objects.c           |    0
 .../libecal}/test-ecal-remove-object.c             |    0
 .../ecal => tests/libecal}/test-ecal-remove.c      |    0
 .../libecal}/test-ecal-send-objects.c              |    0
 .../libecal}/test-ecal-set-default-timezone.c      |    0
 .../ecal => tests/libecal}/test-ecal-set-mode.c    |    0
 .../libecal}/test-ecal-stress-factory--fifo.c      |    0
 .../test-ecal-stress-factory--open-async.c         |    0
 .../libecal}/test-ecal-stress-factory--serial.c    |    0
 .../test-ecal-stress-factory--single-cal.c         |    0
 {calendar/tests/ecal => tests/libecal}/test-ecal.c |    0
 .../tests/ecal => tests/libecal}/test-recur.c      |    0
 .../tests/ecal => tests/libecal}/test-runner.sh    |    0
 .../tests/ecal => tests/libecal}/test-search.c     |    0
 .../tests/ecal => tests/libecal}/testdata.ics      |    0
 tests/libedata-cal/Makefile.am                     |   64 ++++++++++++++++++++
 tests/libedata-cal/test-cal-backend-sexp.c         |   47 ++++++++++++++
 .../libedata-cal/test-intervaltree.c               |    2 +-
 tests/libedataserver/Makefile.am                   |   15 +++++
 .../libedataserver}/test-source-list.c             |    6 +--
 tests/libedataserverui/Makefile.am                 |   46 ++++++++++++++
 .../libedataserverui}/test-category-completion.c   |    2 +-
 .../libedataserverui}/test-contact-store.c         |    7 +--
 .../libedataserverui}/test-name-selector.c         |   11 +---
 .../libedataserverui}/test-source-combo-box.c      |    8 +--
 .../libedataserverui}/test-source-selector.c       |    8 +--
 111 files changed, 204 insertions(+), 235 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2467253..074ecea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -101,7 +101,7 @@
 /po/boldquot.sed
 /po/en boldquot header
 /po/en quot header
-/po/evolution-data-server-3.0.pot
+/po/evolution-data-server-3.2.pot
 /po/insert-header.sin
 /po/quot.sed
 /po/remove-potcdate.sin
diff --git a/Makefile.am b/Makefile.am
index 4c0278f..eaaf5ec 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,8 +6,8 @@ if ENABLE_CALENDAR
 CALENDAR_DIR = calendar
 endif
 
-SUBDIRS = libedataserver libebackend servers camel addressbook $(CALENDAR_DIR) libedataserverui docs art po
-DIST_SUBDIRS = libedataserver libebackend servers camel addressbook calendar libedataserverui docs art po
+SUBDIRS = libedataserver libebackend servers camel addressbook $(CALENDAR_DIR) libedataserverui tests docs art po
+DIST_SUBDIRS = libedataserver libebackend servers camel addressbook calendar libedataserverui tests docs art po
 
 %-$(API_VERSION).pc: %.pc
 	 cp $< $@
diff --git a/addressbook/Makefile.am b/addressbook/Makefile.am
index 95a652b..f61358d 100644
--- a/addressbook/Makefile.am
+++ b/addressbook/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = libegdbus libebook libedata-book backends tests
+SUBDIRS = libegdbus libebook libedata-book backends
 
 -include $(top_srcdir)/git.mk
diff --git a/calendar/Makefile.am b/calendar/Makefile.am
index 6070753..9c5d334 100644
--- a/calendar/Makefile.am
+++ b/calendar/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = libegdbus libecal libedata-cal backends tests
+SUBDIRS = libegdbus libecal libedata-cal backends
 
 -include $(top_srcdir)/git.mk
diff --git a/calendar/libedata-cal/Makefile.am b/calendar/libedata-cal/Makefile.am
index d9f71cf..6d92872 100644
--- a/calendar/libedata-cal/Makefile.am
+++ b/calendar/libedata-cal/Makefile.am
@@ -7,7 +7,6 @@ ENUM_GENERATED = e-data-cal-enumtypes.h e-data-cal-enumtypes.c
 
 # The libraray
 lib_LTLIBRARIES = libedata-cal-1.2.la
-noinst_PROGRAMS = test-e-sexp test-intervaltree test-intervaltree-coverage
 
 libedata_cal_1_2_la_CPPFLAGS = 			\
 	$(AM_CPPFLAGS)				\
@@ -119,61 +118,3 @@ e_calendar_factory_LDADD =						\
 	$(top_builddir)/libebackend/libebackend-1.2.la
 
 -include $(top_srcdir)/git.mk
-
-test_e_sexp_SOURCES = e-cal-backend-sexp.c e-cal-backend-sexp.h
-test_e_sexp_CPPFLAGS = \
-	$(AM_CPPFLAGS)				\
-	-I$(top_srcdir)				\
-	-I$(top_srcdir)/calendar		\
-	-I$(top_builddir)/calendar		\
-	$(EVOLUTION_CALENDAR_CFLAGS)		\
-	-DTESTER=1
-
-test_e_sexp_LDADD = \
-	libedata-cal-1.2.la					\
-	$(top_builddir)/calendar/libecal/libecal-1.2.la 	\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
-	$(EVOLUTION_CALENDAR_LIBS)				\
-	$(E_DATA_SERVER_LIBS)
-
-test_intervaltree_SOURCES = test-intervaltree.c e-cal-backend-intervaltree.c
-
-test_intervaltree_CPPFLAGS = \
-	$(AM_CPPFLAGS)				\
-	-I$(top_srcdir)				\
-	-I$(top_srcdir)/calendar		\
-	-I$(top_builddir)/calendar		\
-	$(EVOLUTION_CALENDAR_CFLAGS)
-
-test_intervaltree_LDADD = \
-	libedata-cal-1.2.la					\
-	$(top_builddir)/calendar/libecal/libecal-1.2.la		\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
-	$(EVOLUTION_CALENDAR_LIBS)
-
-test_intervaltree_coverage_SOURCES = test-intervaltree.c e-cal-backend-intervaltree.c
-
-test_intervaltree_coverage_CPPFLAGS = \
-	$(AM_CPPFLAGS)				\
-	-I$(top_srcdir)				\
-	-I$(top_srcdir)/calendar		\
-	-I$(top_builddir)/calendar		\
-	$(EVOLUTION_CALENDAR_CFLAGS)
-
-test_intervaltree_coverage_LDADD = \
-	libedata-cal-1.2.la					\
-	$(top_builddir)/calendar/libecal/libecal-1.2.la		\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
-	$(EVOLUTION_CALENDAR_LIBS)				\
-	-lgcov
-
-.PHONY: coverage
-coverage: 
-	mkdir -p ./coverage
-	lcov --directory . --zerocounters
-	./test-intervaltree-coverage
-	lcov --directory . --capture --output-file ./coverage/*.info
-	genhtml -o ./coverage --legend --num-spaces 2 ./coverage/*.info
-
-clean-local:
-	rm -f *.gcda *.gcno
diff --git a/calendar/libedata-cal/e-cal-backend-sexp.c b/calendar/libedata-cal/e-cal-backend-sexp.c
index 42805ec..e408d3d 100644
--- a/calendar/libedata-cal/e-cal-backend-sexp.c
+++ b/calendar/libedata-cal/e-cal-backend-sexp.c
@@ -1466,50 +1466,3 @@ e_cal_backend_sexp_init (ECalBackendSExp *sexp)
 	sexp->priv = priv;
 	priv->search_context = g_new (SearchContext, 1);
 }
-#ifdef TESTER
-static void
-test_query (const gchar * query)
-{
-	ECalBackendSExp *sexp = e_cal_backend_sexp_new (query);
-	time_t start, end;
-
-	gboolean generator = e_cal_backend_sexp_evaluate_occur_times (sexp, &start, &end);
-
-	if (generator) {
-		printf ("%s: %ld - %ld\n", query, start, end);
-	} else {
-		printf ("%s: no time prunning possible\n", query);
-	}
-}
-
-gint main (gint argc, gchar **argv)
-{
-	g_type_init ();
-
-	/* e_sexp_add_variable(f, 0, "test", NULL); */
-
-	if (argc < 2 || !argv[1])
-	{
-		test_query ("(occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))");
-		test_query ("(due-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))");
-		test_query ("(has-alarms-in-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))");
-		test_query ("(completed-before? (make-time \"20080727T220000Z\") )");
-
-		test_query ("(and (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\")) #t)");
-		test_query ("(or (occur-in-time-range? (make-time \"20080727T220000Z\")(make-time \"20080907T220000Z\")) #t)");
-
-		test_query ("(and (contains? \"substring\") (has-categories? \"blah\"))");
-		test_query ("(or (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\")) (contains? \"substring\"))");
-
-		test_query ("(and (and (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))"
-			    " (or (contains? \"substring\") (has-categories? \"blah\"))) (has-alarms?))");
-
-		test_query ("(or (and (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))"
-			    " (or (contains? \"substring\") (has-categories? \"blah\"))) (has-alarms?))");
-	}
-	else
-		test_query (argv[1]);
-
-	return 0;
-}
-#endif
diff --git a/configure.ac b/configure.ac
index 3cdcbc0..ff6d292 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1433,9 +1433,6 @@ addressbook/backends/ldap/Makefile
 addressbook/backends/google/Makefile
 addressbook/backends/groupwise/Makefile
 addressbook/backends/webdav/Makefile
-addressbook/tests/Makefile
-addressbook/tests/ebook/Makefile
-addressbook/tests/vcard/Makefile
 art/Makefile
 calendar/Makefile
 calendar/libecal/Makefile
@@ -1450,8 +1447,6 @@ calendar/backends/groupwise/Makefile
 calendar/backends/http/Makefile
 calendar/backends/contacts/Makefile
 calendar/backends/weather/Makefile
-calendar/tests/Makefile
-calendar/tests/ecal/Makefile
 camel/Makefile
 camel/providers/Makefile
 camel/providers/groupwise/Makefile
@@ -1481,6 +1476,13 @@ libedataserverui/libedataserverui.pc
 servers/Makefile
 servers/groupwise/Makefile
 servers/groupwise/libegroupwise.pc
+tests/Makefile
+tests/libebook/Makefile
+tests/libebook/vcard/Makefile
+tests/libecal/Makefile
+tests/libedata-cal/Makefile
+tests/libedataserver/Makefile
+tests/libedataserverui/Makefile
 docs/Makefile
 docs/reference/Makefile
 docs/reference/addressbook/Makefile
diff --git a/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml b/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml
index 98c382c..1e00f16 100644
--- a/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml
+++ b/docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml
@@ -65,6 +65,7 @@ e-cal-check-timezones
 @const gchar *tzid, gconstpointer custom, GError **error:
 @const gchar *tzid, gconstpointer custom, GError **error:
 @const gchar *tzid, gconstpointer custom, GError **error:
+ const gchar *tzid, gconstpointer custom, GError **error:
 @const gchar *tzid, gconstpointer custom, GError **error: 
 @custom: 
 @error: 
diff --git a/docs/reference/calendar/libecal/tmpl/libecal-unused.sgml b/docs/reference/calendar/libecal/tmpl/libecal-unused.sgml
index df0f1a7..8f4e254 100644
--- a/docs/reference/calendar/libecal/tmpl/libecal-unused.sgml
+++ b/docs/reference/calendar/libecal/tmpl/libecal-unused.sgml
@@ -506,24 +506,6 @@ ECalViewListener
 @void: 
 @Returns: 
 
-<!-- ##### FUNCTION e_cal_get_sources ##### -->
-<para>
-
-</para>
-
- sources: 
- type: 
- error: 
- Returns: 
-
-<!-- ##### FUNCTION e_cal_get_uri ##### -->
-<para>
-
-</para>
-
- ecal: 
- Returns: 
-
 <!-- ##### FUNCTION e_cal_listener_construct ##### -->
 <para>
 
diff --git a/docs/reference/camel/tmpl/camel-cipher-context.sgml b/docs/reference/camel/tmpl/camel-cipher-context.sgml
index 1a1848a..8d450dc 100644
--- a/docs/reference/camel/tmpl/camel-cipher-context.sgml
+++ b/docs/reference/camel/tmpl/camel-cipher-context.sgml
@@ -730,6 +730,8 @@ CamelCipherContext
 @gpointer cert_data: 
 @gpointer cert_data:
 @gpointer cert_data: 
+ gpointer cert_data:
+ gpointer cert_data: 
 @gpointer cert_data: 
 
 
diff --git a/libedataserver/Makefile.am b/libedataserver/Makefile.am
index ccff30c..3041867 100644
--- a/libedataserver/Makefile.am
+++ b/libedataserver/Makefile.am
@@ -1,5 +1,4 @@
 lib_LTLIBRARIES = libedataserver-1.2.la
-noinst_PROGRAMS = test-source-list
 
 libedataserver_1_2_la_CPPFLAGS = \
 	$(AM_CPPFLAGS)							\
@@ -72,17 +71,6 @@ libedataserverinclude_HEADERS =		\
 	e-xml-hash-utils.h		\
 	eds-version.h
 
-test_source_list_CPPFLAGS = \
-	$(AM_CPPFLAGS)				\
-	-I$(top_srcdir)				\
-	-DG_LOG_DOMAIN=\"e-data-server\"	\
-	$(E_DATA_SERVER_CFLAGS)			\
-	$(SOUP_CFLAGS)
-
-test_source_list_SOURCES = test-source-list.c
-
-test_source_list_LDADD = libedataserver-1.2.la $(E_DATA_SERVER_LIBS)
-
 %-$(API_VERSION).pc: %.pc
 	 cp $< $@
 
diff --git a/libedataserverui/Makefile.am b/libedataserverui/Makefile.am
index 9c31763..e20028d 100644
--- a/libedataserverui/Makefile.am
+++ b/libedataserverui/Makefile.am
@@ -2,13 +2,6 @@
 MARSHAL_GENERATED = e-data-server-ui-marshal.c e-data-server-ui-marshal.h
 @EVO_MARSHAL_RULE@
 
-noinst_PROGRAMS = 			\
-	test-category-completion	\
-	test-source-combo-box		\
-	test-source-selector		\
-	test-contact-store		\
-	test-name-selector
-
 CPPFLAGS = \
 	$(AM_CPPFLAGS)				\
 	-I$(top_srcdir)				\
@@ -17,7 +10,7 @@ CPPFLAGS = \
 	-DG_LOG_DOMAIN=\"e-data-server-ui\"	\
 	-DE_DATA_SERVER_UI_UIDIR=\""$(uidir)"\"	\
 	$(E_DATA_SERVER_UI_CFLAGS)		\
-	$(GNOME_KEYRING_CFLAGS) \
+	$(GNOME_KEYRING_CFLAGS)			\
 	$(CAMEL_CFLAGS)
 
 lib_LTLIBRARIES = libedataserverui-3.0.la
@@ -74,7 +67,7 @@ libedataserverui_3_0_la_LIBADD = 				\
 	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
 	$(top_builddir)/camel/libcamel-1.2.la			\
 	$(E_DATA_SERVER_UI_LIBS)				\
-	$(GNOME_KEYRING_LIBS) \
+	$(GNOME_KEYRING_LIBS)					\
 	$(CAMEL_LIBS)
 
 libedataserverui_3_0_la_LDFLAGS = \
@@ -82,45 +75,6 @@ libedataserverui_3_0_la_LDFLAGS = \
 
 libedataserveruiincludedir = $(privincludedir)/libedataserverui
 
-TEST_EDATASERVERUI_CPPFLAGS= \
-	$(AM_CPPFLAGS)				\
-	-I$(top_srcdir)				\
-	-I$(top_srcdir)/addressbook		\
-	-I$(top_builddir)/addressbook		\
-	-DG_LOG_DOMAIN=\"e-data-server-ui\"	\
-	$(CAMEL_CFLAGS)				\
-	$(GNOME_KEYRING_CFLAGS) \
-	$(E_DATA_SERVER_UI_CFLAGS)
-
-TEST_EDATASERVERUI_LDFLAGS = \
-	libedataserverui-3.0.la 				\
-	$(top_builddir)/camel/libcamel-1.2.la			\
-	$(top_builddir)/addressbook/libebook/libebook-1.2.la	\
-	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
-	$(GNOME_KEYRING_LIBS) \
-	$(E_DATA_SERVER_UI_LIBS)
-
-# Test programs
-test_category_completion_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
-test_category_completion_SOURCES = test-category-completion.c
-test_category_completion_LDADD = $(TEST_EDATASERVERUI_LDFLAGS)
-
-test_source_selector_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
-test_source_selector_SOURCES = test-source-selector.c
-test_source_selector_LDADD =  $(TEST_EDATASERVERUI_LDFLAGS)
-
-test_source_combo_box_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
-test_source_combo_box_SOURCES = test-source-combo-box.c
-test_source_combo_box_LDADD =  $(TEST_EDATASERVERUI_LDFLAGS)
-
-test_contact_store_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
-test_contact_store_SOURCES = test-contact-store.c
-test_contact_store_LDADD = $(TEST_EDATASERVERUI_LDFLAGS)
-
-test_name_selector_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
-test_name_selector_SOURCES = test-name-selector.c
-test_name_selector_LDADD = $(TEST_EDATASERVERUI_LDFLAGS)
-
 %-3.0.pc: %.pc
 	cp $< $@
 
@@ -130,7 +84,7 @@ pkgconfig_DATA = libedataserverui-3.0.pc
 BUILT_SOURCES = $(MARSHAL_GENERATED)
 
 EXTRA_DIST = 						\
-	$(e_passwords_dist) \
+	$(e_passwords_dist)				\
 	e-data-server-ui-marshal.list			\
 	$(pkgconfig_DATA:-3.0.pc=.pc.in)
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..bb1ea20
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = libedataserver libedataserverui libebook libecal libedata-cal
+
+-include $(top_srcdir)/git.mk
diff --git a/addressbook/tests/ebook/Makefile.am b/tests/libebook/Makefile.am
similarity index 99%
rename from addressbook/tests/ebook/Makefile.am
rename to tests/libebook/Makefile.am
index ba7c10d..90a1e60 100644
--- a/addressbook/tests/ebook/Makefile.am
+++ b/tests/libebook/Makefile.am
@@ -1,3 +1,5 @@
+SUBDIRS = vcard
+
 noinst_LTLIBRARIES = libebook-test-utils.la
 libebook_test_utils_la_SOURCES = ebook-test-utils.c ebook-test-utils.h
 
diff --git a/addressbook/tests/ebook/data/vcards/name-only.vcf b/tests/libebook/data/vcards/name-only.vcf
similarity index 100%
rename from addressbook/tests/ebook/data/vcards/name-only.vcf
rename to tests/libebook/data/vcards/name-only.vcf
diff --git a/addressbook/tests/ebook/data/vcards/simple-1.vcf b/tests/libebook/data/vcards/simple-1.vcf
similarity index 100%
rename from addressbook/tests/ebook/data/vcards/simple-1.vcf
rename to tests/libebook/data/vcards/simple-1.vcf
diff --git a/addressbook/tests/ebook/data/vcards/simple-2.vcf b/tests/libebook/data/vcards/simple-2.vcf
similarity index 100%
rename from addressbook/tests/ebook/data/vcards/simple-2.vcf
rename to tests/libebook/data/vcards/simple-2.vcf
diff --git a/addressbook/tests/ebook/ebook-test-utils.c b/tests/libebook/ebook-test-utils.c
similarity index 100%
rename from addressbook/tests/ebook/ebook-test-utils.c
rename to tests/libebook/ebook-test-utils.c
diff --git a/addressbook/tests/ebook/ebook-test-utils.h b/tests/libebook/ebook-test-utils.h
similarity index 100%
rename from addressbook/tests/ebook/ebook-test-utils.h
rename to tests/libebook/ebook-test-utils.h
diff --git a/addressbook/tests/ebook/test-categories.c b/tests/libebook/test-categories.c
similarity index 100%
rename from addressbook/tests/ebook/test-categories.c
rename to tests/libebook/test-categories.c
diff --git a/addressbook/tests/ebook/test-changes.c b/tests/libebook/test-changes.c
similarity index 100%
rename from addressbook/tests/ebook/test-changes.c
rename to tests/libebook/test-changes.c
diff --git a/addressbook/tests/ebook/test-date.c b/tests/libebook/test-date.c
similarity index 100%
rename from addressbook/tests/ebook/test-date.c
rename to tests/libebook/test-date.c
diff --git a/addressbook/tests/ebook/test-ebook-add-contact.c b/tests/libebook/test-ebook-add-contact.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-add-contact.c
rename to tests/libebook/test-ebook-add-contact.c
diff --git a/addressbook/tests/ebook/test-ebook-async.c b/tests/libebook/test-ebook-async.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-async.c
rename to tests/libebook/test-ebook-async.c
diff --git a/addressbook/tests/ebook/test-ebook-commit-contact.c b/tests/libebook/test-ebook-commit-contact.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-commit-contact.c
rename to tests/libebook/test-ebook-commit-contact.c
diff --git a/addressbook/tests/ebook/test-ebook-get-book-view.c b/tests/libebook/test-ebook-get-book-view.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-get-book-view.c
rename to tests/libebook/test-ebook-get-book-view.c
diff --git a/addressbook/tests/ebook/test-ebook-get-contact.c b/tests/libebook/test-ebook-get-contact.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-get-contact.c
rename to tests/libebook/test-ebook-get-contact.c
diff --git a/addressbook/tests/ebook/test-ebook-get-required-fields.c b/tests/libebook/test-ebook-get-required-fields.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-get-required-fields.c
rename to tests/libebook/test-ebook-get-required-fields.c
diff --git a/addressbook/tests/ebook/test-ebook-get-static-capabilities.c b/tests/libebook/test-ebook-get-static-capabilities.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-get-static-capabilities.c
rename to tests/libebook/test-ebook-get-static-capabilities.c
diff --git a/addressbook/tests/ebook/test-ebook-get-supported-auth-methods.c b/tests/libebook/test-ebook-get-supported-auth-methods.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-get-supported-auth-methods.c
rename to tests/libebook/test-ebook-get-supported-auth-methods.c
diff --git a/addressbook/tests/ebook/test-ebook-get-supported-fields.c b/tests/libebook/test-ebook-get-supported-fields.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-get-supported-fields.c
rename to tests/libebook/test-ebook-get-supported-fields.c
diff --git a/addressbook/tests/ebook/test-ebook-remove-contact-by-id.c b/tests/libebook/test-ebook-remove-contact-by-id.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-remove-contact-by-id.c
rename to tests/libebook/test-ebook-remove-contact-by-id.c
diff --git a/addressbook/tests/ebook/test-ebook-remove-contact.c b/tests/libebook/test-ebook-remove-contact.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-remove-contact.c
rename to tests/libebook/test-ebook-remove-contact.c
diff --git a/addressbook/tests/ebook/test-ebook-remove-contacts.c b/tests/libebook/test-ebook-remove-contacts.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-remove-contacts.c
rename to tests/libebook/test-ebook-remove-contacts.c
diff --git a/addressbook/tests/ebook/test-ebook-remove.c b/tests/libebook/test-ebook-remove.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-remove.c
rename to tests/libebook/test-ebook-remove.c
diff --git a/addressbook/tests/ebook/test-ebook-stress-factory--fifo.c b/tests/libebook/test-ebook-stress-factory--fifo.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-stress-factory--fifo.c
rename to tests/libebook/test-ebook-stress-factory--fifo.c
diff --git a/addressbook/tests/ebook/test-ebook-stress-factory--serial.c b/tests/libebook/test-ebook-stress-factory--serial.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-stress-factory--serial.c
rename to tests/libebook/test-ebook-stress-factory--serial.c
diff --git a/addressbook/tests/ebook/test-ebook-stress-factory--single-book.c b/tests/libebook/test-ebook-stress-factory--single-book.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook-stress-factory--single-book.c
rename to tests/libebook/test-ebook-stress-factory--single-book.c
diff --git a/addressbook/tests/ebook/test-ebook.c b/tests/libebook/test-ebook.c
similarity index 100%
rename from addressbook/tests/ebook/test-ebook.c
rename to tests/libebook/test-ebook.c
diff --git a/addressbook/tests/ebook/test-nonexistent-id.c b/tests/libebook/test-nonexistent-id.c
similarity index 100%
rename from addressbook/tests/ebook/test-nonexistent-id.c
rename to tests/libebook/test-nonexistent-id.c
diff --git a/addressbook/tests/ebook/test-photo.c b/tests/libebook/test-photo.c
similarity index 100%
rename from addressbook/tests/ebook/test-photo.c
rename to tests/libebook/test-photo.c
diff --git a/addressbook/tests/ebook/test-query.c b/tests/libebook/test-query.c
similarity index 100%
rename from addressbook/tests/ebook/test-query.c
rename to tests/libebook/test-query.c
diff --git a/addressbook/tests/ebook/test-search.c b/tests/libebook/test-search.c
similarity index 100%
rename from addressbook/tests/ebook/test-search.c
rename to tests/libebook/test-search.c
diff --git a/addressbook/tests/ebook/test-self.c b/tests/libebook/test-self.c
similarity index 100%
rename from addressbook/tests/ebook/test-self.c
rename to tests/libebook/test-self.c
diff --git a/addressbook/tests/ebook/test-stress-bookviews.c b/tests/libebook/test-stress-bookviews.c
similarity index 100%
rename from addressbook/tests/ebook/test-stress-bookviews.c
rename to tests/libebook/test-stress-bookviews.c
diff --git a/addressbook/tests/ebook/test-string.c b/tests/libebook/test-string.c
similarity index 100%
rename from addressbook/tests/ebook/test-string.c
rename to tests/libebook/test-string.c
diff --git a/addressbook/tests/ebook/test-undefinedfield.c b/tests/libebook/test-undefinedfield.c
similarity index 100%
rename from addressbook/tests/ebook/test-undefinedfield.c
rename to tests/libebook/test-undefinedfield.c
diff --git a/addressbook/tests/ebook/test-untyped-phones.c b/tests/libebook/test-untyped-phones.c
similarity index 100%
rename from addressbook/tests/ebook/test-untyped-phones.c
rename to tests/libebook/test-untyped-phones.c
diff --git a/addressbook/tests/vcard/1.vcf b/tests/libebook/vcard/1.vcf
similarity index 100%
rename from addressbook/tests/vcard/1.vcf
rename to tests/libebook/vcard/1.vcf
diff --git a/addressbook/tests/vcard/10.vcf b/tests/libebook/vcard/10.vcf
similarity index 100%
rename from addressbook/tests/vcard/10.vcf
rename to tests/libebook/vcard/10.vcf
diff --git a/addressbook/tests/vcard/11.vcf b/tests/libebook/vcard/11.vcf
similarity index 100%
rename from addressbook/tests/vcard/11.vcf
rename to tests/libebook/vcard/11.vcf
diff --git a/addressbook/tests/vcard/12.vcf b/tests/libebook/vcard/12.vcf
similarity index 100%
rename from addressbook/tests/vcard/12.vcf
rename to tests/libebook/vcard/12.vcf
diff --git a/addressbook/tests/vcard/13.vcf b/tests/libebook/vcard/13.vcf
similarity index 100%
rename from addressbook/tests/vcard/13.vcf
rename to tests/libebook/vcard/13.vcf
diff --git a/addressbook/tests/vcard/2.vcf b/tests/libebook/vcard/2.vcf
similarity index 100%
rename from addressbook/tests/vcard/2.vcf
rename to tests/libebook/vcard/2.vcf
diff --git a/addressbook/tests/vcard/3.vcf b/tests/libebook/vcard/3.vcf
similarity index 100%
rename from addressbook/tests/vcard/3.vcf
rename to tests/libebook/vcard/3.vcf
diff --git a/addressbook/tests/vcard/4.vcf b/tests/libebook/vcard/4.vcf
similarity index 100%
rename from addressbook/tests/vcard/4.vcf
rename to tests/libebook/vcard/4.vcf
diff --git a/addressbook/tests/vcard/5.vcf b/tests/libebook/vcard/5.vcf
similarity index 100%
rename from addressbook/tests/vcard/5.vcf
rename to tests/libebook/vcard/5.vcf
diff --git a/addressbook/tests/vcard/6.vcf b/tests/libebook/vcard/6.vcf
similarity index 100%
rename from addressbook/tests/vcard/6.vcf
rename to tests/libebook/vcard/6.vcf
diff --git a/addressbook/tests/vcard/7.vcf b/tests/libebook/vcard/7.vcf
similarity index 100%
rename from addressbook/tests/vcard/7.vcf
rename to tests/libebook/vcard/7.vcf
diff --git a/addressbook/tests/vcard/8.vcf b/tests/libebook/vcard/8.vcf
similarity index 100%
rename from addressbook/tests/vcard/8.vcf
rename to tests/libebook/vcard/8.vcf
diff --git a/addressbook/tests/vcard/9.vcf b/tests/libebook/vcard/9.vcf
similarity index 100%
rename from addressbook/tests/vcard/9.vcf
rename to tests/libebook/vcard/9.vcf
diff --git a/addressbook/tests/vcard/Makefile.am b/tests/libebook/vcard/Makefile.am
similarity index 100%
rename from addressbook/tests/vcard/Makefile.am
rename to tests/libebook/vcard/Makefile.am
diff --git a/addressbook/tests/vcard/README b/tests/libebook/vcard/README
similarity index 100%
rename from addressbook/tests/vcard/README
rename to tests/libebook/vcard/README
diff --git a/addressbook/tests/vcard/dump-vcard.c b/tests/libebook/vcard/dump-vcard.c
similarity index 100%
rename from addressbook/tests/vcard/dump-vcard.c
rename to tests/libebook/vcard/dump-vcard.c
diff --git a/calendar/tests/ecal/Makefile.am b/tests/libecal/Makefile.am
similarity index 100%
rename from calendar/tests/ecal/Makefile.am
rename to tests/libecal/Makefile.am
diff --git a/calendar/tests/ecal/cleanup.sh b/tests/libecal/cleanup.sh
similarity index 100%
rename from calendar/tests/ecal/cleanup.sh
rename to tests/libecal/cleanup.sh
diff --git a/calendar/tests/ecal/ecal-test-utils.c b/tests/libecal/ecal-test-utils.c
similarity index 100%
rename from calendar/tests/ecal/ecal-test-utils.c
rename to tests/libecal/ecal-test-utils.c
diff --git a/calendar/tests/ecal/ecal-test-utils.h b/tests/libecal/ecal-test-utils.h
similarity index 100%
rename from calendar/tests/ecal/ecal-test-utils.h
rename to tests/libecal/ecal-test-utils.h
diff --git a/calendar/tests/ecal/test-ecal-add-timezone.c b/tests/libecal/test-ecal-add-timezone.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-add-timezone.c
rename to tests/libecal/test-ecal-add-timezone.c
diff --git a/calendar/tests/ecal/test-ecal-create-object--2.c b/tests/libecal/test-ecal-create-object--2.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-create-object--2.c
rename to tests/libecal/test-ecal-create-object--2.c
diff --git a/calendar/tests/ecal/test-ecal-create-object.c b/tests/libecal/test-ecal-create-object.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-create-object.c
rename to tests/libecal/test-ecal-create-object.c
diff --git a/calendar/tests/ecal/test-ecal-get-alarm-email-address.c b/tests/libecal/test-ecal-get-alarm-email-address.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-alarm-email-address.c
rename to tests/libecal/test-ecal-get-alarm-email-address.c
diff --git a/calendar/tests/ecal/test-ecal-get-cal-address.c b/tests/libecal/test-ecal-get-cal-address.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-cal-address.c
rename to tests/libecal/test-ecal-get-cal-address.c
diff --git a/calendar/tests/ecal/test-ecal-get-capabilities.c b/tests/libecal/test-ecal-get-capabilities.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-capabilities.c
rename to tests/libecal/test-ecal-get-capabilities.c
diff --git a/calendar/tests/ecal/test-ecal-get-default-object.c b/tests/libecal/test-ecal-get-default-object.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-default-object.c
rename to tests/libecal/test-ecal-get-default-object.c
diff --git a/calendar/tests/ecal/test-ecal-get-free-busy.c b/tests/libecal/test-ecal-get-free-busy.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-free-busy.c
rename to tests/libecal/test-ecal-get-free-busy.c
diff --git a/calendar/tests/ecal/test-ecal-get-ldap-attribute.c b/tests/libecal/test-ecal-get-ldap-attribute.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-ldap-attribute.c
rename to tests/libecal/test-ecal-get-ldap-attribute.c
diff --git a/calendar/tests/ecal/test-ecal-get-object-list.c b/tests/libecal/test-ecal-get-object-list.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-object-list.c
rename to tests/libecal/test-ecal-get-object-list.c
diff --git a/calendar/tests/ecal/test-ecal-get-objects-for-uid.c b/tests/libecal/test-ecal-get-objects-for-uid.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-objects-for-uid.c
rename to tests/libecal/test-ecal-get-objects-for-uid.c
diff --git a/calendar/tests/ecal/test-ecal-get-query.c b/tests/libecal/test-ecal-get-query.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-query.c
rename to tests/libecal/test-ecal-get-query.c
diff --git a/calendar/tests/ecal/test-ecal-get-timezone.c b/tests/libecal/test-ecal-get-timezone.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-get-timezone.c
rename to tests/libecal/test-ecal-get-timezone.c
diff --git a/calendar/tests/ecal/test-ecal-modify-object.c b/tests/libecal/test-ecal-modify-object.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-modify-object.c
rename to tests/libecal/test-ecal-modify-object.c
diff --git a/calendar/tests/ecal/test-ecal-open.c b/tests/libecal/test-ecal-open.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-open.c
rename to tests/libecal/test-ecal-open.c
diff --git a/calendar/tests/ecal/test-ecal-receive-objects.c b/tests/libecal/test-ecal-receive-objects.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-receive-objects.c
rename to tests/libecal/test-ecal-receive-objects.c
diff --git a/calendar/tests/ecal/test-ecal-remove-object.c b/tests/libecal/test-ecal-remove-object.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-remove-object.c
rename to tests/libecal/test-ecal-remove-object.c
diff --git a/calendar/tests/ecal/test-ecal-remove.c b/tests/libecal/test-ecal-remove.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-remove.c
rename to tests/libecal/test-ecal-remove.c
diff --git a/calendar/tests/ecal/test-ecal-send-objects.c b/tests/libecal/test-ecal-send-objects.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-send-objects.c
rename to tests/libecal/test-ecal-send-objects.c
diff --git a/calendar/tests/ecal/test-ecal-set-default-timezone.c b/tests/libecal/test-ecal-set-default-timezone.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-set-default-timezone.c
rename to tests/libecal/test-ecal-set-default-timezone.c
diff --git a/calendar/tests/ecal/test-ecal-set-mode.c b/tests/libecal/test-ecal-set-mode.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-set-mode.c
rename to tests/libecal/test-ecal-set-mode.c
diff --git a/calendar/tests/ecal/test-ecal-stress-factory--fifo.c b/tests/libecal/test-ecal-stress-factory--fifo.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-stress-factory--fifo.c
rename to tests/libecal/test-ecal-stress-factory--fifo.c
diff --git a/calendar/tests/ecal/test-ecal-stress-factory--open-async.c b/tests/libecal/test-ecal-stress-factory--open-async.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-stress-factory--open-async.c
rename to tests/libecal/test-ecal-stress-factory--open-async.c
diff --git a/calendar/tests/ecal/test-ecal-stress-factory--serial.c b/tests/libecal/test-ecal-stress-factory--serial.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-stress-factory--serial.c
rename to tests/libecal/test-ecal-stress-factory--serial.c
diff --git a/calendar/tests/ecal/test-ecal-stress-factory--single-cal.c b/tests/libecal/test-ecal-stress-factory--single-cal.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal-stress-factory--single-cal.c
rename to tests/libecal/test-ecal-stress-factory--single-cal.c
diff --git a/calendar/tests/ecal/test-ecal.c b/tests/libecal/test-ecal.c
similarity index 100%
rename from calendar/tests/ecal/test-ecal.c
rename to tests/libecal/test-ecal.c
diff --git a/calendar/tests/ecal/test-recur.c b/tests/libecal/test-recur.c
similarity index 100%
rename from calendar/tests/ecal/test-recur.c
rename to tests/libecal/test-recur.c
diff --git a/calendar/tests/ecal/test-runner.sh b/tests/libecal/test-runner.sh
similarity index 100%
rename from calendar/tests/ecal/test-runner.sh
rename to tests/libecal/test-runner.sh
diff --git a/calendar/tests/ecal/test-search.c b/tests/libecal/test-search.c
similarity index 100%
rename from calendar/tests/ecal/test-search.c
rename to tests/libecal/test-search.c
diff --git a/calendar/tests/ecal/testdata.ics b/tests/libecal/testdata.ics
similarity index 100%
rename from calendar/tests/ecal/testdata.ics
rename to tests/libecal/testdata.ics
diff --git a/tests/libedata-cal/Makefile.am b/tests/libedata-cal/Makefile.am
new file mode 100644
index 0000000..fee2736
--- /dev/null
+++ b/tests/libedata-cal/Makefile.am
@@ -0,0 +1,64 @@
+noinst_PROGRAMS =							\
+	test-e-sexp							\
+	test-intervaltree						\
+	test-intervaltree-coverage
+
+test_e_sexp_SOURCES = test-cal-backend-sexp.c
+
+test_e_sexp_CPPFLAGS =							\
+	$(AM_CPPFLAGS)							\
+	-I$(top_srcdir)							\
+	-I$(top_srcdir)/calendar					\
+	-I$(top_builddir)/calendar					\
+	$(EVOLUTION_CALENDAR_CFLAGS)
+
+test_e_sexp_LDADD =							\
+	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la	\
+	$(top_builddir)/calendar/libecal/libecal-1.2.la 		\
+	$(top_builddir)/libedataserver/libedataserver-1.2.la		\
+	$(EVOLUTION_CALENDAR_LIBS)					\
+	$(E_DATA_SERVER_LIBS)
+
+test_intervaltree_SOURCES = test-intervaltree.c
+
+test_intervaltree_CPPFLAGS =						\
+	$(AM_CPPFLAGS)							\
+	-I$(top_srcdir)							\
+	-I$(top_srcdir)/calendar					\
+	-I$(top_builddir)/calendar					\
+	$(EVOLUTION_CALENDAR_CFLAGS)
+
+test_intervaltree_LDADD =						\
+	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la	\
+	$(top_builddir)/calendar/libecal/libecal-1.2.la			\
+	$(top_builddir)/libedataserver/libedataserver-1.2.la		\
+	$(EVOLUTION_CALENDAR_LIBS)
+
+test_intervaltree_coverage_SOURCES = test-intervaltree.c
+
+test_intervaltree_coverage_CPPFLAGS =					\
+	$(AM_CPPFLAGS)							\
+	-I$(top_srcdir)							\
+	-I$(top_srcdir)/calendar					\
+	-I$(top_builddir)/calendar					\
+	$(EVOLUTION_CALENDAR_CFLAGS)
+
+test_intervaltree_coverage_LDADD = \
+	$(top_builddir)/calendar/libedata-cal/libedata-cal-1.2.la	\
+	$(top_builddir)/calendar/libecal/libecal-1.2.la			\
+	$(top_builddir)/libedataserver/libedataserver-1.2.la		\
+	$(EVOLUTION_CALENDAR_LIBS)					\
+	-lgcov
+
+.PHONY: coverage
+coverage: 
+	mkdir -p ./coverage
+	lcov --directory . --zerocounters
+	./test-intervaltree-coverage
+	lcov --directory . --capture --output-file ./coverage/*.info
+	genhtml -o ./coverage --legend --num-spaces 2 ./coverage/*.info
+
+clean-local:
+	rm -f *.gcda *.gcno
+
+-include $(top_srcdir)/git.mk
diff --git a/tests/libedata-cal/test-cal-backend-sexp.c b/tests/libedata-cal/test-cal-backend-sexp.c
new file mode 100644
index 0000000..98faeb3
--- /dev/null
+++ b/tests/libedata-cal/test-cal-backend-sexp.c
@@ -0,0 +1,47 @@
+#include <libedata-cal/e-cal-backend-sexp.h>
+
+static void
+test_query (const gchar * query)
+{
+	ECalBackendSExp *sexp = e_cal_backend_sexp_new (query);
+	time_t start, end;
+
+	gboolean generator = e_cal_backend_sexp_evaluate_occur_times (sexp, &start, &end);
+
+	if (generator) {
+		printf ("%s: %ld - %ld\n", query, start, end);
+	} else {
+		printf ("%s: no time prunning possible\n", query);
+	}
+}
+
+gint main (gint argc, gchar **argv)
+{
+	g_type_init ();
+
+	/* e_sexp_add_variable(f, 0, "test", NULL); */
+
+	if (argc < 2 || !argv[1])
+	{
+		test_query ("(occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))");
+		test_query ("(due-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))");
+		test_query ("(has-alarms-in-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))");
+		test_query ("(completed-before? (make-time \"20080727T220000Z\") )");
+
+		test_query ("(and (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\")) #t)");
+		test_query ("(or (occur-in-time-range? (make-time \"20080727T220000Z\")(make-time \"20080907T220000Z\")) #t)");
+
+		test_query ("(and (contains? \"substring\") (has-categories? \"blah\"))");
+		test_query ("(or (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\")) (contains? \"substring\"))");
+
+		test_query ("(and (and (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))"
+			    " (or (contains? \"substring\") (has-categories? \"blah\"))) (has-alarms?))");
+
+		test_query ("(or (and (occur-in-time-range? (make-time \"20080727T220000Z\") (make-time \"20080907T220000Z\"))"
+			    " (or (contains? \"substring\") (has-categories? \"blah\"))) (has-alarms?))");
+	}
+	else
+		test_query (argv[1]);
+
+	return 0;
+}
diff --git a/calendar/libedata-cal/test-intervaltree.c b/tests/libedata-cal/test-intervaltree.c
similarity index 99%
rename from calendar/libedata-cal/test-intervaltree.c
rename to tests/libedata-cal/test-intervaltree.c
index 34e9853..0006337 100644
--- a/calendar/libedata-cal/test-intervaltree.c
+++ b/tests/libedata-cal/test-intervaltree.c
@@ -26,7 +26,7 @@
 #include <libecal/e-cal-recur.h>
 #include <libecal/e-cal-component.h>
 #include <libical/icalcomponent.h>
-#include "e-cal-backend-intervaltree.h"
+#include <libedata-cal/e-cal-backend-intervaltree.h>
 
 #define NUM_INTERVALS_CLOSED  100
 #define NUM_INTERVALS_OPEN  100
diff --git a/tests/libedataserver/Makefile.am b/tests/libedataserver/Makefile.am
new file mode 100644
index 0000000..6d714a6
--- /dev/null
+++ b/tests/libedataserver/Makefile.am
@@ -0,0 +1,15 @@
+noinst_PROGRAMS = test-source-list
+
+test_source_list_CPPFLAGS =					\
+	$(AM_CPPFLAGS)						\
+	-I$(top_srcdir)						\
+	-DG_LOG_DOMAIN=\"e-data-server\"			\
+	$(E_DATA_SERVER_CFLAGS)
+
+test_source_list_SOURCES = test-source-list.c
+
+test_source_list_LDADD =					\
+	$(top_builddir)/libedataserver/libedataserver-1.2.la	\
+	$(E_DATA_SERVER_LIBS)
+
+-include $(top_srcdir)/git.mk
diff --git a/libedataserver/test-source-list.c b/tests/libedataserver/test-source-list.c
similarity index 99%
rename from libedataserver/test-source-list.c
rename to tests/libedataserver/test-source-list.c
index 5beccd8..59ba338 100644
--- a/libedataserver/test-source-list.c
+++ b/tests/libedataserver/test-source-list.c
@@ -20,12 +20,8 @@
  * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
-#include <glib.h>
-#include "e-source-list.h"
+#include <libedataserver/e-source-list.h>
 
 /* Globals. */
 
diff --git a/tests/libedataserverui/Makefile.am b/tests/libedataserverui/Makefile.am
new file mode 100644
index 0000000..4473a07
--- /dev/null
+++ b/tests/libedataserverui/Makefile.am
@@ -0,0 +1,46 @@
+noinst_PROGRAMS = 							\
+	test-category-completion					\
+	test-source-combo-box						\
+	test-source-selector						\
+	test-contact-store						\
+	test-name-selector
+
+TEST_EDATASERVERUI_CPPFLAGS=						\
+	$(AM_CPPFLAGS)							\
+	-I$(top_srcdir)							\
+	-I$(top_srcdir)/addressbook					\
+	-I$(top_builddir)/addressbook					\
+	-DG_LOG_DOMAIN=\"e-data-server-ui\"				\
+	$(CAMEL_CFLAGS)							\
+	$(GNOME_KEYRING_CFLAGS)						\
+	$(E_DATA_SERVER_UI_CFLAGS)
+
+TEST_EDATASERVERUI_LDFLAGS =						\
+	$(top_builddir)/camel/libcamel-1.2.la				\
+	$(top_builddir)/addressbook/libebook/libebook-1.2.la		\
+	$(top_builddir)/libedataserver/libedataserver-1.2.la		\
+	$(top_builddir)/libedataserverui/libedataserverui-3.0.la	\
+	$(GNOME_KEYRING_LIBS)						\
+	$(E_DATA_SERVER_UI_LIBS)
+
+test_category_completion_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
+test_category_completion_SOURCES = test-category-completion.c
+test_category_completion_LDADD = $(TEST_EDATASERVERUI_LDFLAGS)
+
+test_source_selector_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
+test_source_selector_SOURCES = test-source-selector.c
+test_source_selector_LDADD =  $(TEST_EDATASERVERUI_LDFLAGS)
+
+test_source_combo_box_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
+test_source_combo_box_SOURCES = test-source-combo-box.c
+test_source_combo_box_LDADD =  $(TEST_EDATASERVERUI_LDFLAGS)
+
+test_contact_store_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
+test_contact_store_SOURCES = test-contact-store.c
+test_contact_store_LDADD = $(TEST_EDATASERVERUI_LDFLAGS)
+
+test_name_selector_CPPFLAGS = $(TEST_EDATASERVERUI_CPPFLAGS)
+test_name_selector_SOURCES = test-name-selector.c
+test_name_selector_LDADD = $(TEST_EDATASERVERUI_LDFLAGS)
+
+-include $(top_srcdir)/git.mk
diff --git a/libedataserverui/test-category-completion.c b/tests/libedataserverui/test-category-completion.c
similarity index 96%
rename from libedataserverui/test-category-completion.c
rename to tests/libedataserverui/test-category-completion.c
index 4a921ed..0f53041 100644
--- a/libedataserverui/test-category-completion.c
+++ b/tests/libedataserverui/test-category-completion.c
@@ -16,7 +16,7 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#include "e-category-completion.h"
+#include <libedataserverui/e-category-completion.h>
 
 static gboolean
 on_idle_create_widget (void)
diff --git a/libedataserverui/test-contact-store.c b/tests/libedataserverui/test-contact-store.c
similarity index 97%
rename from libedataserverui/test-contact-store.c
rename to tests/libedataserverui/test-contact-store.c
index 707b2ab..4560801 100644
--- a/libedataserverui/test-contact-store.c
+++ b/tests/libedataserverui/test-contact-store.c
@@ -21,12 +21,7 @@
  * Author: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "e-contact-store.h"
-#include <gtk/gtk.h>
+#include <libedataserverui/e-contact-store.h>
 
 static void
 entry_changed (GtkWidget *entry, EContactStore *contact_store)
diff --git a/libedataserverui/test-name-selector.c b/tests/libedataserverui/test-name-selector.c
similarity index 94%
rename from libedataserverui/test-name-selector.c
rename to tests/libedataserverui/test-name-selector.c
index ffb0445..4250387 100644
--- a/libedataserverui/test-name-selector.c
+++ b/tests/libedataserverui/test-name-selector.c
@@ -21,14 +21,9 @@
  * Author: Hans Petter Jansson <hpj novell com>
  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include "e-name-selector-model.h"
-#include "e-name-selector-dialog.h"
-#include "e-name-selector-entry.h"
-#include <gtk/gtk.h>
+#include <libedataserverui/e-name-selector-model.h>
+#include <libedataserverui/e-name-selector-dialog.h>
+#include <libedataserverui/e-name-selector-entry.h>
 #include <camel/camel.h>
 
 static ENameSelectorDialog *name_selector_dialog;
diff --git a/libedataserverui/test-source-combo-box.c b/tests/libedataserverui/test-source-combo-box.c
similarity index 95%
rename from libedataserverui/test-source-combo-box.c
rename to tests/libedataserverui/test-source-combo-box.c
index 3cef377..4da534b 100644
--- a/libedataserverui/test-source-combo-box.c
+++ b/tests/libedataserverui/test-source-combo-box.c
@@ -20,13 +20,7 @@
  * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-source-combo-box.h"
-
-#include <gtk/gtk.h>
+#include <libedataserverui/e-source-combo-box.h>
 
 static void
 source_changed_cb (ESourceComboBox *combo_box)
diff --git a/libedataserverui/test-source-selector.c b/tests/libedataserverui/test-source-selector.c
similarity index 97%
rename from libedataserverui/test-source-selector.c
rename to tests/libedataserverui/test-source-selector.c
index 38d6258..62afc37 100644
--- a/libedataserverui/test-source-selector.c
+++ b/tests/libedataserverui/test-source-selector.c
@@ -21,13 +21,7 @@
  * Author: Ettore Perazzoli <ettore ximian com>
  */
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "e-source-selector.h"
-
-#include <gtk/gtk.h>
+#include <libedataserverui/e-source-selector.h>
 
 static void
 dump_selection (ESourceSelector *selector)



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