Commit 20300ee4 20300ee417e027c1f2157a2e733982144ed35833 by Sergey Poznyakoff

Further improvement of the testsuite + some bugfixes.

That's the first commit since the merge six days ago that passes
distcheck (with python, cxx, imap and nntp disabled, of course).

* testsuite/folder/DISTFILES: Restore. It is needed for some
of the remaining DejaGNU tests.
* testsuite/spool/DISTFILES: Likewise.
* testsuite/testsuite.at: New file.
* testsuite/atlocal.in: New file.
* libmailutils/tests/mbdel.at: Move to testsuite/.
* libmailutils/tests/mbdel.c: Likewise.
* libmailutils/tests/mime.at: Likewise.
* libmailutils/tests/mimetest.c: Likewise.

* Makefile.am (SUBDIRS): Place testsuite after libproto.
* configure.ac (AM_INIT_AUTOMAKE): Remove dist-lzma.
(AC_CONFIG_FILES): Add testsuite/atlocal.
* libmailutils/base64.c (_base64_decoder)
(_base64_encoder): Fix the use of uninitialized variables.
* libmailutils/tests/.gitignore: Remove mbdel and mimetest.
* libmailutils/tests/Makefile.am (noinst_PROGRAMS): Remove mbdel and mimetest.
(LDADD): Leave only MU_LIB_MAILUTILS.
(TESTSUITE_AT): Remove mbdel.at and mime.at
* libmailutils/tests/atlocal.in (PATH): Bugfix.
* libmailutils/tests/testsuite.at: Remove inclusion of mbdel.at and mime.at.
* po/POTFILES.in: Replace mailbox/ with libmailutils/.

* testsuite/.gitignore: Rewrite.
* testsuite/Makefile.am: Rewrite.
* testsuite/mbdel.at: Set +w on all copied mailboxes.
* testsuite/mimetest.c (main): Open mailbox for reading only.

* sieve/Makefile.am: Add examples/ to the distribution.

