Make the mailbox test as a program.
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 28 Apr 2005 09:18:20 +0000 (09:18 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 28 Apr 2005 09:18:20 +0000 (09:18 +0000)
test/mbox/Makefile.am
test/mbox/invalid.mbx [new file with mode: 0644]
test/mbox/mail1.mbx [new file with mode: 0644]
test/mbox/mail3.mbx [new file with mode: 0644]
test/mbox/mbox1.c [new file with mode: 0644]
test/mbox/onemail [deleted file]
test/mbox/test1.sh [deleted file]
test/mbox/test2.sh [deleted file]
test/mbox/vm [deleted file]
test/mbox/zebra.cfg

index 65c9b30..bdabaed 100644 (file)
@@ -1,6 +1,26 @@
-# $Id: Makefile.am,v 1.3 2004-12-08 13:59:17 adam Exp $
+# $Id: Makefile.am,v 1.4 2005-04-28 09:18:20 adam Exp $
 
-EXTRA_DIST = zebra.cfg test1.sh test2.sh email2.flt onemail vm vm2
+check_PROGRAMS = mbox1
+TESTS = $(check_PROGRAMS)
 
-noinst_PROGRAMS =
+mailboxfiles = mail1.mbx mail3.mbx invalid.mbx
+EXTRA_DIST= zebra.cfg email2.flt $(mailboxfiles)
 
+mbox1_SOURCES = mbox1.c
+
+AM_CPPFLAGS = -I$(srcdir)/../api -I$(top_srcdir)/include $(YAZINC)
+
+zebralibs = \
+ ../../index/libidzebra-api.la \
+ ../../rset/libidzebra-rset.la \
+ ../../recctrl/libidzebra-recctrl.la \
+ ../../dict/libidzebra-dict.la  \
+ ../../isams/libidzebra-isams.la \
+ ../../isamc/libidzebra-isamc.la \
+ ../../isamb/libidzebra-isamb.la \
+ ../../data1/libidzebra-data1.la \
+ ../../bfile/libidzebra-bfile.la \
+ ../../dfa/libidzebra-dfa.la \
+ ../../util/libidzebra-util.la
+
+LDADD = ../api/libtestlib.a $(zebralibs) $(YAZLALIB)
diff --git a/test/mbox/invalid.mbx b/test/mbox/invalid.mbx
new file mode 100644 (file)
index 0000000..3137465
--- /dev/null
@@ -0,0 +1,2 @@
+LicenseType = "User" 
+LicenseClass = "Commercial" 
diff --git a/test/mbox/mail1.mbx b/test/mbox/mail1.mbx
new file mode 100644 (file)
index 0000000..80acb7f
--- /dev/null
@@ -0,0 +1,59 @@
+From marc@indexdata.dk Thu Dec 02 09:57:42 2004
+Return-path: <marc@indexdata.dk>
+Envelope-to: heikki@indexdata.dk
+Delivery-date: Thu, 02 Dec 2004 09:57:42 +0100
+Received: from user.indexdata.dk ([213.150.43.10] helo=[10.0.1.66])
+       by bagel.indexdata.dk with esmtp (Exim 3.35 #1 (Debian))
+       id 1CZmmS-0006ZW-00; Thu, 02 Dec 2004 09:57:40 +0100
+Message-ID: <41AED904.3000500@indexdata.dk>
+Date: Thu, 02 Dec 2004 09:57:40 +0100
+From: Marc Cromme <marc@indexdata.dk>
+Reply-To:  marc@indexdata.dk
+Organization: Index Data
+User-Agent: Mozilla Thunderbird 0.8 (X11/20040926)
+X-Accept-Language: en-us, en
+MIME-Version: 1.0
+To: Adam Dickmeiss <adam@indexdata.dk>, 
+ Heikki Levanto <heikki@indexdata.dk>,
+ Sebastian Hammer <quinn@indexdata.dk>
+Subject: [Fwd: [Zebralist] Indexing multiple xml elements as a phrase]
+Content-Type: multipart/mixed;
+ boundary="------------020203040804000501020404"
+X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on bagel.indexdata.dk
+X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00 autolearn=ham 
+       version=3.0.0
+X-Spam-Level: 
+Status: RO
+Content-Length: 4755
+Lines: 135
+
+This is a multi-part message in MIME format.
+--------------020203040804000501020404
+Content-Type: text/plain; charset=UTF-8; format=flowed
+Content-Transfer-Encoding: 8bit
+
+Hi folks - denne her er ikke blevet besvaret på zebra listen, og jeg kan 
+ikke svare på den. Kan en af jer ??
+
+Marc
+
+-- 
+
+Marc Cromme, cand. polyt, Ph.D
+Senior Developer, Project Manager
+
+Index Data Aps
+Købmagergade 43, 2 
+1150 Copenhagen K.
+Denmark
+
+tel: +45 3341 1000
+fax: +45 3341 0101
+
+http://www.indexdata.com
+
+INDEX DATA Means Business
+for Open Source and Open Standards
+
+
+
diff --git a/test/mbox/mail3.mbx b/test/mbox/mail3.mbx
new file mode 100644 (file)
index 0000000..dbbb0f4
--- /dev/null
@@ -0,0 +1,177 @@
+From marc@indexdata.dk Thu Dec 02 09:57:42 2004
+Return-path: <marc@indexdata.dk>
+Envelope-to: heikki@indexdata.dk
+Delivery-date: Thu, 02 Dec 2004 09:57:42 +0100
+Received: from user.indexdata.dk ([213.150.43.10] helo=[10.0.1.66])
+       by bagel.indexdata.dk with esmtp (Exim 3.35 #1 (Debian))
+       id 1CZmmS-0006ZW-00; Thu, 02 Dec 2004 09:57:40 +0100
+Message-ID: <41AED904.3000500@indexdata.dk>
+Date: Thu, 02 Dec 2004 09:57:40 +0100
+From: Marc Cromme <marc@indexdata.dk>
+Reply-To:  marc@indexdata.dk
+Organization: Index Data
+User-Agent: Mozilla Thunderbird 0.8 (X11/20040926)
+X-Accept-Language: en-us, en
+MIME-Version: 1.0
+To: Adam Dickmeiss <adam@indexdata.dk>, 
+ Heikki Levanto <heikki@indexdata.dk>,
+ Sebastian Hammer <quinn@indexdata.dk>
+Subject: [Fwd: [Zebralist] Indexing multiple xml elements as a phrase]
+Content-Type: multipart/mixed;
+ boundary="------------020203040804000501020404"
+X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on bagel.indexdata.dk
+X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00 autolearn=ham 
+       version=3.0.0
+X-Spam-Level: 
+Status: RO
+Content-Length: 4755
+Lines: 135
+
+This is a multi-part message in MIME format.
+--------------020203040804000501020404
+Content-Type: text/plain; charset=UTF-8; format=flowed
+Content-Transfer-Encoding: 8bit
+
+Hi folks - denne her er ikke blevet besvaret på zebra listen, og jeg kan 
+ikke svare på den. Kan en af jer ??
+
+Marc
+
+-- 
+
+Marc Cromme, cand. polyt, Ph.D
+Senior Developer, Project Manager
+
+Index Data Aps
+Købmagergade 43, 2 
+1150 Copenhagen K.
+Denmark
+
+tel: +45 3341 1000
+fax: +45 3341 0101
+
+http://www.indexdata.com
+
+INDEX DATA Means Business
+for Open Source and Open Standards
+
+
+
+From marc@indexdata.dk Thu Dec 02 09:57:42 2004
+Return-path: <marc@indexdata.dk>
+Envelope-to: heikki@indexdata.dk
+Delivery-date: Thu, 02 Dec 2004 09:57:42 +0100
+Received: from user.indexdata.dk ([213.150.43.10] helo=[10.0.1.66])
+       by bagel.indexdata.dk with esmtp (Exim 3.35 #1 (Debian))
+       id 1CZmmS-0006ZW-00; Thu, 02 Dec 2004 09:57:40 +0100
+Message-ID: <41AED904.3000500@indexdata.dk>
+Date: Thu, 02 Dec 2004 09:57:40 +0100
+From: Marc Cromme <marc@indexdata.dk>
+Reply-To:  marc@indexdata.dk
+Organization: Index Data
+User-Agent: Mozilla Thunderbird 0.8 (X11/20040926)
+X-Accept-Language: en-us, en
+MIME-Version: 1.0
+To: Adam Dickmeiss <adam@indexdata.dk>, 
+ Heikki Levanto <heikki@indexdata.dk>,
+ Sebastian Hammer <quinn@indexdata.dk>
+Subject: [Fwd: [Zebralist] Indexing multiple xml elements as a phrase]
+Content-Type: multipart/mixed;
+ boundary="------------020203040804000501020404"
+X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on bagel.indexdata.dk
+X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00 autolearn=ham 
+       version=3.0.0
+X-Spam-Level: 
+Status: RO
+Content-Length: 4755
+Lines: 135
+
+This is a multi-part message in MIME format.
+--------------020203040804000501020404
+Content-Type: text/plain; charset=UTF-8; format=flowed
+Content-Transfer-Encoding: 8bit
+
+Hi folks - denne her er ikke blevet besvaret på zebra listen, og jeg kan 
+ikke svare på den. Kan en af jer ??
+
+Marc
+
+-- 
+
+Marc Cromme, cand. polyt, Ph.D
+Senior Developer, Project Manager
+
+Index Data Aps
+Købmagergade 43, 2 
+1150 Copenhagen K.
+Denmark
+
+tel: +45 3341 1000
+fax: +45 3341 0101
+
+http://www.indexdata.com
+
+INDEX DATA Means Business
+for Open Source and Open Standards
+
+
+
+From marc@indexdata.dk Thu Dec 02 09:57:42 2004
+Return-path: <marc@indexdata.dk>
+Envelope-to: heikki@indexdata.dk
+Delivery-date: Thu, 02 Dec 2004 09:57:42 +0100
+Received: from user.indexdata.dk ([213.150.43.10] helo=[10.0.1.66])
+       by bagel.indexdata.dk with esmtp (Exim 3.35 #1 (Debian))
+       id 1CZmmS-0006ZW-00; Thu, 02 Dec 2004 09:57:40 +0100
+Message-ID: <41AED904.3000500@indexdata.dk>
+Date: Thu, 02 Dec 2004 09:57:40 +0100
+From: Marc Cromme <marc@indexdata.dk>
+Reply-To:  marc@indexdata.dk
+Organization: Index Data
+User-Agent: Mozilla Thunderbird 0.8 (X11/20040926)
+X-Accept-Language: en-us, en
+MIME-Version: 1.0
+To: Adam Dickmeiss <adam@indexdata.dk>, 
+ Heikki Levanto <heikki@indexdata.dk>,
+ Sebastian Hammer <quinn@indexdata.dk>
+Subject: [Fwd: [Zebralist] Indexing multiple xml elements as a phrase]
+Content-Type: multipart/mixed;
+ boundary="------------020203040804000501020404"
+X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on bagel.indexdata.dk
+X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00 autolearn=ham 
+       version=3.0.0
+X-Spam-Level: 
+Status: RO
+Content-Length: 4755
+Lines: 135
+
+This is a multi-part message in MIME format.
+--------------020203040804000501020404
+Content-Type: text/plain; charset=UTF-8; format=flowed
+Content-Transfer-Encoding: 8bit
+
+Hi folks - denne her er ikke blevet besvaret på zebra listen, og jeg kan 
+ikke svare på den. Kan en af jer ??
+
+Marc
+
+-- 
+
+Marc Cromme, cand. polyt, Ph.D
+Senior Developer, Project Manager
+
+Index Data Aps
+Købmagergade 43, 2 
+1150 Copenhagen K.
+Denmark
+
+tel: +45 3341 1000
+fax: +45 3341 0101
+
+http://www.indexdata.com
+
+INDEX DATA Means Business
+for Open Source and Open Standards
+
+
+
diff --git a/test/mbox/mbox1.c b/test/mbox/mbox1.c
new file mode 100644 (file)
index 0000000..82c7ed8
--- /dev/null
@@ -0,0 +1,54 @@
+/* $Id: mbox1.c,v 1.1 2005-04-28 09:18:20 adam Exp $
+   Copyright (C) 1995-2005
+   Index Data ApS
+
+This file is part of the Zebra server.
+
+Zebra 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, or (at your option) any later
+version.
+
+Zebra 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 Zebra; see the file LICENSE.zebra.  If not, write to the
+Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+*/
+
+#include "testlib.h"
+       
+int main(int argc, char **argv)
+{
+    char path[256];
+
+    ZebraService zs = start_up(0, argc, argv);
+    ZebraHandle  zh = zebra_open(zs);
+
+    check_filter(zs, "grs.regx");
+    zebra_select_database(zh, "Default");
+
+    zebra_init(zh);
+
+    zebra_begin_trans(zh, 1);
+    sprintf(path, "%.200s/mail1.mbx", get_srcdir());
+    zebra_repository_update(zh, path);
+
+    sprintf(path, "%.200s/mail3.mbx", get_srcdir());
+    zebra_repository_update(zh, path);
+
+#if 0
+    /* bug #234 */
+    sprintf(path, "%.200s/invalid.mbx", get_srcdir());
+    zebra_repository_update(zh, path);
+#endif
+
+    zebra_end_trans(zh);
+    zebra_commit(zh);
+
+    return close_down(zh, zs, 0);
+}
diff --git a/test/mbox/onemail b/test/mbox/onemail
deleted file mode 100644 (file)
index 80acb7f..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-From marc@indexdata.dk Thu Dec 02 09:57:42 2004
-Return-path: <marc@indexdata.dk>
-Envelope-to: heikki@indexdata.dk
-Delivery-date: Thu, 02 Dec 2004 09:57:42 +0100
-Received: from user.indexdata.dk ([213.150.43.10] helo=[10.0.1.66])
-       by bagel.indexdata.dk with esmtp (Exim 3.35 #1 (Debian))
-       id 1CZmmS-0006ZW-00; Thu, 02 Dec 2004 09:57:40 +0100
-Message-ID: <41AED904.3000500@indexdata.dk>
-Date: Thu, 02 Dec 2004 09:57:40 +0100
-From: Marc Cromme <marc@indexdata.dk>
-Reply-To:  marc@indexdata.dk
-Organization: Index Data
-User-Agent: Mozilla Thunderbird 0.8 (X11/20040926)
-X-Accept-Language: en-us, en
-MIME-Version: 1.0
-To: Adam Dickmeiss <adam@indexdata.dk>, 
- Heikki Levanto <heikki@indexdata.dk>,
- Sebastian Hammer <quinn@indexdata.dk>
-Subject: [Fwd: [Zebralist] Indexing multiple xml elements as a phrase]
-Content-Type: multipart/mixed;
- boundary="------------020203040804000501020404"
-X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on bagel.indexdata.dk
-X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,BAYES_00 autolearn=ham 
-       version=3.0.0
-X-Spam-Level: 
-Status: RO
-Content-Length: 4755
-Lines: 135
-
-This is a multi-part message in MIME format.
---------------020203040804000501020404
-Content-Type: text/plain; charset=UTF-8; format=flowed
-Content-Transfer-Encoding: 8bit
-
-Hi folks - denne her er ikke blevet besvaret på zebra listen, og jeg kan 
-ikke svare på den. Kan en af jer ??
-
-Marc
-
--- 
-
-Marc Cromme, cand. polyt, Ph.D
-Senior Developer, Project Manager
-
-Index Data Aps
-Købmagergade 43, 2 
-1150 Copenhagen K.
-Denmark
-
-tel: +45 3341 1000
-fax: +45 3341 0101
-
-http://www.indexdata.com
-
-INDEX DATA Means Business
-for Open Source and Open Standards
-
-
-
diff --git a/test/mbox/test1.sh b/test/mbox/test1.sh
deleted file mode 100755 (executable)
index 201e4ef..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# test 1 
-pp=${srcdir:-"."}
-
-../../index/zebraidx -c ${pp}/zebra.cfg init
-../../index/zebraidx -c ${pp}/zebra.cfg update onemail
-
diff --git a/test/mbox/test2.sh b/test/mbox/test2.sh
deleted file mode 100755 (executable)
index 30733e1..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# test 2 
-
-../../index/zebraidx init
-../../index/zebraidx update vm2
-
diff --git a/test/mbox/vm b/test/mbox/vm
deleted file mode 100644 (file)
index 03765f4..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-Li
-
index ca28e8d..175f674 100644 (file)
@@ -1,11 +1,11 @@
 # Zebra configuration file
-# $Id: zebra.cfg,v 1.1 2004-12-07 15:45:13 heikki Exp $
+# $Id: zebra.cfg,v 1.2 2005-04-28 09:18:20 adam Exp $
 #
 
 #profilePath: .:/usr/share/idzebra/tab
 profilepath: .:${srcdir:-.}/../../tab
 
-recordType.: grs.regx.email2
+recordType.mbx: grs.regx.email2
 database: mail