Commit dd08262c dd08262c4c55b984e9b38a3dc4a330960d01e26f by Sergey Poznyakoff

Add a test suite for folder delete method.

* testsuite/Makefile.am: Add new test cases.
* testsuite/testsuite.at: Inclide fldel.at, add banners.
* testsuite/atlocal.in: Define MH_SUPPORT and MAILDIR_SUPPORT
variables depending on whether the corresponding mailbox format
is enabled.
* testsuite/fldel.at: New test case.
* testsuite/mbdel.at: Skip tests which rely on disabled mailbox
formats.
1 parent 33a5d852
......@@ -79,6 +79,7 @@ smtpsend_LDADD = \
## ------------ ##
TESTSUITE_AT = \
fldel.at\
lstuid00.at\
lstuid01.at\
lstuid02.at\
......
......@@ -3,3 +3,5 @@
# Copyright (C) 2004, 2010, 2011 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/libtests:$top_srcdir:$srcdir:$PATH
@MU_COND_SUPPORT_MH_TRUE@MH_SUPPORT=yes
@MU_COND_SUPPORT_MAILDIR_TRUE@MAILDIR_SUPPORT=yes
......
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2010, 2011 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.
#
# GNU Mailutils 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/>.
dnl ------------------------------------------------------------
dnl FLDEL_TEST([FORMAT], [PROG],
dnl [CODE], [STDOUT = `'], [STDERR = `'],
dnl [RUN-IF-FAIL], [RUN-IF-PASS])
m4_pushdef([FLDEL_TEST],[
AT_SETUP([Folder deletion: $1])
AT_KEYWORDS([folder fldel fldel-$1])
AT_CHECK([$2],[$3],[$4],[$5],[$6],[$7],[$8])
AT_CLEANUP
])
dnl ------------------------------------------------------------
FLDEL_TEST([mbox],
[mkdir dir
MUT_MBCOPY($abs_top_srcdir/testsuite/spool/mbox1, dir/mbox1)
fldel mbox:dir mbox1 || exit 2
test -f dir/mbox1
],
[1])
FLDEL_TEST([mh],
[test "$MH_SUPPORT" = yes || AT_SKIP_TEST
mkdir dir
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1, dir/mbox1)
fldel mh:dir mbox1 || exit 2
test -d dir/mbox1
],
[1])
FLDEL_TEST([maildir],
[test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST
mkdir dir
MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1, dir/mbox1)
fldel maildir:dir mbox1 || exit 2
test -d dir/mbox1
],
[1])
FLDEL_TEST([mh with subdirs],
[test "$MH_SUPPORT" = yes || AT_SKIP_TEST
mkdir dir
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1, dir/mbox1)
mkdir dir/mbox1/subfolder
fldel mh:dir mbox1 || exit 2
test -d dir/mbox1 && find dir/mbox1
],
[0],
[mailbox removed, but has subfolders
dir/mbox1
dir/mbox1/subfolder
])
FLDEL_TEST([maildir with subdirs],
[test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST
mkdir dir
MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1, dir/mbox1)
mkdir dir/mbox1/subfolder
fldel maildir:dir mbox1 || exit 2
test -d dir/mbox1 && find dir/mbox1
],
[0],
[mailbox removed, but has subfolders
dir/mbox1
dir/mbox1/subfolder
])
......@@ -18,7 +18,7 @@ dnl ------------------------------------------------------------
dnl MBDEL_TEST([FORMAT], [PROG],
dnl [CODE], [STDOUT = `'], [STDERR = `'],
dnl [RUN-IF-FAIL], [RUN-IF-PASS])
m4_define([MBDEL_TEST],[
m4_pushdef([MBDEL_TEST],[
AT_SETUP([Mailbox deletion: $1])
AT_KEYWORDS([mailbox mbdel mbdel-$1])
AT_CHECK([$2],[$3],[$4],[$5],[$6],[$7],[$8])
......@@ -34,21 +34,24 @@ test -f mbox1
[1])
MBDEL_TEST([mh],
[MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1)
[test "$MH_SUPPORT" = yes || AT_SKIP_TEST
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1)
mbdel mh:mbox1 || exit 2
test -d mbox1
],
[1])
MBDEL_TEST([maildir],
[MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1)
[test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST
MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1)
mbdel maildir:mbox1 || exit 2
test -d mbox1
],
[1])
MBDEL_TEST([mh with subdirs],
[MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1)
[test "$MH_SUPPORT" = yes || AT_SKIP_TEST
MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1)
mkdir mbox1/subfolder
mbdel mh:mbox1 || exit 2
test -d mbox1 && find mbox1
......@@ -60,7 +63,8 @@ mbox1/subfolder
])
MBDEL_TEST([maildir with subdirs],
[MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1)
[test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST
MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1)
mkdir mbox1/subfolder
mbdel maildir:mbox1 || exit 2
test -d mbox1 && find mbox1
......@@ -70,3 +74,5 @@ test -d mbox1 && find mbox1
mbox1
mbox1/subfolder
])
m4_popdef([MBDEL_TEST])
......
......@@ -18,9 +18,19 @@ m4_include([testsuite.inc])
AT_INIT
AT_BANNER(UIDs)
m4_include([lstuid00.at])
m4_include([lstuid01.at])
m4_include([lstuid02.at])
AT_BANNER(mimetest)
m4_include([mime.at])
AT_BANNER(Mailbox removal)
m4_include([mbdel.at])
AT_BANNER(Folder mailbox removal)
m4_include([fldel.at])
AT_BANNER(Various)
m4_include([ufms.at])
......