Collect all test code into a top-level "tests" directory
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 22 Mar 2011 17:57:21 +0000 (13:57 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Tue, 22 Mar 2011 19:50:04 +0000 (15:50 -0400)
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).

111 files changed:
.gitignore
Makefile.am
addressbook/Makefile.am
addressbook/tests/Makefile.am [deleted file]
calendar/Makefile.am
calendar/libedata-cal/Makefile.am
calendar/libedata-cal/e-cal-backend-sexp.c
calendar/tests/Makefile.am [deleted file]
configure.ac
docs/reference/calendar/libecal/tmpl/e-cal-check-timezones.sgml
docs/reference/calendar/libecal/tmpl/libecal-unused.sgml
docs/reference/camel/tmpl/camel-cipher-context.sgml
libedataserver/Makefile.am
libedataserverui/Makefile.am
tests/Makefile.am [new file with mode: 0644]
tests/libebook/Makefile.am [moved from addressbook/tests/ebook/Makefile.am with 99% similarity]
tests/libebook/data/vcards/name-only.vcf [moved from addressbook/tests/ebook/data/vcards/name-only.vcf with 100% similarity]
tests/libebook/data/vcards/simple-1.vcf [moved from addressbook/tests/ebook/data/vcards/simple-1.vcf with 100% similarity]
tests/libebook/data/vcards/simple-2.vcf [moved from addressbook/tests/ebook/data/vcards/simple-2.vcf with 100% similarity]
tests/libebook/ebook-test-utils.c [moved from addressbook/tests/ebook/ebook-test-utils.c with 100% similarity]
tests/libebook/ebook-test-utils.h [moved from addressbook/tests/ebook/ebook-test-utils.h with 100% similarity]
tests/libebook/test-categories.c [moved from addressbook/tests/ebook/test-categories.c with 100% similarity]
tests/libebook/test-changes.c [moved from addressbook/tests/ebook/test-changes.c with 100% similarity]
tests/libebook/test-date.c [moved from addressbook/tests/ebook/test-date.c with 100% similarity]
tests/libebook/test-ebook-add-contact.c [moved from addressbook/tests/ebook/test-ebook-add-contact.c with 100% similarity]
tests/libebook/test-ebook-async.c [moved from addressbook/tests/ebook/test-ebook-async.c with 100% similarity]
tests/libebook/test-ebook-commit-contact.c [moved from addressbook/tests/ebook/test-ebook-commit-contact.c with 100% similarity]
tests/libebook/test-ebook-get-book-view.c [moved from addressbook/tests/ebook/test-ebook-get-book-view.c with 100% similarity]
tests/libebook/test-ebook-get-contact.c [moved from addressbook/tests/ebook/test-ebook-get-contact.c with 100% similarity]
tests/libebook/test-ebook-get-required-fields.c [moved from addressbook/tests/ebook/test-ebook-get-required-fields.c with 100% similarity]
tests/libebook/test-ebook-get-static-capabilities.c [moved from addressbook/tests/ebook/test-ebook-get-static-capabilities.c with 100% similarity]
tests/libebook/test-ebook-get-supported-auth-methods.c [moved from addressbook/tests/ebook/test-ebook-get-supported-auth-methods.c with 100% similarity]
tests/libebook/test-ebook-get-supported-fields.c [moved from addressbook/tests/ebook/test-ebook-get-supported-fields.c with 100% similarity]
tests/libebook/test-ebook-remove-contact-by-id.c [moved from addressbook/tests/ebook/test-ebook-remove-contact-by-id.c with 100% similarity]
tests/libebook/test-ebook-remove-contact.c [moved from addressbook/tests/ebook/test-ebook-remove-contact.c with 100% similarity]
tests/libebook/test-ebook-remove-contacts.c [moved from addressbook/tests/ebook/test-ebook-remove-contacts.c with 100% similarity]
tests/libebook/test-ebook-remove.c [moved from addressbook/tests/ebook/test-ebook-remove.c with 100% similarity]
tests/libebook/test-ebook-stress-factory--fifo.c [moved from addressbook/tests/ebook/test-ebook-stress-factory--fifo.c with 100% similarity]
tests/libebook/test-ebook-stress-factory--serial.c [moved from addressbook/tests/ebook/test-ebook-stress-factory--serial.c with 100% similarity]
tests/libebook/test-ebook-stress-factory--single-book.c [moved from addressbook/tests/ebook/test-ebook-stress-factory--single-book.c with 100% similarity]
tests/libebook/test-ebook.c [moved from addressbook/tests/ebook/test-ebook.c with 100% similarity]
tests/libebook/test-nonexistent-id.c [moved from addressbook/tests/ebook/test-nonexistent-id.c with 100% similarity]
tests/libebook/test-photo.c [moved from addressbook/tests/ebook/test-photo.c with 100% similarity]
tests/libebook/test-query.c [moved from addressbook/tests/ebook/test-query.c with 100% similarity]
tests/libebook/test-search.c [moved from addressbook/tests/ebook/test-search.c with 100% similarity]
tests/libebook/test-self.c [moved from addressbook/tests/ebook/test-self.c with 100% similarity]
tests/libebook/test-stress-bookviews.c [moved from addressbook/tests/ebook/test-stress-bookviews.c with 100% similarity]
tests/libebook/test-string.c [moved from addressbook/tests/ebook/test-string.c with 100% similarity]
tests/libebook/test-undefinedfield.c [moved from addressbook/tests/ebook/test-undefinedfield.c with 100% similarity]
tests/libebook/test-untyped-phones.c [moved from addressbook/tests/ebook/test-untyped-phones.c with 100% similarity]
tests/libebook/vcard/1.vcf [moved from addressbook/tests/vcard/1.vcf with 100% similarity]
tests/libebook/vcard/10.vcf [moved from addressbook/tests/vcard/10.vcf with 100% similarity]
tests/libebook/vcard/11.vcf [moved from addressbook/tests/vcard/11.vcf with 100% similarity]
tests/libebook/vcard/12.vcf [moved from addressbook/tests/vcard/12.vcf with 100% similarity]
tests/libebook/vcard/13.vcf [moved from addressbook/tests/vcard/13.vcf with 100% similarity]
tests/libebook/vcard/2.vcf [moved from addressbook/tests/vcard/2.vcf with 100% similarity]
tests/libebook/vcard/3.vcf [moved from addressbook/tests/vcard/3.vcf with 100% similarity]
tests/libebook/vcard/4.vcf [moved from addressbook/tests/vcard/4.vcf with 100% similarity]
tests/libebook/vcard/5.vcf [moved from addressbook/tests/vcard/5.vcf with 100% similarity]
tests/libebook/vcard/6.vcf [moved from addressbook/tests/vcard/6.vcf with 100% similarity]
tests/libebook/vcard/7.vcf [moved from addressbook/tests/vcard/7.vcf with 100% similarity]
tests/libebook/vcard/8.vcf [moved from addressbook/tests/vcard/8.vcf with 100% similarity]
tests/libebook/vcard/9.vcf [moved from addressbook/tests/vcard/9.vcf with 100% similarity]
tests/libebook/vcard/Makefile.am [moved from addressbook/tests/vcard/Makefile.am with 100% similarity]
tests/libebook/vcard/README [moved from addressbook/tests/vcard/README with 100% similarity]
tests/libebook/vcard/dump-vcard.c [moved from addressbook/tests/vcard/dump-vcard.c with 100% similarity]
tests/libecal/Makefile.am [moved from calendar/tests/ecal/Makefile.am with 100% similarity]
tests/libecal/cleanup.sh [moved from calendar/tests/ecal/cleanup.sh with 100% similarity]
tests/libecal/ecal-test-utils.c [moved from calendar/tests/ecal/ecal-test-utils.c with 100% similarity]
tests/libecal/ecal-test-utils.h [moved from calendar/tests/ecal/ecal-test-utils.h with 100% similarity]
tests/libecal/test-ecal-add-timezone.c [moved from calendar/tests/ecal/test-ecal-add-timezone.c with 100% similarity]
tests/libecal/test-ecal-create-object--2.c [moved from calendar/tests/ecal/test-ecal-create-object--2.c with 100% similarity]
tests/libecal/test-ecal-create-object.c [moved from calendar/tests/ecal/test-ecal-create-object.c with 100% similarity]
tests/libecal/test-ecal-get-alarm-email-address.c [moved from calendar/tests/ecal/test-ecal-get-alarm-email-address.c with 100% similarity]
tests/libecal/test-ecal-get-cal-address.c [moved from calendar/tests/ecal/test-ecal-get-cal-address.c with 100% similarity]
tests/libecal/test-ecal-get-capabilities.c [moved from calendar/tests/ecal/test-ecal-get-capabilities.c with 100% similarity]
tests/libecal/test-ecal-get-default-object.c [moved from calendar/tests/ecal/test-ecal-get-default-object.c with 100% similarity]
tests/libecal/test-ecal-get-free-busy.c [moved from calendar/tests/ecal/test-ecal-get-free-busy.c with 100% similarity]
tests/libecal/test-ecal-get-ldap-attribute.c [moved from calendar/tests/ecal/test-ecal-get-ldap-attribute.c with 100% similarity]
tests/libecal/test-ecal-get-object-list.c [moved from calendar/tests/ecal/test-ecal-get-object-list.c with 100% similarity]
tests/libecal/test-ecal-get-objects-for-uid.c [moved from calendar/tests/ecal/test-ecal-get-objects-for-uid.c with 100% similarity]
tests/libecal/test-ecal-get-query.c [moved from calendar/tests/ecal/test-ecal-get-query.c with 100% similarity]
tests/libecal/test-ecal-get-timezone.c [moved from calendar/tests/ecal/test-ecal-get-timezone.c with 100% similarity]
tests/libecal/test-ecal-modify-object.c [moved from calendar/tests/ecal/test-ecal-modify-object.c with 100% similarity]
tests/libecal/test-ecal-open.c [moved from calendar/tests/ecal/test-ecal-open.c with 100% similarity]
tests/libecal/test-ecal-receive-objects.c [moved from calendar/tests/ecal/test-ecal-receive-objects.c with 100% similarity]
tests/libecal/test-ecal-remove-object.c [moved from calendar/tests/ecal/test-ecal-remove-object.c with 100% similarity]
tests/libecal/test-ecal-remove.c [moved from calendar/tests/ecal/test-ecal-remove.c with 100% similarity]
tests/libecal/test-ecal-send-objects.c [moved from calendar/tests/ecal/test-ecal-send-objects.c with 100% similarity]
tests/libecal/test-ecal-set-default-timezone.c [moved from calendar/tests/ecal/test-ecal-set-default-timezone.c with 100% similarity]
tests/libecal/test-ecal-set-mode.c [moved from calendar/tests/ecal/test-ecal-set-mode.c with 100% similarity]
tests/libecal/test-ecal-stress-factory--fifo.c [moved from calendar/tests/ecal/test-ecal-stress-factory--fifo.c with 100% similarity]
tests/libecal/test-ecal-stress-factory--open-async.c [moved from calendar/tests/ecal/test-ecal-stress-factory--open-async.c with 100% similarity]
tests/libecal/test-ecal-stress-factory--serial.c [moved from calendar/tests/ecal/test-ecal-stress-factory--serial.c with 100% similarity]
tests/libecal/test-ecal-stress-factory--single-cal.c [moved from calendar/tests/ecal/test-ecal-stress-factory--single-cal.c with 100% similarity]
tests/libecal/test-ecal.c [moved from calendar/tests/ecal/test-ecal.c with 100% similarity]
tests/libecal/test-recur.c [moved from calendar/tests/ecal/test-recur.c with 100% similarity]
tests/libecal/test-runner.sh [moved from calendar/tests/ecal/test-runner.sh with 100% similarity]
tests/libecal/test-search.c [moved from calendar/tests/ecal/test-search.c with 100% similarity]
tests/libecal/testdata.ics [moved from calendar/tests/ecal/testdata.ics with 100% similarity]
tests/libedata-cal/Makefile.am [new file with mode: 0644]
tests/libedata-cal/test-cal-backend-sexp.c [new file with mode: 0644]
tests/libedata-cal/test-intervaltree.c [moved from calendar/libedata-cal/test-intervaltree.c with 99% similarity]
tests/libedataserver/Makefile.am [new file with mode: 0644]
tests/libedataserver/test-source-list.c [moved from libedataserver/test-source-list.c with 99% similarity]
tests/libedataserverui/Makefile.am [new file with mode: 0644]
tests/libedataserverui/test-category-completion.c [moved from libedataserverui/test-category-completion.c with 96% similarity]
tests/libedataserverui/test-contact-store.c [moved from libedataserverui/test-contact-store.c with 97% similarity]
tests/libedataserverui/test-name-selector.c [moved from libedataserverui/test-name-selector.c with 94% similarity]
tests/libedataserverui/test-source-combo-box.c [moved from libedataserverui/test-source-combo-box.c with 95% similarity]
tests/libedataserverui/test-source-selector.c [moved from libedataserverui/test-source-selector.c with 97% similarity]