* libproto/mbox/mbox.c (mbox_open): Create locker only
if the mailbox is open for modification.
All users updated to check for mailbox->locker!=NULL before
using it.
1 parent 08762799
......@@ -93,11 +93,11 @@ SUBDIRS = . \
mu-aux\
include\
po\
testsuite\
libmailutils\
sql\
libmu_auth\
libproto\
testsuite\
lib\
libmu_argp\
libmu_cfg\
......@@ -126,7 +126,7 @@ SUBDIRS = . \
EXTRA_DIST = COPYING.LESSER paths git-describe git-describe.h
BUILT_SOURCES = git-describe git-describe.h
DISTCLEANFILES = pathdefs.h
DISTCLEANFILES = pathdefs.h git-describe.h
gen_start_date = "2008-12-08"
prev_change_log = "doc/ChangeLog.CVS"
......
......@@ -21,7 +21,7 @@ AC_PREREQ(2.63)
AC_INIT([GNU Mailutils], [2.2.90], [bug-mailutils@gnu.org], [mailutils])
AC_CONFIG_SRCDIR([libmailutils/mailbox.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 dist-lzma dist-xz std-options silent-rules])
AM_INIT_AUTOMAKE([gnits 1.11 dist-bzip2 dist-xz std-options silent-rules])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
......@@ -1210,9 +1210,17 @@ AC_ARG_WITH([mh-bindir],
# Initialize the (autotest) test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_TESTDIR(libmailutils/tests)
AC_CONFIG_TESTDIR(testsuite)
AC_CONFIG_TESTDIR(frm/tests)
AC_CONFIG_TESTDIR(messages/tests)
AC_CONFIG_TESTDIR(readmsg/tests)
AC_CONFIG_TESTDIR(sieve/tests)
AC_CONFIG_FILES([libmailutils/tests/Makefile
libmailutils/tests/atlocal
libmailutils/tests/atlocal
testsuite/Makefile
testsuite/atlocal
frm/tests/Makefile
frm/tests/atlocal
messages/tests/Makefile
......@@ -1380,7 +1388,6 @@ AC_CONFIG_FILES([
mu-aux/Makefile
mu-aux/mailutils.spec
sieve/Makefile
testsuite/Makefile
])
AC_OUTPUT
......
......@@ -3,12 +3,4 @@
# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/frm:$top_srcdir:$srcdir:$PATH
top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
initspool() {
test -d data || mkdir data
test -d data/spool || mkdir data/spool
cp $top_srcdir/testsuite/spool/* data/spool
}
\ No newline at end of file
......
......@@ -33,7 +33,7 @@ m4_define([FRMTEST],[
AT_SETUP([$1])
AT_KEYWORDS([$2])
AT_CHECK([
MAIL=$top_srcdir/testsuite/spool/FRM_MAILBOX
MAIL=$abs_top_srcdir/testsuite/spool/FRM_MAILBOX
FOLDER=$MAIL
export MAIL FOLDER
frm FRM_OPTIONS $3],
......@@ -89,7 +89,7 @@ FRMTEST([frm -q],[frm-q frm04],
])
FRMTEST([frm +mbox],[frm+mbox frm05],
[--set ":mailbox:folder=$top_srcdir/testsuite/spool" +mbox],
[--set ":mailbox:folder=$abs_top_srcdir/testsuite/spool" +mbox],
[1],
[Sergey Poznyakoff MBOX
])
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 2009 Free Software Foundation, Inc.
Copyright (C) 2009, 2010 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
......
......@@ -128,7 +128,7 @@ _base64_decoder (void *xd MU_ARG_UNUSED,
break;
}
if (osize <= 3)
if (iobuf->osize <= 3)
{
iobuf->osize = 3;
return mu_filter_moreoutput;
......@@ -207,7 +207,7 @@ _base64_encoder (void *xd MU_ARG_UNUSED,
return mu_filter_moreinput;
}
}
if (osize < 4)
if (iobuf->osize < 4)
{
iobuf->osize = 4;
return mu_filter_moreoutput;
......
......@@ -11,6 +11,4 @@ encode2047
fltst
listop
mailcap
mbdel
mimetest
url-parse
......
# This file is part of GNU Mailutils.
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
......@@ -47,22 +47,9 @@ noinst_PROGRAMS = \
fltst\
listop\
mailcap\
mbdel\
mimetest\
url-parse
LDADD =\
../../lib/libmuaux.la\
${MU_LIB_MBOX}\
${MU_LIB_IMAP}\
${MU_LIB_POP}\
${MU_LIB_NNTP}\
${MU_LIB_MH}\
${MU_LIB_MAILDIR}\
${MU_LIB_MAILER}\
${MU_LIB_AUTH}\
@MU_AUTHLIBS@\
${MU_LIB_MAILUTILS}
LDADD = ${MU_LIB_MAILUTILS}
EXTRA_DIST += Encode Decode
......@@ -79,8 +66,6 @@ TESTSUITE_AT = \
encode2047.at\
list.at\
mailcap.at\
mbdel.at\
mime.at\
testsuite.at\
url.at
......
......@@ -2,8 +2,4 @@
# Configurable variable values for Mailutils test suite.
# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/frm:$top_srcdir:$srcdir:$PATH
top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
abs_builddir=@abs_builddir@
\ No newline at end of file
PATH=@abs_builddir@:@abs_top_builddir@/libmailutils/tests:$top_srcdir:$srcdir:$PATH
......
......@@ -19,8 +19,8 @@ AT_SETUP([base64 decoding (read)])
AT_KEYWORDS([base64 base64d base64dr decode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Encode expout
fltst base64 decode read linelen=0 < $top_srcdir/libmailutils/tests/Decode],
cp $abs_top_srcdir/libmailutils/tests/Encode expout
fltst base64 decode read linelen=0 < $abs_top_srcdir/libmailutils/tests/Decode],
[0],
[expout])
......@@ -31,8 +31,8 @@ AT_SETUP([base64 decoding (write)])
AT_KEYWORDS([base64 base64d base64dw decode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Encode expout
fltst base64 decode write linelen=0 < $top_srcdir/libmailutils/tests/Decode],
cp $abs_top_srcdir/libmailutils/tests/Encode expout
fltst base64 decode write linelen=0 < $abs_top_srcdir/libmailutils/tests/Decode],
[0],
[expout])
......
......@@ -19,8 +19,8 @@ AT_SETUP([base64 encoding (read)])
AT_KEYWORDS([base64 base64e base64er encode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Decode expout
fltst base64 encode read nl < $top_srcdir/libmailutils/tests/Encode],
cp $abs_top_srcdir/libmailutils/tests/Decode expout
fltst base64 encode read nl < $abs_top_srcdir/libmailutils/tests/Encode],
[0],
[expout])
......@@ -31,9 +31,9 @@ AT_SETUP([base64 encoding (write)])
AT_KEYWORDS([base64 base64e base64ew encode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Decode expout
fltst base64 encode write nl < $top_srcdir/libmailutils/tests/Encode],
cp $abs_top_srcdir/libmailutils/tests/Decode expout
fltst base64 encode write nl < $abs_top_srcdir/libmailutils/tests/Encode],
[0],
[expout])
AT_CLEANUP
\ No newline at end of file
AT_CLEANUP
......
......@@ -64,5 +64,3 @@ m4_include([base64d.at])
m4_include([decode2047.at])
m4_include([encode2047.at])
m4_include([mime.at])
m4_include([mbdel.at])
\ No newline at end of file
......
......@@ -120,7 +120,8 @@ mbox_open (mu_mailbox_t mailbox, int flags)
MU_DEBUG2 (mailbox->debug, MU_DEBUG_TRACE1, "mbox_open (%s, 0x%x)\n",
mud->name, mailbox->flags);
if (mailbox->locker == NULL)
if (mailbox->locker == NULL &&
(flags & (MU_STREAM_WRITE | MU_STREAM_APPEND | MU_STREAM_CREAT)))
status = mu_locker_create (&mailbox->locker, mud->name, 0);
return status;
}
......@@ -1117,7 +1118,8 @@ mbox_append_message (mu_mailbox_t mailbox, mu_message_t msg)
MU_DEBUG1 (mailbox->debug, MU_DEBUG_TRACE1, "mbox_append_message (%s)\n",
mud->name);
if ((status = mu_locker_lock (mailbox->locker)) != 0)
if (mailbox->locker &&
(status = mu_locker_lock (mailbox->locker)) != 0)
{
MU_DEBUG1 (mailbox->debug, MU_DEBUG_TRACE1,
"mbox_append_message: %s\n", mu_strerror(status));
......@@ -1128,7 +1130,8 @@ mbox_append_message (mu_mailbox_t mailbox, mu_message_t msg)
if (status)
return status;
status = append_message_to_stream (mailbox->stream, msg, mud, 0);
mu_locker_unlock (mailbox->locker);
if (mailbox->locker)
mu_locker_unlock (mailbox->locker);
if (status)
{
......@@ -1406,7 +1409,8 @@ mbox_expunge0 (mu_mailbox_t mailbox, int remove_deleted)
return 0; /* Nothing changed. */
/* Lock the mailbox */
if ((status = mu_locker_lock (mailbox->locker)) != 0)
if (mailbox->locker &&
(status = mu_locker_lock (mailbox->locker)) != 0)
return status;
status = mu_temp_file_stream_create (&tempstr, NULL);
......@@ -1442,7 +1446,8 @@ mbox_expunge0 (mu_mailbox_t mailbox, int remove_deleted)
mbox_reset (mailbox, dirty, remove_deleted);
}
}
mu_locker_unlock (mailbox->locker);
if (mailbox->locker)
mu_locker_unlock (mailbox->locker);
return status;
}
......
......@@ -209,7 +209,8 @@ do \
} \
if (bailing != 0) \
{ \
mu_locker_unlock (mbox->locker); \
if (mailbox->locker) \
mu_locker_unlock (mbox->locker); \
return EINTR; \
} \
mu_monitor_wrlock (mbox->monitor); \
......@@ -232,8 +233,9 @@ do \
MU_EVT_MAILBOX_PROGRESS, NULL); \
if (bailing != 0) \
{ \
mu_locker_unlock (mbox->locker); \
return EINTR; \
if (mailbox->locker) \
mu_locker_unlock (mbox->locker); \
return EINTR; \
} \
mud->messages_count++; \
mu_monitor_wrlock (mbox->monitor); \
......@@ -251,7 +253,8 @@ do \
m = realloc ((mud)->umessages, num * sizeof (*m)); \
if (m == NULL) \
{ \
mu_locker_unlock (mbox->locker); \
if (mailbox->locker) \
mu_locker_unlock (mbox->locker); \
mu_monitor_unlock (mbox->monitor); \
return ENOMEM; \
} \
......@@ -259,7 +262,8 @@ do \
(mud)->umessages[num - 1] = calloc (1, sizeof (*(mum))); \
if ((mud)->umessages[num - 1] == NULL) \
{ \
mu_locker_unlock (mbox->locker); \
if (mailbox->locker) \
mu_locker_unlock (mbox->locker); \
mu_monitor_unlock (mbox->monitor); \
return ENOMEM; \
} \
......@@ -391,7 +395,7 @@ mbox_scan_internal (mu_mailbox_t mailbox, mbox_message_t mum,
newline = (inbody && lines) ? nl : 0;
/* Every 100 mesgs update the lock, it should be every minute. */
if ((mud->messages_count % 100) == 0)
if (mailbox->locker && (mud->messages_count % 100) == 0)
mu_locker_touchlock (mailbox->locker);
/* Ping them every 1000 lines. Should be tunable. */
......@@ -454,7 +458,8 @@ mbox_scan0 (mu_mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notif)
return status;
}
if ((status = mu_locker_lock (mailbox->locker)))
if (mailbox->locker &&
(status = mu_locker_lock (mailbox->locker)))
{
mu_monitor_unlock (mailbox->monitor);
return status;
......@@ -477,7 +482,8 @@ mbox_scan0 (mu_mailbox_t mailbox, size_t msgno, size_t *pcount, int do_notif)
if (pcount)
*pcount = mud->messages_count;
mu_locker_unlock (mailbox->locker);
if (mailbox->locker)
mu_locker_unlock (mailbox->locker);
mu_monitor_unlock (mailbox->monitor);
/* Reset the uidvalidity. */
......@@ -525,7 +531,8 @@ mbox_scan1 (mu_mailbox_t mailbox, mu_off_t offset, int do_notif)
pthread_cleanup_push (mbox_cleanup, (void *)mailbox);
#endif
if ((status = mu_locker_lock (mailbox->locker)))
if (mailbox->locker &&
(status = mu_locker_lock (mailbox->locker)))
{
mu_monitor_unlock (mailbox->monitor);
return status;
......@@ -535,7 +542,8 @@ mbox_scan1 (mu_mailbox_t mailbox, mu_off_t offset, int do_notif)
if (status)
{
mu_monitor_unlock (mailbox->monitor);
mu_locker_unlock (mailbox->locker);
if (mailbox->locker)
mu_locker_unlock (mailbox->locker);
return status;
}
......@@ -543,7 +551,8 @@ mbox_scan1 (mu_mailbox_t mailbox, mu_off_t offset, int do_notif)
MBOX_SCAN_ONEMSG |
(do_notif ? MBOX_SCAN_NOTIFY : 0));
mu_locker_unlock (mailbox->locker);
if (mailbox->locker)
mu_locker_unlock (mailbox->locker);
mu_monitor_unlock (mailbox->monitor);
#ifdef WITH_PTHREAD
......
......@@ -3,7 +3,4 @@
# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/messages:$top_srcdir:$srcdir:$PATH
top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
\ No newline at end of file
......
......@@ -33,7 +33,7 @@ m4_define([MSGTEST],[
AT_SETUP([$1])
AT_KEYWORDS([messages $2])
AT_CHECK([
MAIL=$top_srcdir/testsuite/spool/MSG_MAILBOX
MAIL=$abs_top_srcdir/testsuite/spool/MSG_MAILBOX
FOLDER=$MAIL
export MAIL FOLDER
messages MSG_OPTIONS $3 | sed 's|in /.*/|in |'],
......@@ -59,7 +59,7 @@ MSGTEST([messages -q],[messages01 messages-q],
])
MSGTEST([messages 2],[messages02],
[--set ":mailbox:folder=$top_srcdir/testsuite/spool" +teaparty.mbox],
[--set ":mailbox:folder=$abs_top_srcdir/testsuite/spool" +teaparty.mbox],
[0],
[Number of messages in teaparty.mbox: 95
])
......
......@@ -123,25 +123,25 @@ mail/unalias.c
mail/util.c
mail/z.c
mailbox/cfg_driver.c
mailbox/cfg_format.c
mailbox/cfg_lexer.l
mailbox/cfg_parser.y
mailbox/debug.c
mailbox/diag.c
mailbox/errors
mailbox/file_stream.c
mailbox/filter_iconv.c
mailbox/gdebug.c
mailbox/gocs.c
mailbox/ipsrv.c
mailbox/message.c
mailbox/msrv.c
mailbox/mu_auth.c
mailbox/mutil.c
mailbox/parsedate.y
mailbox/registrar.c
mailbox/version.c
libmailutils/cfg_driver.c
libmailutils/cfg_format.c
libmailutils/cfg_lexer.l
libmailutils/cfg_parser.y
libmailutils/debug.c
libmailutils/diag.c
libmailutils/errors
libmailutils/file_stream.c
libmailutils/filter_iconv.c
libmailutils/gdebug.c
libmailutils/gocs.c
libmailutils/ipsrv.c
libmailutils/message.c
libmailutils/msrv.c
libmailutils/mu_auth.c
libmailutils/mutil.c
libmailutils/parsedate.y
libmailutils/registrar.c
libmailutils/version.c
messages/messages.c
......
......@@ -3,5 +3,3 @@
# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/readmsg:$top_srcdir:$srcdir:$PATH
top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
......
......@@ -34,7 +34,7 @@ m4_define([READMSGTEST],[
AT_SETUP([$1])
AT_KEYWORDS([$2])
AT_CHECK([
MAIL=$top_srcdir/testsuite/spool/READMSG_MAILBOX
MAIL=$abs_top_srcdir/testsuite/spool/READMSG_MAILBOX
FOLDER=$MAIL
export MAIL FOLDER
readmsg READMSG_OPTIONS $3],
......
......@@ -19,6 +19,7 @@
INCLUDES = @MU_APP_COMMON_INCLUDES@
SUBDIRS = tests
EXTRA_DIST = examples
bin_PROGRAMS = sieve
sieve_SOURCES = sieve.c
......
......@@ -3,12 +3,3 @@
# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/sieve:$top_srcdir:$srcdir:$PATH
top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
initspool() {
test -d data || mkdir data
test -d data/spool || mkdir data/spool
cp $top_srcdir/testsuite/spool/* data/spool
}
\ No newline at end of file
......
......@@ -30,10 +30,11 @@ if numaddr [[ "to", "cc" ]] :over 5
}
])
cp $top_srcdir/testsuite/spool/bigto.mbox .
cp $abs_top_srcdir/testsuite/spool/bigto.mbox .
chmod +w bigto.mbox
sieve MUT_SIEVE_CMDLINE dnl
--clearpath -L "${top_builddir}/examples" -f ./bigto.mbox prog
--clearpath -L "${abs_top_builddir}/examples" -f ./bigto.mbox prog
],
[0],
[],
......
......@@ -29,7 +29,8 @@ require "redirect";
redirect "gray@gnu.org";
])
cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
cp $abs_top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
chmod +w MUT_SIEVE_MAILBOX
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
sed 's/ $//' ./mta.diag
......
......@@ -46,7 +46,8 @@ s/^\( *[[0-9]][[0-9]]*: The original message was received at *\).*\( from .*\)/\
s/^\( *[[0-9]][[0-9]]*: Last-Attempt-Date:\).*/\1 (date)/
])
cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
cp $abs_top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
chmod +w MUT_SIEVE_MAILBOX
sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f ./MUT_SIEVE_MAILBOX prog || exit 1
sed -f filter.sed ./mta.diag
......
......@@ -22,7 +22,7 @@ dnl testcompile(SCRIPT) -- test compilation of the Sieve SCRIPT
dnl
m4_define([testcompile],[
AT_SETUP([compile $1])
AT_CHECK([sieve -c $top_srcdir/sieve/examples/$1],
AT_CHECK([sieve -c $abs_top_srcdir/sieve/examples/$1],
[0])
AT_CLEANUP
])
......@@ -42,7 +42,7 @@ m4_define([MUT_SIEVE_CMDLINE],[dnl
--no-program-name dnl
--no-site-config dnl
--no-user-config dnl
-M sendmail:$top_builddir/examples/mta dnl
-M sendmail:$abs_top_builddir/examples/mta dnl
--email foobar@nonexistent.net])
dnl ------------------------------------------------------------
......@@ -70,7 +70,9 @@ AT_CHECK([sieve MUT_SIEVE_CMDLINE MUT_SIEVE_OPTIONS -f $2 prog
m4_define([MUT_TESTCASE],[
AT_SETUP([$1])
AT_KEYWORDS([$2])
cp $top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
cp $abs_top_srcdir/testsuite/spool/MUT_SIEVE_MAILBOX .
chmod +w MUT_SIEVE_MAILBOX
MUT_SIEVE_RUN([$3], ./MUT_SIEVE_MAILBOX, m4_shift(m4_shift(m4_shift($@))))
AT_CLEANUP])
......
Makefile
Makefile.in
atconfig
atlocal
package.m4
testsuite
testsuite.dir
testsuite.log
mbdel
mimetest
......
## Process this file with GNU Automake to create Makefile.in
## Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
##
## GNU Mailutils 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 3, or (at
## your option) any later version.
##
## This program 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 this program; if not, write to the Free Software
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
EXTRA_DIST = lib etc spool folder maildir mh
# This file is part of GNU Mailutils.
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# GNU Mailutils 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 3, or (at
# your option) any later version.
#
# This program 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 GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 lib etc spool folder maildir mh
DISTCLEANFILES = atconfig $(check_SCRIPTS)
MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
## ------------ ##
## package.m4. ##
## ------------ ##
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
$(AM_V_GEN){ \
echo '# Signature of the current package.'; \
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
} >$(srcdir)/package.m4
#
## -------------------------- ##
## Non-installable programs
## -------------------------- ##
INCLUDES = @MU_LIB_COMMON_INCLUDES@
noinst_PROGRAMS = \
mbdel\
mimetest
LDADD = \
${MU_LIB_MBOX}\
${MU_LIB_IMAP}\
${MU_LIB_POP}\
${MU_LIB_NNTP}\
${MU_LIB_MH}\
${MU_LIB_MAILDIR}\
${MU_LIB_MAILER}\
${MU_LIB_AUTH}\
@MU_AUTHLIBS@\
${MU_LIB_MAILUTILS}
## ------------ ##
## Test suite. ##
## ------------ ##
TESTSUITE_AT = \
mbdel.at\
mime.at\
testsuite.at
TESTSUITE = $(srcdir)/testsuite
M4=m4
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): package.m4 $(TESTSUITE_AT)
$(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp
$(AM_V_at)mv $@.tmp $@
atconfig: $(top_builddir)/config.status
cd $(top_builddir) && ./config.status tests/$@
clean-local:
@test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
check-local: atconfig atlocal $(TESTSUITE)
@$(SHELL) $(TESTSUITE)
# Run the test suite on the *installed* tree.
#installcheck-local:
# $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
......
# @configure_input@ -*- shell-script -*-
# Configurable variable values for Mailutils test suite.
# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/libtests:$top_srcdir:$srcdir:$PATH
......@@ -28,28 +28,32 @@ AT_CLEANUP
dnl ------------------------------------------------------------
MBDEL_TEST([mbox],
[cp $top_srcdir/testsuite/spool/mbox1 .
[cp $abs_top_srcdir/testsuite/spool/mbox1 .
chmod +w mbox1
mbdel mbox:mbox1 || exit 2
test -f mbox1
],
[1])
MBDEL_TEST([mh],
[cp -r $top_srcdir/testsuite/mh/mbox1 .
[cp -r $abs_top_srcdir/testsuite/mh/mbox1 .
chmod -R +w mbox1
mbdel mh:mbox1 || exit 2
test -d mbox1
],
[1])
MBDEL_TEST([maildir],
[cp -r $top_srcdir/testsuite/maildir/mbox1 .
[cp -r $abs_top_srcdir/testsuite/maildir/mbox1 .
chmod -R +w mbox1
mbdel maildir:mbox1 || exit 2
test -d mbox1
],
[1])
MBDEL_TEST([mh with subdirs],
[cp -r $top_srcdir/testsuite/mh/mbox1 .
[cp -r $abs_top_srcdir/testsuite/mh/mbox1 .
chmod -R +w mbox1
mkdir mbox1/subfolder
mbdel mh:mbox1 || exit 2
test -d mbox1 && find mbox1
......@@ -61,7 +65,8 @@ mbox1/subfolder
])
MBDEL_TEST([maildir with subdirs],
[cp -r $top_srcdir/testsuite/maildir/mbox1 .
[cp -r $abs_top_srcdir/testsuite/maildir/mbox1 .
chmod -R +w mbox1
mkdir mbox1/subfolder
mbdel maildir:mbox1 || exit 2
test -d mbox1 && find mbox1
......
......@@ -19,7 +19,7 @@ AT_SETUP([mime])
# FIXME: Mimetest should probably be fixed to avoid the use of `tr'
# and `sed' here.
AT_CHECK([mimetest -i 0 -p $top_srcdir/testsuite/spool/mbox1 | dnl
AT_CHECK([mimetest -i 0 -p $abs_top_srcdir/testsuite/spool/mbox1 | dnl
tr '\t' ' ' | sed 's/ *$//'],
[0],
[Message: 1
......@@ -217,4 +217,4 @@ Begin
End
])
AT_CLEANUP
\ No newline at end of file
AT_CLEANUP
......
......@@ -113,7 +113,7 @@ main (int argc, char **argv)
}
/* Open the mailbox for reading only. */
MU_ASSERT (mu_mailbox_open (mbox, MU_STREAM_RDWR));
MU_ASSERT (mu_mailbox_open (mbox, MU_STREAM_READ));
/* Iterate through the entire message set. */
MU_ASSERT (mu_mailbox_messages_count (mbox, &count));
......
bigto.mbox
mbox1
mbox
sieve.mbox
relational.mbox
teaparty.mbox
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2010 Free Software Foundation, Inc.
#
# GNU Mailutils 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 3, or (at
# your option) any later version.
#
# This program 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 GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
m4_include([testsuite.inc])
AT_INIT
m4_include([mime.at])
m4_include([mbdel.at])
\ No newline at end of file