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.
Showing
5 changed files
with
105 additions
and
5 deletions
... | @@ -3,3 +3,5 @@ | ... | @@ -3,3 +3,5 @@ |
3 | # Copyright (C) 2004, 2010, 2011 Free Software Foundation, Inc. | 3 | # Copyright (C) 2004, 2010, 2011 Free Software Foundation, Inc. |
4 | 4 | ||
5 | PATH=@abs_builddir@:@abs_top_builddir@/libtests:$top_srcdir:$srcdir:$PATH | 5 | PATH=@abs_builddir@:@abs_top_builddir@/libtests:$top_srcdir:$srcdir:$PATH |
6 | @MU_COND_SUPPORT_MH_TRUE@MH_SUPPORT=yes | ||
7 | @MU_COND_SUPPORT_MAILDIR_TRUE@MAILDIR_SUPPORT=yes | ... | ... |
testsuite/fldel.at
0 → 100644
1 | # This file is part of GNU Mailutils. -*- Autotest -*- | ||
2 | # Copyright (C) 2010, 2011 Free Software Foundation, Inc. | ||
3 | # | ||
4 | # GNU Mailutils is free software; you can redistribute it and/or | ||
5 | # modify it under the terms of the GNU General Public License as | ||
6 | # published by the Free Software Foundation; either version 3, or (at | ||
7 | # your option) any later version. | ||
8 | # | ||
9 | # GNU Mailutils is distributed in the hope that it will be useful, but | ||
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | # General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | dnl ------------------------------------------------------------ | ||
18 | dnl FLDEL_TEST([FORMAT], [PROG], | ||
19 | dnl [CODE], [STDOUT = `'], [STDERR = `'], | ||
20 | dnl [RUN-IF-FAIL], [RUN-IF-PASS]) | ||
21 | m4_pushdef([FLDEL_TEST],[ | ||
22 | AT_SETUP([Folder deletion: $1]) | ||
23 | AT_KEYWORDS([folder fldel fldel-$1]) | ||
24 | AT_CHECK([$2],[$3],[$4],[$5],[$6],[$7],[$8]) | ||
25 | AT_CLEANUP | ||
26 | ]) | ||
27 | |||
28 | dnl ------------------------------------------------------------ | ||
29 | FLDEL_TEST([mbox], | ||
30 | [mkdir dir | ||
31 | MUT_MBCOPY($abs_top_srcdir/testsuite/spool/mbox1, dir/mbox1) | ||
32 | fldel mbox:dir mbox1 || exit 2 | ||
33 | test -f dir/mbox1 | ||
34 | ], | ||
35 | [1]) | ||
36 | |||
37 | FLDEL_TEST([mh], | ||
38 | [test "$MH_SUPPORT" = yes || AT_SKIP_TEST | ||
39 | mkdir dir | ||
40 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1, dir/mbox1) | ||
41 | fldel mh:dir mbox1 || exit 2 | ||
42 | test -d dir/mbox1 | ||
43 | ], | ||
44 | [1]) | ||
45 | |||
46 | FLDEL_TEST([maildir], | ||
47 | [test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST | ||
48 | mkdir dir | ||
49 | MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1, dir/mbox1) | ||
50 | fldel maildir:dir mbox1 || exit 2 | ||
51 | test -d dir/mbox1 | ||
52 | ], | ||
53 | [1]) | ||
54 | |||
55 | FLDEL_TEST([mh with subdirs], | ||
56 | [test "$MH_SUPPORT" = yes || AT_SKIP_TEST | ||
57 | mkdir dir | ||
58 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1, dir/mbox1) | ||
59 | mkdir dir/mbox1/subfolder | ||
60 | fldel mh:dir mbox1 || exit 2 | ||
61 | test -d dir/mbox1 && find dir/mbox1 | ||
62 | ], | ||
63 | [0], | ||
64 | [mailbox removed, but has subfolders | ||
65 | dir/mbox1 | ||
66 | dir/mbox1/subfolder | ||
67 | ]) | ||
68 | |||
69 | FLDEL_TEST([maildir with subdirs], | ||
70 | [test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST | ||
71 | mkdir dir | ||
72 | MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1, dir/mbox1) | ||
73 | mkdir dir/mbox1/subfolder | ||
74 | fldel maildir:dir mbox1 || exit 2 | ||
75 | test -d dir/mbox1 && find dir/mbox1 | ||
76 | ], | ||
77 | [0], | ||
78 | [mailbox removed, but has subfolders | ||
79 | dir/mbox1 | ||
80 | dir/mbox1/subfolder | ||
81 | ]) |
... | @@ -18,7 +18,7 @@ dnl ------------------------------------------------------------ | ... | @@ -18,7 +18,7 @@ dnl ------------------------------------------------------------ |
18 | dnl MBDEL_TEST([FORMAT], [PROG], | 18 | dnl MBDEL_TEST([FORMAT], [PROG], |
19 | dnl [CODE], [STDOUT = `'], [STDERR = `'], | 19 | dnl [CODE], [STDOUT = `'], [STDERR = `'], |
20 | dnl [RUN-IF-FAIL], [RUN-IF-PASS]) | 20 | dnl [RUN-IF-FAIL], [RUN-IF-PASS]) |
21 | m4_define([MBDEL_TEST],[ | 21 | m4_pushdef([MBDEL_TEST],[ |
22 | AT_SETUP([Mailbox deletion: $1]) | 22 | AT_SETUP([Mailbox deletion: $1]) |
23 | AT_KEYWORDS([mailbox mbdel mbdel-$1]) | 23 | AT_KEYWORDS([mailbox mbdel mbdel-$1]) |
24 | AT_CHECK([$2],[$3],[$4],[$5],[$6],[$7],[$8]) | 24 | AT_CHECK([$2],[$3],[$4],[$5],[$6],[$7],[$8]) |
... | @@ -34,21 +34,24 @@ test -f mbox1 | ... | @@ -34,21 +34,24 @@ test -f mbox1 |
34 | [1]) | 34 | [1]) |
35 | 35 | ||
36 | MBDEL_TEST([mh], | 36 | MBDEL_TEST([mh], |
37 | [MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1) | 37 | [test "$MH_SUPPORT" = yes || AT_SKIP_TEST |
38 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1) | ||
38 | mbdel mh:mbox1 || exit 2 | 39 | mbdel mh:mbox1 || exit 2 |
39 | test -d mbox1 | 40 | test -d mbox1 |
40 | ], | 41 | ], |
41 | [1]) | 42 | [1]) |
42 | 43 | ||
43 | MBDEL_TEST([maildir], | 44 | MBDEL_TEST([maildir], |
44 | [MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1) | 45 | [test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST |
46 | MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1) | ||
45 | mbdel maildir:mbox1 || exit 2 | 47 | mbdel maildir:mbox1 || exit 2 |
46 | test -d mbox1 | 48 | test -d mbox1 |
47 | ], | 49 | ], |
48 | [1]) | 50 | [1]) |
49 | 51 | ||
50 | MBDEL_TEST([mh with subdirs], | 52 | MBDEL_TEST([mh with subdirs], |
51 | [MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1) | 53 | [test "$MH_SUPPORT" = yes || AT_SKIP_TEST |
54 | MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1) | ||
52 | mkdir mbox1/subfolder | 55 | mkdir mbox1/subfolder |
53 | mbdel mh:mbox1 || exit 2 | 56 | mbdel mh:mbox1 || exit 2 |
54 | test -d mbox1 && find mbox1 | 57 | test -d mbox1 && find mbox1 |
... | @@ -60,7 +63,8 @@ mbox1/subfolder | ... | @@ -60,7 +63,8 @@ mbox1/subfolder |
60 | ]) | 63 | ]) |
61 | 64 | ||
62 | MBDEL_TEST([maildir with subdirs], | 65 | MBDEL_TEST([maildir with subdirs], |
63 | [MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1) | 66 | [test "$MAILDIR_SUPPORT" = yes || AT_SKIP_TEST |
67 | MUT_MBCOPY($abs_top_srcdir/testsuite/maildir/mbox1) | ||
64 | mkdir mbox1/subfolder | 68 | mkdir mbox1/subfolder |
65 | mbdel maildir:mbox1 || exit 2 | 69 | mbdel maildir:mbox1 || exit 2 |
66 | test -d mbox1 && find mbox1 | 70 | test -d mbox1 && find mbox1 |
... | @@ -70,3 +74,5 @@ test -d mbox1 && find mbox1 | ... | @@ -70,3 +74,5 @@ test -d mbox1 && find mbox1 |
70 | mbox1 | 74 | mbox1 |
71 | mbox1/subfolder | 75 | mbox1/subfolder |
72 | ]) | 76 | ]) |
77 | |||
78 | m4_popdef([MBDEL_TEST]) | ... | ... |
... | @@ -18,9 +18,19 @@ m4_include([testsuite.inc]) | ... | @@ -18,9 +18,19 @@ m4_include([testsuite.inc]) |
18 | 18 | ||
19 | AT_INIT | 19 | AT_INIT |
20 | 20 | ||
21 | AT_BANNER(UIDs) | ||
21 | m4_include([lstuid00.at]) | 22 | m4_include([lstuid00.at]) |
22 | m4_include([lstuid01.at]) | 23 | m4_include([lstuid01.at]) |
23 | m4_include([lstuid02.at]) | 24 | m4_include([lstuid02.at]) |
25 | |||
26 | AT_BANNER(mimetest) | ||
24 | m4_include([mime.at]) | 27 | m4_include([mime.at]) |
28 | |||
29 | AT_BANNER(Mailbox removal) | ||
25 | m4_include([mbdel.at]) | 30 | m4_include([mbdel.at]) |
31 | |||
32 | AT_BANNER(Folder mailbox removal) | ||
33 | m4_include([fldel.at]) | ||
34 | |||
35 | AT_BANNER(Various) | ||
26 | m4_include([ufms.at]) | 36 | m4_include([ufms.at]) | ... | ... |
-
Please register or sign in to post a comment