index 2467253..074ecea 100644 (file)
 /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
index 4c0278f..eaaf5ec 100644 (file)
@@ -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 $< $@
index 95a652b..f61358d 100644 (file)
@@ -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/addressbook/tests/Makefile.am b/addressbook/tests/Makefile.am
deleted file mode 100644 (file)
index 591bdff..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-SUBDIRS = vcard ebook
-
--include $(top_srcdir)/git.mk
index 6070753..9c5d334 100644 (file)
@@ -1,3 +1,3 @@
-SUBDIRS = libegdbus libecal libedata-cal backends tests
+SUBDIRS = libegdbus libecal libedata-cal backends
 
 -include $(top_srcdir)/git.mk
index d9f71cf..6d92872 100644 (file)
@@ -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
index 42805ec..e408d3d 100644 (file)
@@ -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/calendar/tests/Makefile.am b/calendar/tests/Makefile.am
deleted file mode 100644 (file)
index 0962d08..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS = ecal
--include $(top_srcdir)/git.mk
index 3cdcbc0..ff6d292 100644 (file)
@@ -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
index 98c382c..1e00f16 100644 (file)
@@ -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: 
index df0f1a7..8f4e254 100644 (file)
@@ -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>
 
index 1a1848a..8d450dc 100644 (file)
@@ -730,6 +730,8 @@ CamelCipherContext
 @gpointer cert_data: 
 @gpointer cert_data:
 @gpointer cert_data: 
