From 2f6721bf5bd7d5c853279db40b1fb15ded4745a2 Mon Sep 17 00:00:00 2001 From: NotZed Date: Tue, 29 Feb 2000 20:16:02 +0000 Subject: Added test program. 2000-02-29 NotZed * tests/ui-tests/Makefile.am (filter_LDADD): Added test program. * tests/ui-tests/filterdescription.xml, saveoptions.xml: Data files for test program. * tests/ui-tests/filter.c (main): Test program for filter ui. svn path=/trunk/; revision=1992 --- ChangeLog | 9 ++++ tests/ui-tests/Makefile.am | 12 +++++- tests/ui-tests/filter.c | 30 +++++++++++++ tests/ui-tests/filterdescription.xml | 81 ++++++++++++++++++++++++++++++++++++ tests/ui-tests/saveoptions.xml | 37 ++++++++++++++++ 5 files changed, 168 insertions(+), 1 deletion(-) create mode 100644 tests/ui-tests/filter.c create mode 100644 tests/ui-tests/filterdescription.xml create mode 100644 tests/ui-tests/saveoptions.xml diff --git a/ChangeLog b/ChangeLog index 065b83b893..644b1f752a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-02-29 NotZed + + * tests/ui-tests/Makefile.am (filter_LDADD): Added test program. + + * tests/ui-tests/filterdescription.xml, saveoptions.xml: Data + files for test program. + + * tests/ui-tests/filter.c (main): Test program for filter ui. + 2000-02-28 NotZed * widgets/shortcut-bar/Makefile.am (test_shortcut_bar_LDADD): diff --git a/tests/ui-tests/Makefile.am b/tests/ui-tests/Makefile.am index af391305ea..0fd73cfc8f 100644 --- a/tests/ui-tests/Makefile.am +++ b/tests/ui-tests/Makefile.am @@ -6,6 +6,7 @@ INCLUDES = \ -I$(includedir) \ -I$(top_srcdir)/camel/providers/MH \ -I$(top_srcdir)/widgets \ + -I$(top_srcdir)/filter \ $(EXTRA_GNOME_CFLAGS) LDADD = \ @@ -23,6 +24,15 @@ message_browser_LDADD = \ $(EXTRA_GNOME_LIBS) \ -lgtkhtml -lgnomeprint ../../mail/html-stream.o +filter_LDADD = \ + $(top_builddir)/camel/libcamel.la \ + $(INTLLIBS) \ + $(EXTRA_GNOME_LIBS) \ + $(PTHREAD_LIB) \ + $(EXTRA_GNOME_LIBS) \ + $(top_builddir)/filter/libfilter.la \ + -lgtkhtml noinst_PROGRAMS = \ - message-browser + message-browser \ + filter diff --git a/tests/ui-tests/filter.c b/tests/ui-tests/filter.c new file mode 100644 index 0000000000..3ff6a1b1ae --- /dev/null +++ b/tests/ui-tests/filter.c @@ -0,0 +1,30 @@ + +#include +#include "filter-editor.h" + +int main(int argc, char **argv) +{ + GList *rules, *options, *options2; + xmlDocPtr doc, out, optionset, filteroptions; + GString *s; + GtkWidget *w; + + gnome_init("Test", "0.0", argc, argv); + gdk_rgb_init (); + gtk_widget_set_default_colormap (gdk_rgb_get_cmap ()); + gtk_widget_set_default_visual (gdk_rgb_get_visual ()); + + w = filter_editor_new(); + + doc = xmlParseFile("filterdescription.xml"); + rules = filter_load_ruleset(doc); + options = filter_load_optionset(doc, rules); + options2 = options; + out = xmlParseFile("saveoptions.xml"); + options = filter_load_optionset(out, rules); + + filter_editor_set_rules(w, rules, options2, options); + + gtk_widget_show(w); + gtk_main(); +} diff --git a/tests/ui-tests/filterdescription.xml b/tests/ui-tests/filterdescription.xml new file mode 100644 index 0000000000..684e1e085f --- /dev/null +++ b/tests/ui-tests/filterdescription.xml @@ -0,0 +1,81 @@ + + + + + + (match-all (header-contains "From" ${sender})) + + When the from address matches sender(s). + + + + + (match-all (header-contains "To" ${receipient})) + + When the to address matches receipients. + + + + + (match-all (header-contains "CC" ${self-email})) + + When I am in the cc list. + + + + + (& (> message-size (size-lower size-range)) + (< message-size (size-uppwer size-range))) + + When the message is a certain size. + + + + + + + (copy-to ${folder}) + + Send me a copy, to folder. + + + + + + + (match-all (not (header-contains "To" "zucchi@zedzone"))) + + When I am the receipient. + + + + + + + + +