+@gpointer cert_data:
+@gpointer cert_data: 
 @gpointer cert_data: 
 
 
index ccff30c..3041867 100644 (file)
@@ -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 $< $@
 
index 9c31763..e20028d 100644 (file)
@@ -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 (file)
index 0000000..bb1ea20
--- /dev/null
@@ -0,0 +1,3 @@
+SUBDIRS = libedataserver libedataserverui libebook libecal libedata-cal
+
+-include $(top_srcdir)/git.mk
similarity index 99%
rename from addressbook/tests/ebook/Makefile.am
rename to tests/libebook/Makefile.am
index ba7c10d..90a1e60 100644 (file)
@@ -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/tests/libedata-cal/Makefile.am b/tests/libedata-cal/Makefile.am
new file mode 100644 (file)
index 0000000..fee2736
--- /dev/null
@@ -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 (file)
index 0000000..98faeb3
--- /dev/null
@@ -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;
+}
similarity index 99%
rename from calendar/libedata-cal/test-intervaltree.c
rename to tests/libedata-cal/test-intervaltree.c
index 34e9853..0006337 100644 (file)
@@ -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 (file)
index 0000000..6d714a6
--- /dev/null
@@ -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
similarity index 99%
rename from libedataserver/test-source-list.c
rename to tests/libedataserver/test-source-list.c
index 5beccd8..59ba338 100644 (file)
  * 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 (file)
index 0000000..4473a07
--- /dev/null
@@ -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
@@ -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)
similarity index 97%
rename from libedataserverui/test-contact-store.c
rename to tests/libedataserverui/test-contact-store.c
index 707b2ab..4560801 100644 (file)
  * 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)
similarity index 94%
rename from libedataserverui/test-name-selector.c
rename to tests/libedataserverui/test-name-selector.c
index ffb0445..4250387 100644 (file)
  * 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;
similarity index 95%
rename from libedataserverui/test-source-combo-box.c
rename to tests/libedataserverui/test-source-combo-box.c
index 3cef377..4da534b 100644 (file)
  * 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)
similarity index 97%
rename from libedataserverui/test-source-selector.c
rename to tests/libedataserverui/test-source-selector.c
index 38d6258..62afc37 100644 (file)
  * 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)