Commit 548d50fb 548d50fb19cd66dbe153e4d7e879501bab58c0aa by Sergey Poznyakoff

Rewrite libmailutils testsuite in Autotest.

* configure.ac: Create libmailutils/tests/atlocal and
libmailutils/tests/Makefile. Remove libmailutils/testsuite.
* examples/Makefile.am (noinst_PROGRAMS): Remove programs moved
to libmailutils/tests.
* examples/argcv.c -> libmailutils/tests/argcv.c
* libmailutils/testsuite/Decode -> libmailutils/tests/Decode
* libmailutils/testsuite/Encode -> libmailutils/tests/Encode
* examples/decode2047.c: Move to libmailutils/tests
* examples/encode2047.c: Move to libmailutils/tests
* examples/mailcap.c: Likewise.
* examples/url-parse.c: Likewise.

* include/mailutils/Makefile.am: Minor changes.
* libmailutils/Makefile.am (SUBDIRS): Replace testsuite with tests.
* libmailutils/tests/Makefile.am: New file.
* libmailutils/tests/addr.c: New file.
* libmailutils/tests/address.at: New file.
* libmailutils/tests/argcv.at: New file.
* libmailutils/tests/atlocal.in: New file.
* libmailutils/tests/base64d.at: New file.
* libmailutils/tests/base64e.at: New file.
* libmailutils/tests/decode2047.at: New file.
* libmailutils/tests/encode2047.at: New file.
* libmailutils/tests/fltst.c: New file.
* libmailutils/tests/mailcap.at: New file.
* libmailutils/tests/mime.at: New file.
* libmailutils/tests/testsuite.at: New file.
* libmailutils/tests/url.at: New file.

* libmailutils/testsuite/: Delete.

* frm/tests/Makefile.am: Prefix package.m4 creation commands with $(AM_V_GEN).
* readmsg/tests/Makefile.am: Likewise.
* sieve/tests/Makefile.am: Likewise.
* frm/tests/testsuite.at: Minor changes.
* readmsg/tests/testsuite.at: Include testsuite.inc.
* sieve/tests/testsuite.at: Likewise.
* sieve/tests/version.at: Comment out inclusion of testsuite.inc.
* testsuite/testsuite.inc: Add m4_version_prereq.
1 parent 7b79a6ed
Showing 54 changed files with 1038 additions and 2102 deletions
...@@ -1211,7 +1211,9 @@ AC_ARG_WITH([mh-bindir], ...@@ -1211,7 +1211,9 @@ AC_ARG_WITH([mh-bindir],
1211 1211
1212 # Initialize the (autotest) test suite. 1212 # Initialize the (autotest) test suite.
1213 AC_CONFIG_TESTDIR(tests) 1213 AC_CONFIG_TESTDIR(tests)
1214 AC_CONFIG_FILES([frm/tests/Makefile 1214 AC_CONFIG_FILES([libmailutils/tests/Makefile
1215 libmailutils/tests/atlocal
1216 frm/tests/Makefile
1215 frm/tests/atlocal 1217 frm/tests/atlocal
1216 readmsg/tests/Makefile 1218 readmsg/tests/Makefile
1217 readmsg/tests/atlocal 1219 readmsg/tests/atlocal
...@@ -1362,7 +1364,6 @@ AC_CONFIG_FILES([ ...@@ -1362,7 +1364,6 @@ AC_CONFIG_FILES([
1362 mail/Makefile 1364 mail/Makefile
1363 mail/testsuite/Makefile 1365 mail/testsuite/Makefile
1364 libmailutils/Makefile 1366 libmailutils/Makefile
1365 libmailutils/testsuite/Makefile
1366 messages/Makefile 1367 messages/Makefile
1367 messages/testsuite/Makefile 1368 messages/testsuite/Makefile
1368 mh/Makefile 1369 mh/Makefile
......
...@@ -35,18 +35,13 @@ SUBDIRS = config $(CPP_DIR) python scheme ...@@ -35,18 +35,13 @@ SUBDIRS = config $(CPP_DIR) python scheme
35 noinst_PROGRAMS = \ 35 noinst_PROGRAMS = \
36 aclck\ 36 aclck\
37 addr\ 37 addr\
38 argcv\
39 base64\ 38 base64\
40 decode2047\
41 echosrv\ 39 echosrv\
42 encode2047\
43 header\ 40 header\
44 http\ 41 http\
45 iconv\ 42 iconv\
46 listop\ 43 listop\
47 lsf\ 44 lsf\
48 mailcap\
49 mimetest\
50 msg-send\ 45 msg-send\
51 mta\ 46 mta\
52 mucat\ 47 mucat\
...@@ -56,8 +51,7 @@ noinst_PROGRAMS = \ ...@@ -56,8 +51,7 @@ noinst_PROGRAMS = \
56 musocio\ 51 musocio\
57 $(NNTPCLIENT)\ 52 $(NNTPCLIENT)\
58 $(POP3CLIENT)\ 53 $(POP3CLIENT)\
59 sfrom\ 54 sfrom
60 url-parse
61 55
62 EXTRA_PROGRAMS = pop3client nntpclient 56 EXTRA_PROGRAMS = pop3client nntpclient
63 57
...@@ -79,15 +73,6 @@ numaddr_la_SOURCES = numaddr.c ...@@ -79,15 +73,6 @@ numaddr_la_SOURCES = numaddr.c
79 numaddr_la_LIBADD = ${MU_LIB_SIEVE} 73 numaddr_la_LIBADD = ${MU_LIB_SIEVE}
80 numaddr_la_LDFLAGS = -module -avoid-version -no-undefined -rpath '$(moddir)' 74 numaddr_la_LDFLAGS = -module -avoid-version -no-undefined -rpath '$(moddir)'
81 75
82 mimetest_LDADD =\
83 ../lib/libmuaux.la\
84 ${MU_LIB_MBOX}\
85 ${MU_LIB_IMAP}\
86 ${MU_LIB_POP}\
87 ${MU_LIB_AUTH}\
88 @MU_AUTHLIBS@\
89 ${MU_LIB_MAILUTILS}
90
91 msg_send_LDADD =\ 76 msg_send_LDADD =\
92 ../lib/libmuaux.la\ 77 ../lib/libmuaux.la\
93 ${MU_LIB_MAILER}\ 78 ${MU_LIB_MAILER}\
......
...@@ -23,7 +23,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) ...@@ -23,7 +23,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
23 ## ------------ ## 23 ## ------------ ##
24 24
25 $(srcdir)/package.m4: $(top_srcdir)/configure.ac 25 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
26 { \ 26 $(AM_V_GEN){ \
27 echo '# Signature of the current package.'; \ 27 echo '# Signature of the current package.'; \
28 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ 28 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
29 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ 29 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
......
...@@ -15,10 +15,7 @@ ...@@ -15,10 +15,7 @@
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. 15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite. 16 # This file is part of Mailfromd testsuite.
17 17
18 # Require a reasonably recent autotest. 18 m4_include([testsuite.inc])
19 m4_version_prereq([2.52g])
20
21 m4_define([AT_SKIP_TEST],[exit 77])
22 19
23 dnl ------------------------------------------------------------ 20 dnl ------------------------------------------------------------
24 dnl FRM_MAILBOX -- mailbox used for testing 21 dnl FRM_MAILBOX -- mailbox used for testing
...@@ -47,8 +44,6 @@ AT_INIT ...@@ -47,8 +44,6 @@ AT_INIT
47 44
48 AT_TESTED([frm]) 45 AT_TESTED([frm])
49 46
50 m4_include([testsuite.inc])
51
52 MUT_VERSION(frm) 47 MUT_VERSION(frm)
53 48
54 FRMTEST([no options],[frm00], 49 FRMTEST([no options],[frm00],
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 20
21 BUILT_SOURCES=errno.h debug.h 21 BUILT_SOURCES=errno.h debug.h
22 EXTRA_DIST=errno.hin debug.hm4 types.hin 22 EXTRA_DIST=errno.hin debug.hm4 types.hin
23 errno.h: $(top_srcdir)/mailbox/errors errno.hin 23 errno.h: $(top_srcdir)/libmailutils/errors errno.hin
24 $(AM_V_GEN)$(AWK) -f $(mu_aux_dir)/generr.awk $^ > $@ 24 $(AM_V_GEN)$(AWK) -f $(mu_aux_dir)/generr.awk $^ > $@
25 25
26 debug.h: $(mu_aux_dir)/debugdef.m4 debug.hm4 26 debug.h: $(mu_aux_dir)/debugdef.m4 debug.hm4
......
...@@ -24,7 +24,7 @@ YLWRAP = $(SHELL) $(mu_aux_dir)/gylwrap ...@@ -24,7 +24,7 @@ YLWRAP = $(SHELL) $(mu_aux_dir)/gylwrap
24 AM_YFLAGS=-vt 24 AM_YFLAGS=-vt
25 AM_LFLAGS=-dvp 25 AM_LFLAGS=-dvp
26 26
27 SUBDIRS = testsuite 27 SUBDIRS = tests
28 28
29 lib_LTLIBRARIES = libmailutils.la 29 lib_LTLIBRARIES = libmailutils.la
30 30
......
1 # This file is part of GNU Mailutils.
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4
18 DISTCLEANFILES = atconfig $(check_SCRIPTS)
19 MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
20
21 ## ------------ ##
22 ## package.m4. ##
23 ## ------------ ##
24
25 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
26 $(AM_V_GEN){ \
27 echo '# Signature of the current package.'; \
28 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
29 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
30 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
31 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
32 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
33 } >$(srcdir)/package.m4
34
35 #
36
37 ## -------------------------- ##
38 ## Non-installable programs
39 ## -------------------------- ##
40
41 INCLUDES = @MU_LIB_COMMON_INCLUDES@
42 noinst_PROGRAMS = \
43 addr\
44 argcv\
45 decode2047\
46 encode2047\
47 fltst\
48 mailcap\
49 mimetest\
50 url-parse
51
52 LDADD =\
53 ../../lib/libmuaux.la\
54 ${MU_LIB_MBOX}\
55 ${MU_LIB_IMAP}\
56 ${MU_LIB_POP}\
57 ${MU_LIB_AUTH}\
58 @MU_AUTHLIBS@\
59 ${MU_LIB_MAILUTILS}
60
61 EXTRA_DIST += Encode Decode
62
63 ## ------------ ##
64 ## Test suite. ##
65 ## ------------ ##
66
67 TESTSUITE_AT = \
68 address.at\
69 argcv.at\
70 base64d.at\
71 base64e.at\
72 decode2047.at\
73 encode2047.at\
74 mailcap.at\
75 mime.at\
76 testsuite.at\
77 url.at
78
79 TESTSUITE = $(srcdir)/testsuite
80 M4=m4
81
82 AUTOTEST = $(AUTOM4TE) --language=autotest
83 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
84 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp
85 $(AM_V_at)mv $@.tmp $@
86
87 atconfig: $(top_builddir)/config.status
88 cd $(top_builddir) && ./config.status tests/$@
89
90 clean-local:
91 @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
92
93 check-local: atconfig atlocal $(TESTSUITE)
94 @$(SHELL) $(TESTSUITE)
95
96 # Run the test suite on the *installed* tree.
97 #installcheck-local:
98 # $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
99
100
1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2010 Free Software
3 Foundation, Inc.
4
5 GNU Mailutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 GNU Mailutils is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNU Mailutils; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 MA 02110-1301 USA */
19
20 #ifdef HAVE_CONFIG_H
21 # include <config.h>
22 #endif
23 #include <stdio.h>
24 #include <string.h>
25 #include <errno.h>
26
27 #include <mailutils/address.h>
28 #include <mailutils/errno.h>
29 #include <mailutils/kwd.h>
30 #include <mailutils/mutil.h>
31
32 #define EPARSE MU_ERR_NOENT
33
34 int
35 main (int argc, char *argv[])
36 {
37 char *str;
38 size_t i;
39 size_t pcount = 0;
40 int status;
41 const char *buf;
42 mu_address_t address = NULL;
43 struct mu_address hint;
44
45 if (argc != 2)
46 {
47 fprintf (stderr, "usage: %s address\n", argv[0]);
48 return 2;
49 }
50 str = argv[1];
51
52 hint.domain = "localhost";
53 status = mu_address_create_hint (&address, str, &hint, MU_ADDR_HINT_DOMAIN);
54 mu_address_get_count (address, &pcount);
55
56 if (status)
57 {
58 fprintf (stderr, "%s\n", mu_errname (status));
59 return 1;
60 }
61 else
62 printf ("naddr: %lu\n", (unsigned long) pcount);
63
64 for (i = 1; i <= pcount; i++)
65 {
66 int isgroup;
67
68 mu_address_is_group (address, i, &isgroup);
69 printf ("%lu. ", (unsigned long) i);
70
71 if (isgroup)
72 {
73 mu_address_sget_personal (address, i, &buf);
74 printf ("group <%s>:\n", buf);
75 }
76 else
77 {
78 mu_address_sget_email (address, i, &buf);
79 printf ("email <%s>:\n", buf);
80 }
81
82 if (mu_address_sget_personal (address, i, &buf) == 0 && buf && !isgroup)
83 printf ("personal <%s>\n", buf);
84
85 if (mu_address_sget_comments (address, i, &buf) == 0 && buf)
86 printf ("comments <%s>\n", buf);
87
88 if (mu_address_sget_local_part (address, i, &buf) == 0 && buf)
89 {
90 printf ("local-part <%s>", buf);
91
92 if (mu_address_sget_domain (address, i, &buf) == 0 && buf)
93 printf (" domain <%s>", buf);
94
95 printf ("\n");
96 }
97
98 if (mu_address_sget_route (address, i, &buf) == 0 && buf)
99 printf ("route <%s>\n", buf);
100 }
101 mu_address_destroy (&address);
102 return 0;
103 }
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 dnl ------------------------------------------------------------
19 dnl TESTARGS([NAME], [KW = `'], [INPUT], [STDOUT = `'],
20 dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
21 dnl
22 m4_define([TESTARGS],[
23 AT_SETUP([Argcv: $1])
24 AT_KEYWORDS([argcv $2])
25 AT_CHECK([
26 AT_DATA([input],[$3
27 ])
28 argcv < input],[0],m4_shift(m4_shift(m4_shift($@))))
29 AT_CLEANUP
30 ])
31
32 dnl ------------------------------------------------------------
33 TESTARGS([simple input],[],
34 [1 2 3],
35 [3: 1 2 3
36 ])
37
38 TESTARGS([quoted space],[],
39 [quoted\ space],
40 [1: "quoted space"
41 ])
42
43 TESTARGS([tab character],[],
44 [a "tab character"],
45 [2: a tab\tcharacter
46 ])
47
48 TESTARGS([octal and hex escapes],[],
49 [\157\143\164\141\154\40and\x20\x68\x65\x78],
50 [1: "octal and hex"
51 ])
52
53 TESTARGS([octal and hex escapes 2],[],
54 [\157\143\164\141\154\40 and \x20\x68\x65\x78],
55 [3: "octal " and " hex"
56 ])
57
58 TESTARGS([escape representation],[],
59 [A\x3-\48\39],
60 [1: A\003-\0048\0039
61 ])
62
63 TESTARG([8-bit input],[],
64 [×ÅÒÈÎÑÑ ÐÏÌÏ×ÉÎÁ ÔÁÂÌÉÃÙ],
65 [3: \327\305\322\310\316\321\321 \320\317\314\317\327\311\316\301 \324\301\302\314\311\303\331])
66
67 TESTARG([misquoted input],[],
68 [messed up'quotations ' in "a single'" "command" lin"e],
69 [6: messed "upquotations " in "a single'" command "lin\"e"
70 ])
71
72 TESTARG([unbalanced quote],[],
73 ['unbalanced "quote],
74 [2: 'unbalanced "\"quote"
75 ])
76
77 TESTARG([unbalanced quote 2],[],
78 [unbalanced "quote],
79 [2: unbalanced "\"quote"
80 ])
81
82 TESTARG([unbalanced quote 3],[],
83 ["],
84 [1: "\""
85 ])
86
87
88
89
90
91
1 # @configure_input@ -*- shell-script -*-
2 # Configurable variable values for Mailutils test suite.
3 # Copyright (C) 2004, 2010 Free Software Foundation, Inc.
4
5 PATH=@abs_builddir@:@abs_top_builddir@/frm:$top_srcdir:$srcdir:$PATH
6 top_srcdir=@abs_top_srcdir@
7 top_builddir=@abs_top_builddir@
8
9
...\ No newline at end of file ...\ No newline at end of file
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 AT_SETUP([base64 decoding (read)])
19 AT_KEYWORDS([base64 base64d base64dr decode])
20
21 AT_CHECK([
22 cp $top_srcdir/libmailutils/tests/Encode expout
23 fltst base64 decode read linelen=0 < $top_srcdir/libmailutils/tests/Decode],
24 [0],
25 [expout])
26
27 AT_CLEANUP
28
29
30 AT_SETUP([base64 decoding (write)])
31 AT_KEYWORDS([base64 base64d base64dw decode])
32
33 AT_CHECK([
34 cp $top_srcdir/libmailutils/tests/Encode expout
35 fltst base64 decode write linelen=0 < $top_srcdir/libmailutils/tests/Decode],
36 [0],
37 [expout])
38
39 AT_CLEANUP
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 AT_SETUP([base64 encoding (read)])
19 AT_KEYWORDS([base64 base64e base64er encode])
20
21 AT_CHECK([
22 cp $top_srcdir/libmailutils/tests/Decode expout
23 fltst base64 encode read nl < $top_srcdir/libmailutils/tests/Encode],
24 [0],
25 [expout])
26
27 AT_CLEANUP
28
29
30 AT_SETUP([base64 encoding (write)])
31 AT_KEYWORDS([base64 base64e base64ew encode])
32
33 AT_CHECK([
34 cp $top_srcdir/libmailutils/tests/Decode expout
35 fltst base64 encode write nl < $top_srcdir/libmailutils/tests/Encode],
36 [0],
37 [expout])
38
39 AT_CLEANUP
...\ No newline at end of file ...\ No newline at end of file
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 dnl ------------------------------------------------------------
19 dnl TESTDEC2047([NAME], [KW = `'], [INPUT], [STDOUT = `'],
20 dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
21 dnl
22 m4_define([TESTDEC2047],[
23 AT_SETUP([Decode 2047: m4_if([$1],[],[$3],[$1])])
24 AT_KEYWORDS([decode2047 decode $2])
25 AT_CHECK([
26 AT_DATA([input],[$3
27 ])
28 decode2047 -p < input],[0],m4_shift(m4_shift(m4_shift($@))))
29 AT_CLEANUP
30 ])
31
32 dnl ------------------------------------------------------------
33 TESTDEC2047([],[decode01],
34 [=?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>],
35 [Keith Moore <moore@cs.utk.edu>
36 ])
37
38 TESTDEC2047([],[decode02],
39 [=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>],
40 [Keld J\370rn Simonsen <keld@dkuug.dk>
41 ])
42
43 TESTDEC2047([],[decode03],
44 [=?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>],
45 [Andr\351 Pirard <PIRARD@vm1.ulg.ac.be>
46 ])
47
48 TESTDEC2047([],[decode04],
49 [=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= ... =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=],
50 [If you can read this yo ... u understand the example.
51 ])
52
53 # Malformed input string: lacks trailing =. MU 0.6.90 hanged on it.
54 TESTDEC2047([malformed input],[decode05],
55 [=?koi8-r?B?RndkOiDSxcfJ09TSwcPJ0SDEz83FzsE?=],
56 [Fwd: \322\305\307\311\323\324\322\301\303\311\321 \304\317\315\305
57 ])
58
59
60
...@@ -71,8 +71,9 @@ main (int argc, char *argv[]) ...@@ -71,8 +71,9 @@ main (int argc, char *argv[])
71 if (len > 0 && buf[len - 1] == '\n') 71 if (len > 0 && buf[len - 1] == '\n')
72 buf[len - 1] = 0; 72 buf[len - 1] = 0;
73 rc = mu_rfc2047_decode (charset, buf, &p); 73 rc = mu_rfc2047_decode (charset, buf, &p);
74 printf ("%s=> %s\n", buf, mu_strerror (rc)); 74 if (rc)
75 if (p) 75 fprintf (stderr, "%s", mu_strerror (rc));
76 else if (p)
76 print (p, printable); 77 print (p, printable);
77 putchar ('\n'); 78 putchar ('\n');
78 free (p); 79 free (p);
......
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 AT_SETUP([encode2047])
19 AT_KEYWORDS([encode])
20
21 AT_CHECK([
22 AT_DATA(input,[dnl
23 \\345\326\305\304\316\305\327\316\331\312\040\317\324\336\305\324
24 ])
25
26 encode2047 -c koi8-r -eB -o < input],
27 [0],
28 [=?koi8-r?B?5dbFxM7F187ZyiDP1N7F1A==?=
29 ])
30
31 AT_CLEANUP
32
...@@ -197,8 +197,9 @@ main (int argc, char *argv[]) ...@@ -197,8 +197,9 @@ main (int argc, char *argv[])
197 decode_octal (cmd); 197 decode_octal (cmd);
198 198
199 rc = mu_rfc2047_encode (charset, encoding, cmd, &p); 199 rc = mu_rfc2047_encode (charset, encoding, cmd, &p);
200 printf ("%s=> %s\n", buf, mu_strerror (rc)); 200 if (rc)
201 if (p) 201 fprintf (stderr, "%s", mu_strerror (rc));
202 else if (p)
202 printf ("%s\n", p); 203 printf ("%s\n", p);
203 free (p); 204 free (p);
204 } 205 }
......
1 /* GNU Mailutils -- a suite of utilities for electronic mail
2 Copyright (C) 1999, 2000, 2001, 2002, 2005, 2007, 2010 Free Software
3 Foundation, Inc.
4
5 GNU Mailutils is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
8 any later version.
9
10 GNU Mailutils is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with GNU Mailutils; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 MA 02110-1301 USA */
19
20 #ifdef HAVE_CONFIG_H
21 # include <config.h>
22 #endif
23 #include <unistd.h>
24 #include <stdio.h>
25 #include <assert.h>
26 #include <ctype.h>
27 #include <string.h>
28 #include <mailutils/mailutils.h>
29
30 #define ISPRINT(c) ((c)>=' '&&(c)<127)
31
32 int verbose = 0;
33 int printable = 0;
34
35 static void
36 c_copy (mu_stream_t out, mu_stream_t in)
37 {
38 if (printable)
39 {
40 char c;
41 size_t size;
42
43 while (mu_stream_read (in, &c, 1, &size) == 0 && size > 0)
44 {
45 int rc;
46
47 if (printable && !ISPRINT (c))
48 {
49 char outbuf[24];
50 sprintf (outbuf, "\\%03o", (unsigned char) c);
51 rc = mu_stream_write (out, outbuf, strlen (outbuf), NULL);
52 }
53 else
54 rc = mu_stream_write (out, &c, 1, NULL);
55 }
56 }
57 else
58 MU_ASSERT (mu_stream_copy (out, in, 0, NULL));
59
60 if (verbose)
61 fprintf (stderr, "\ntotal: %lu/%lu bytes\n",
62 (unsigned long) mu_stream_bytes_in (in),
63 (unsigned long) mu_stream_bytes_out (out));
64
65 }
66
67 /* Set the maximum line length for the filter NAME to LENGTH.
68 FIXME: This is a kludge. Perhaps API should provide a function
69 for that. */
70 static void
71 reset_line_length (const char *name, size_t length)
72 {
73 mu_list_t list;
74 int status;
75 mu_filter_record_t frec;
76
77 mu_filter_get_list (&list);
78 status = mu_list_locate (list, (void*)name, (void**)&frec);
79 if (status == 0)
80 frec->max_line_length = length;
81 /* don't bail out, leave that to mu_filter_create */
82 }
83
84 void
85 usage (const char *diag)
86 {
87 FILE *fp;
88
89 if (diag)
90 {
91 fp = stderr;
92 fprintf (fp, "%s\n", diag);
93 }
94 else
95 fp = stdout;
96
97 fprintf (fp, "%s",
98 "usage: fltst FILTER {encode|decode} {read|write} [shift=N] [linelen=N] [verbose] [printable] [nl]\n");
99 exit (diag ? 1 : 0);
100 }
101
102 int
103 main (int argc, char * argv [])
104 {
105 mu_stream_t in, out, flt;
106 int i;
107 int mode = MU_FILTER_ENCODE;
108 int flags = MU_STREAM_READ;
109 char *fltname;
110 mu_off_t shift = 0;
111 size_t line_length;
112 int line_length_option = 0;
113 int newline_option = 0;
114
115 if (argc == 1)
116 usage (NULL);
117 if (argc < 3)
118 usage ("not enough arguments");
119
120 fltname = argv[1];
121
122 if (strcmp (argv[2], "encode") == 0)
123 mode = MU_FILTER_ENCODE;
124 else if (strcmp (argv[2], "decode") == 0)
125 mode = MU_FILTER_DECODE;
126 else
127 usage ("2nd arg is wrong");
128
129 if (strcmp (argv[3], "read") == 0)
130 flags = MU_STREAM_READ;
131 else if (strcmp (argv[3], "write") == 0)
132 flags = MU_STREAM_WRITE;
133 else
134 usage ("3rd arg is wrong");
135
136 for (i = 4; i < argc; i++)
137 {
138 if (strncmp (argv[i], "shift=", 6) == 0)
139 shift = strtoul (argv[i] + 6, NULL, 0);
140 else if (strncmp (argv[i], "linelen=", 8) == 0)
141 {
142 line_length = strtoul (argv[i] + 8, NULL, 10);
143 line_length_option = 1;
144 }
145 else if (strcmp (argv[i], "verbose") == 0)
146 verbose++;
147 else if (strcmp (argv[i], "printable") == 0)
148 printable++;
149 else if (strcmp (argv[i], "nl") == 0)
150 newline_option++;
151 else
152 usage ("wrong option");
153 }
154
155 MU_ASSERT (mu_stdio_stream_create (&in, MU_STDIN_FD, 0));
156 MU_ASSERT (mu_stream_open (in));
157
158 MU_ASSERT (mu_stdio_stream_create (&out, MU_STDOUT_FD, 0));
159 MU_ASSERT (mu_stream_open (out));
160
161 if (line_length_option)
162 reset_line_length (fltname, line_length);
163
164 if (flags == MU_STREAM_READ)
165 {
166 MU_ASSERT (mu_filter_create (&flt, in, fltname, mode,
167 MU_STREAM_READ|MU_STREAM_SEEK|
168 MU_STREAM_AUTOCLOSE));
169 if (shift)
170 MU_ASSERT (mu_stream_seek (flt, shift, MU_SEEK_SET, NULL));
171 c_copy (out, flt);
172 }
173 else
174 {
175 MU_ASSERT (mu_filter_create (&flt, out, fltname, mode,
176 MU_STREAM_WRITE));
177 if (shift)
178 MU_ASSERT (mu_stream_seek (in, shift, MU_SEEK_SET, NULL));
179 c_copy (flt, in);
180
181 mu_stream_close (in);
182 mu_stream_destroy (&in);
183 }
184
185 mu_stream_close (flt);
186 mu_stream_destroy (&flt);
187
188 if (newline_option)
189 mu_stream_write (out, "\n", 1, NULL);
190
191 mu_stream_close (out);
192 mu_stream_destroy (&out);
193
194 return 0;
195 }
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 dnl ------------------------------------------------------------
19 dnl MAILCAP([NAME], [KW = `'], [INPUT], [STDOUT = `'],
20 dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
21 dnl
22 m4_define([MAILCAP],[
23 AT_SETUP([Mailcap: [$1]])
24 AT_KEYWORDS([mailcap $2])
25 AT_CHECK([
26 AT_DATA([input],[$3
27 ])
28 mailcap input],[0],m4_shift(m4_shift(m4_shift($@))))
29 AT_CLEANUP
30 ])
31
32 dnl ------------------------------------------------------------
33
34 MAILCAP([1],[mailcap01],
35 [text/plain; less '%s'; needsterminal],
36 [[entry[1]
37 typefield: text/plain
38 view-command: less '%s'
39 fields[1]: needsterminal
40
41 ]])
42
43 MAILCAP([2],[mailcap02],
44 [text/html; gnome-help-browser '%s'; nametemplate=%s.html; test=test -n "$DISPLAY"],
45 [[entry[1]
46 typefield: text/html
47 view-command: gnome-help-browser '%s'
48 fields[1]: nametemplate=%s.html
49 fields[2]: test=test -n "$DISPLAY"
50
51 ]])
52
53 MAILCAP([3],[mailcap03],
54 [application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; \
55 copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
56 ],
57 [[entry[1]
58 typefield: application/x-troff-man
59 view-command: /usr/bin/nroff -mandoc -Tlatin1
60 fields[1]: copiousoutput
61 fields[2]: print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
62
63 ]])
64
65 MAILCAP([4],[mailcap04],
66 [text/plain; shownonascii iso-8859-1 '%s'; description="Plain ASCII Text"; \
67 test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""],
68 [[entry[1]
69 typefield: text/plain
70 view-command: shownonascii iso-8859-1 '%s'
71 fields[1]: description="Plain ASCII Text"
72 fields[2]: test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""
73
74 ]])
75
76 MAILCAP([5],[mailcap05],
77 [text/richtext; shownonascii iso-8859-1 -e richtext -p '%s'; \
78 description="Richtext"; copiousoutput; \
79 test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""],
80 [[entry[1]
81 typefield: text/richtext
82 view-command: shownonascii iso-8859-1 -e richtext -p '%s'
83 fields[1]: description="Richtext"
84 fields[2]: copiousoutput
85 fields[3]: test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""
86
87 ]])
88
89 MAILCAP([6],[mailcap06],
90 [text/enriched; shownonascii iso-8859-1 -e richtext -e -p '%s'; \
91 description="Enriched Text"; \
92 copiousoutput; \
93 test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""],
94 [[entry[1]
95 typefield: text/enriched
96 view-command: shownonascii iso-8859-1 -e richtext -e -p '%s'
97 fields[1]: description="Enriched Text"
98 fields[2]: copiousoutput
99 fields[3]: test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""
100
101 ]])
102
103 MAILCAP([7],[mailcap07],
104 [message/partial; showpartial '%s' %{id} %{number} %{total}; description="An incomplete message"],
105 [[entry[1]
106 typefield: message/partial
107 view-command: showpartial '%s' %{id} %{number} %{total}
108 fields[1]: description="An incomplete message"
109
110 ]])
111
112 MAILCAP([8],[mailcap08],
113 [message/external-body; showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}; needsterminal; description="A reference to data stored in an external location"; composetyped="extcompose '%s"'],
114 [[entry[1]
115 typefield: message/external-body
116 view-command: showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}
117 fields[1]: needsterminal
118 fields[2]: description="A reference to data stored in an external location"
119 fields[3]: composetyped="extcompose '%s"'
120
121 ]])
122
123 MAILCAP([9],[mailcap09],
124 [application/x-dvi; /usr/bin/xdvi '%s'; test=test -n "$DISPLAY"; description=TeX DVI file; nametemplate=%s.dvi],
125 [[entry[1]
126 typefield: application/x-dvi
127 view-command: /usr/bin/xdvi '%s'
128 fields[1]: test=test -n "$DISPLAY"
129 fields[2]: description=TeX DVI file
130 fields[3]: nametemplate=%s.dvi
131
132 ]])
133
134 MAILCAP([10],[mailcap10],
135 [text/plain; more '%s'; needsterminal],
136 [[entry[1]
137 typefield: text/plain
138 view-command: more '%s'
139 fields[1]: needsterminal
140
141 ]])
142
143 MAILCAP([11],[mailcap11],
144 [text/html; /usr/bin/links '%s'; needsterminal; description=HTML Text; nametemplate=%s.html],
145 [[entry[1]
146 typefield: text/html
147 view-command: /usr/bin/links '%s'
148 fields[1]: needsterminal
149 fields[2]: description=HTML Text
150 fields[3]: nametemplate=%s.html
151
152 ]])
153
154 MAILCAP([12],[mailcap12],
155 [text/richtext; richtext '%s'; description="Richtext"; copiousoutput],
156 [[entry[1]
157 typefield: text/richtext
158 view-command: richtext '%s'
159 fields[1]: description="Richtext"
160 fields[2]: copiousoutput
161
162 ]])
163
164 MAILCAP([13],[mailcap13],
165 [text/enriched; richtext -e '%s'; description="Enriched Text"; copiousoutput],
166 [[entry[1]
167 typefield: text/enriched
168 view-command: richtext -e '%s'
169 fields[1]: description="Enriched Text"
170 fields[2]: copiousoutput
171
172 ]])
173
174 MAILCAP([14],[mailcap14],
175 [text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html],
176 [[entry[1]
177 typefield: text/html
178 view-command: /usr/bin/w3m -T text/html '%s'
179 fields[1]: needsterminal
180 fields[2]: description=HTML Text
181 fields[3]: nametemplate=%s.html
182
183 ]])
184
185 MAILCAP([15],[mailcap15],
186 [text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html],
187 [[entry[1]
188 typefield: text/html
189 view-command: /usr/bin/links -dump '%s'
190 fields[1]: copiousoutput
191 fields[2]: description=HTML Text
192 fields[3]: nametemplate=%s.html
193
194 ]])
195
196 MAILCAP([16],[mailcap16],
197 [text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html],
198 [[entry[1]
199 typefield: text/html
200 view-command: /usr/bin/lynx -force_html '%s'
201 fields[1]: needsterminal
202 fields[2]: description=HTML Text
203 fields[3]: nametemplate=%s.html
204
205 ]])
206
207 MAILCAP([17],[mailcap17],
208 [text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html],
209 [[entry[1]
210 typefield: text/html
211 view-command: /usr/bin/w3m -dump -T text/html '%s'
212 fields[1]: copiousoutput
213 fields[2]: description=HTML Text
214 fields[3]: nametemplate=%s.html
215
216 ]])
217
218 MAILCAP([18],[mailcap18],
219 [text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text],
220 [[entry[1]
221 typefield: text/html
222 view-command: /usr/bin/html2text '%s'
223 fields[1]: copiousoutput
224 fields[2]: description=HTML Text
225
226 ]])
227
228 MAILCAP([19],[mailcap19],
229 [text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html],
230 [[entry[1]
231 typefield: text/html
232 view-command: /usr/bin/lynx -dump -force_html '%s'
233 fields[1]: copiousoutput
234 fields[2]: description=HTML Text
235 fields[3]: nametemplate=%s.html
236
237 ]])
238
239 MAILCAP([20],[mailcap20],
240 [text/*; less '%s'; needsterminal],
241 [[entry[1]
242 typefield: text/*
243 view-command: less '%s'
244 fields[1]: needsterminal
245
246 ]])
247
248 MAILCAP([21],[mailcap21],
249 [text/*; more '%s'; needsterminal],
250 [[entry[1]
251 typefield: text/*
252 view-command: more '%s'
253 fields[1]: needsterminal
254
255 ]])
256
257 MAILCAP([22],[mailcap22],
258 [application/x-debian-package; /usr/lib/mime/debian-view '%s'; \
259 needsterminal; description=Debian GNU/Linux Package; \
260 nametemplate=%s.deb],
261 [[entry[1]
262 typefield: application/x-debian-package
263 view-command: /usr/lib/mime/debian-view '%s'
264 fields[1]: needsterminal
265 fields[2]: description=Debian GNU/Linux Package
266 fields[3]: nametemplate=%s.deb
267
268 ]])
269
270 MAILCAP([23],[mailcap23],
271 [audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; \
272 nametemplate=%s.au],
273 [[entry[1]
274 typefield: audio/basic
275 view-command: /usr/lib/mime/playaudio '%s'
276 fields[1]: description=Basic uLaw Audio
277 fields[2]: nametemplate=%s.au
278
279 ]])
1 # This file is part of Mailutils testsuite. 1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc. 2 # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
3 # 3 #
4 # This program is free software; you can redistribute it and/or modify 4 # GNU Mailutils is free software; you can redistribute it and/or
5 # it under the terms of the GNU General Public License as published by 5 # modify it under the terms of the GNU General Public License as
6 # the Free Software Foundation; either version 3 of the License, or 6 # published by the Free Software Foundation; either version 3, or (at
7 # (at your option) any later version. 7 # your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # 8 #
18 # NOTE: Apart from this comment, the contents of this file is taken verbatim. 9 # This program is distributed in the hope that it will be useful, but
19 # Please be sure you don't add any extra newlines. 10 # WITHOUT ANY WARRANTY; without even the implied warranty of
20 Message: 1 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 # This file is part of Mailfromd testsuite.
17
18 AT_SETUP([mime])
19
20 # FIXME: Mimetest should probably be fixed to avoid the use of `tr'
21 # and `sed' here.
22 AT_CHECK([mimetest -i 0 -p $top_srcdir/testsuite/spool/mbox1 | dnl
23 tr '\t' ' ' | sed 's/ *$//'],
24 [0],
25 [Message: 1
21 From: Foo Bar <foobar@nonexistent.net> 26 From: Foo Bar <foobar@nonexistent.net>
22 Subject: Jabberwocky 27 Subject: Jabberwocky
23 Number of parts in message - 1 28 Number of parts in message - 1
...@@ -100,7 +105,7 @@ With gently smiling jaws! ...@@ -100,7 +105,7 @@ With gently smiling jaws!
100 End 105 End
101 Type of part 2 = application/octet-stream 106 Type of part 2 = application/octet-stream
102 Message part size - 645/11: 183/5, 462/6 107 Message part size - 645/11: 183/5, 462/6
103 Attachment - saving [msg.21] 108 Attachment - saving [[msg.21]]
104 Begin 109 Begin
105 `You are old, Father William,' the young man said, 110 `You are old, Father William,' the young man said,
106 `And your hair has become very white; 111 `And your hair has become very white;
...@@ -141,7 +146,7 @@ Encapsulated message : ...@@ -141,7 +146,7 @@ Encapsulated message :
141 Begin 146 Begin
142 Type of part 1 = application/octet-stream 147 Type of part 1 = application/octet-stream
143 Message part size - 663/12: 184/5, 479/7 148 Message part size - 663/12: 184/5, 479/7
144 Attachment - saving [msg.22] 149 Attachment - saving [[msg.22]]
145 Begin 150 Begin
146 `You are old,' said the youth, `as I mentioned before, 151 `You are old,' said the youth, `as I mentioned before,
147 And have grown most uncommonly fat; 152 And have grown most uncommonly fat;
...@@ -160,7 +165,7 @@ Encapsulated message : ...@@ -160,7 +165,7 @@ Encapsulated message :
160 Begin 165 Begin
161 Type of part 1 = application/octet-stream 166 Type of part 1 = application/octet-stream
162 Message part size - 668/12: 185/5, 483/7 167 Message part size - 668/12: 185/5, 483/7
163 Attachment - saving [msg.23] 168 Attachment - saving [[msg.23]]
164 Begin 169 Begin
165 `You are old,' said the youth, `and your jaws are too weak 170 `You are old,' said the youth, `and your jaws are too weak
166 For anything tougher than suet; 171 For anything tougher than suet;
...@@ -175,7 +180,7 @@ Has lasted the rest of my life.' ...@@ -175,7 +180,7 @@ Has lasted the rest of my life.'
175 End 180 End
176 Type of part 2 = application/octet-stream 181 Type of part 2 = application/octet-stream
177 Message part size - 679/12: 184/5, 495/7 182 Message part size - 679/12: 184/5, 495/7
178 Attachment - saving [msg.24] 183 Attachment - saving [[msg.24]]
179 Begin 184 Begin
180 `You are old,' said the youth, `one would hardly suppose 185 `You are old,' said the youth, `one would hardly suppose
181 That your eye was as steady as ever; 186 That your eye was as steady as ever;
...@@ -210,3 +215,6 @@ Begin ...@@ -210,3 +215,6 @@ Begin
210 215
211 216
212 End 217 End
218 ])
219
220 AT_CLEANUP
...\ No newline at end of file ...\ No newline at end of file
......
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 m4_include([testsuite.inc])
19
20 AT_INIT
21
22 m4_include([address.at])
23 m4_include([argcv.at])
24 m4_include([mime.at])
25 m4_include([url.at])
26 m4_include([mailcap.at])
27 m4_include([base64e.at])
28 m4_include([base64d.at])
29 m4_include([decode2047.at])
30 m4_include([encode2047.at])
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
39 mu_error ("cannot get %s: %s", #field, mu_strerror (status)); \ 39 mu_error ("cannot get %s: %s", #field, mu_strerror (status)); \
40 exit (1); \ 40 exit (1); \
41 } \ 41 } \
42 printf ("\t" #field " <%s>\n", buf) 42 printf (#field " <%s>\n", buf)
43 43
44 static void 44 static void
45 print_fvpairs (mu_url_t url) 45 print_fvpairs (mu_url_t url)
...@@ -55,7 +55,7 @@ print_fvpairs (mu_url_t url) ...@@ -55,7 +55,7 @@ print_fvpairs (mu_url_t url)
55 if (fvc == 0) 55 if (fvc == 0)
56 return; 56 return;
57 for (i = 0; i < fvc; i++) 57 for (i = 0; i < fvc; i++)
58 printf ("\tparam[%lu] <%s>\n", (unsigned long) i, fvp[i]); 58 printf ("param[%lu] <%s>\n", (unsigned long) i, fvp[i]);
59 } 59 }
60 60
61 static void 61 static void
...@@ -72,7 +72,7 @@ print_query (mu_url_t url) ...@@ -72,7 +72,7 @@ print_query (mu_url_t url)
72 if (qargc == 0) 72 if (qargc == 0)
73 return; 73 return;
74 for (i = 0; i < qargc; i++) 74 for (i = 0; i < qargc; i++)
75 printf ("\tquery[%lu] <%s>\n", (unsigned long) i, qargv[i]); 75 printf ("query[%lu] <%s>\n", (unsigned long) i, qargv[i]);
76 } 76 }
77 77
78 int 78 int
...@@ -99,18 +99,16 @@ main () ...@@ -99,18 +99,16 @@ main ()
99 } 99 }
100 if ((rc = mu_url_parse (u)) != 0) 100 if ((rc = mu_url_parse (u)) != 0)
101 { 101 {
102 printf ("%s => FAILED: [%d] %s\n", 102 fprintf (stderr, "%s\n", mu_errname (rc));
103 str, rc, mu_strerror (rc));
104 continue; 103 continue;
105 } 104 }
106 printf ("%s => SUCCESS\n", str);
107 105
108 GET_AND_PRINT (scheme, u, buf, rc); 106 GET_AND_PRINT (scheme, u, buf, rc);
109 GET_AND_PRINT (user, u, buf, rc); 107 GET_AND_PRINT (user, u, buf, rc);
110 108
111 rc = mu_url_get_secret (u, &secret); 109 rc = mu_url_get_secret (u, &secret);
112 if (rc == MU_ERR_NOENT) 110 if (rc == MU_ERR_NOENT)
113 printf ("\tpasswd <>\n"); 111 printf ("passwd <>\n");
114 else if (rc) 112 else if (rc)
115 { 113 {
116 mu_error ("cannot get %s: %s", "passwd", mu_strerror (rc)); 114 mu_error ("cannot get %s: %s", "passwd", mu_strerror (rc));
...@@ -118,7 +116,7 @@ main () ...@@ -118,7 +116,7 @@ main ()
118 } 116 }
119 else 117 else
120 { 118 {
121 printf ("\tpasswd <%s>\n", mu_secret_password (secret)); 119 printf ("passwd <%s>\n", mu_secret_password (secret));
122 mu_secret_password_unref (secret); 120 mu_secret_password_unref (secret);
123 } 121 }
124 122
...@@ -131,7 +129,7 @@ main () ...@@ -131,7 +129,7 @@ main ()
131 mu_error ("cannot get %s: %s", "port", mu_strerror (rc)); 129 mu_error ("cannot get %s: %s", "port", mu_strerror (rc));
132 exit (1); 130 exit (1);
133 } 131 }
134 printf ("\tport %ld\n", port); 132 printf ("port %ld\n", port);
135 133
136 GET_AND_PRINT (path, u, buf, rc); 134 GET_AND_PRINT (path, u, buf, rc);
137 print_fvpairs (u); 135 print_fvpairs (u);
......
1 Makefile
2 Makefile.in
3 *.log
4 *.sum
5 site.exp
6 remote.exp
7 data
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 1 2 3
19 3: 1 2 3
20
21 quoted\ space
22 1: "quoted space"
23
24 a "tab character"
25 2: a tab\tcharacter
26
27 \157\143\164\141\154\40and\x20\x68\x65\x78
28 1: "octal and hex"
29
30 \157\143\164\141\154\40 and \x20\x68\x65\x78
31 3: "octal " and " hex"
32
33 A\x3-\48\39
34 1: A\003-\0048\0039
35
36 # FIXME: Tcl is not able to properly handle binary data, even with
37 # fconfigure -binary, so I had to disable this test
38 #message: ASCII upper part
39 #×ÅÒÈÎÑÑ ÐÏÌÏ×ÉÎÁ ÔÁÂÌÉÃÙ
40 #3: \327\305\322\310\316\321\321 \320\317\314\317\327\311\316\301 \324\301\302\314\311\303\331
41
42 messed up'quotations ' in "a single'" "command" lin"e
43 6: messed "upquotations " in "a single'" command "lin\"e"
44
45 'unbalanced "quote
46 2: 'unbalanced "\"quote"
47
48 unbalanced "quote
49 2: unbalanced "\"quote"
50
51 "
52 1: "\""
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2003, 2006, 2007, 2010 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18
19 =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu> => Success
20 Keith Moore <moore@cs.utk.edu>
21
22 =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk> => Success
23 Keld J\370rn Simonsen <keld@dkuug.dk>
24
25 =?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be> => Success
26 Andr\351 Pirard <PIRARD@vm1.ulg.ac.be>
27
28 =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= ... =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?= => Success
29 If you can read this yo ... u understand the example.
30
31 # Malformed input string: lacks trailing =. MU 0.6.90 hanged on it.
32 =?koi8-r?B?RndkOiDSxcfJ09TSwcPJ0SDEz83FzsE?= => Success
33 Fwd: \322\305\307\311\323\324\322\301\303
34
35 # NOTE: This file must end with an empty line
36 # EOF
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 \ckoi8-r
19 \eB
20 \o
21 -message 16-bytes string
22 #Cyrillic: åÖÅÄÎÅ×ÎÙÊ ÏÔÞÅÔ
23 \\345\326\305\304\316\305\327\316\331\312\040\317\324\336\305\324=> Success
24 =?koi8-r?B?5dbFxM7F187ZyiDP1N7F1A==?=
25
26 # NOTE: This file must end with an empty line
27 # EOF
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 text/plain; less '%s'; needsterminal
19 entry
20 typefield: text/plain
21 view-command: less '%s'
22 fields[1]: needsterminal
23
24 text/html; gnome-help-browser '%s'; nametemplate=%s.html; test=test -n "$DISPLAY"
25 entry
26 typefield: text/html
27 view-command: gnome-help-browser '%s'
28 fields[1]: nametemplate=%s.html
29 fields[2]: test=test -n "$DISPLAY"
30
31 application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; \
32 copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
33 entry
34 typefield: application/x-troff-man
35 view-command: /usr/bin/nroff -mandoc -Tlatin1
36 fields[1]: copiousoutput
37 fields[2]: print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
38
39 text/plain; shownonascii iso-8859-1 '%s'; description="Plain ASCII Text"; \
40 test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
41 entry
42 typefield: text/plain
43 view-command: shownonascii iso-8859-1 '%s'
44 fields[1]: description="Plain ASCII Text"
45 fields[2]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
46
47 text/richtext; shownonascii iso-8859-1 -e richtext -p '%s'; \
48 description="Richtext"; copiousoutput; \
49 test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
50 entry
51 typefield: text/richtext
52 view-command: shownonascii iso-8859-1 -e richtext -p '%s'
53 fields[1]: description="Richtext"
54 fields[2]: copiousoutput
55 fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
56
57 text/enriched; shownonascii iso-8859-1 -e richtext -e -p '%s'; \
58 description="Enriched Text"; \
59 copiousoutput; \
60 test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
61 entry
62 typefield: text/enriched
63 view-command: shownonascii iso-8859-1 -e richtext -e -p '%s'
64 fields[1]: description="Enriched Text"
65 fields[2]: copiousoutput
66 fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
67
68 message/partial; showpartial '%s' %{id} %{number} %{total}; description="An incomplete message"
69 entry
70 typefield: message/partial
71 view-command: showpartial '%s' %{id} %{number} %{total}
72 fields[1]: description="An incomplete message"
73
74 message/external-body; showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}; needsterminal; description="A reference to data stored in an external location"; composetyped="extcompose '%s"'
75 entry
76 typefield: message/external-body
77 view-command: showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}
78 fields[1]: needsterminal
79 fields[2]: description="A reference to data stored in an external location"
80 fields[3]: composetyped="extcompose '%s"'
81
82 application/x-dvi; /usr/bin/xdvi '%s'; test=test -n "$DISPLAY"; description=TeX DVI file; nametemplate=%s.dvi
83 entry
84 typefield: application/x-dvi
85 view-command: /usr/bin/xdvi '%s'
86 fields[1]: test=test -n "$DISPLAY"
87 fields[2]: description=TeX DVI file
88 fields[3]: nametemplate=%s.dvi
89
90 text/plain; more '%s'; needsterminal
91 entry
92 typefield: text/plain
93 view-command: more '%s'
94 fields[1]: needsterminal
95
96 text/html; /usr/bin/links '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
97 entry
98 typefield: text/html
99 view-command: /usr/bin/links '%s'
100 fields[1]: needsterminal
101 fields[2]: description=HTML Text
102 fields[3]: nametemplate=%s.html
103
104 text/richtext; richtext '%s'; description="Richtext"; copiousoutput
105 entry
106 typefield: text/richtext
107 view-command: richtext '%s'
108 fields[1]: description="Richtext"
109 fields[2]: copiousoutput
110
111 text/enriched; richtext -e '%s'; description="Enriched Text"; copiousoutput
112 entry
113 typefield: text/enriched
114 view-command: richtext -e '%s'
115 fields[1]: description="Enriched Text"
116 fields[2]: copiousoutput
117
118 text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
119 entry
120 typefield: text/html
121 view-command: /usr/bin/w3m -T text/html '%s'
122 fields[1]: needsterminal
123 fields[2]: description=HTML Text
124 fields[3]: nametemplate=%s.html
125
126 text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
127 entry
128 typefield: text/html
129 view-command: /usr/bin/links -dump '%s'
130 fields[1]: copiousoutput
131 fields[2]: description=HTML Text
132 fields[3]: nametemplate=%s.html
133
134 text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
135 entry
136 typefield: text/html
137 view-command: /usr/bin/lynx -force_html '%s'
138 fields[1]: needsterminal
139 fields[2]: description=HTML Text
140 fields[3]: nametemplate=%s.html
141
142 text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
143 entry
144 typefield: text/html
145 view-command: /usr/bin/w3m -dump -T text/html '%s'
146 fields[1]: copiousoutput
147 fields[2]: description=HTML Text
148 fields[3]: nametemplate=%s.html
149
150 text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text
151 entry
152 typefield: text/html
153 view-command: /usr/bin/html2text '%s'
154 fields[1]: copiousoutput
155 fields[2]: description=HTML Text
156
157 text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
158 entry
159 typefield: text/html
160 view-command: /usr/bin/lynx -dump -force_html '%s'
161 fields[1]: copiousoutput
162 fields[2]: description=HTML Text
163 fields[3]: nametemplate=%s.html
164
165 text/*; less '%s'; needsterminal
166 entry
167 typefield: text/*
168 view-command: less '%s'
169 fields[1]: needsterminal
170
171 text/*; more '%s'; needsterminal
172 entry
173 typefield: text/*
174 view-command: more '%s'
175 fields[1]: needsterminal
176
177 application/x-debian-package; /usr/lib/mime/debian-view '%s'; \
178 needsterminal; description=Debian GNU/Linux Package; \
179 nametemplate=%s.deb
180 entry
181 typefield: application/x-debian-package
182 view-command: /usr/lib/mime/debian-view '%s'
183 fields[1]: needsterminal
184 fields[2]: description=Debian GNU/Linux Package
185 fields[3]: nametemplate=%s.deb
186
187 audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; \
188 nametemplate=%s.au
189 entry
190 typefield: audio/basic
191 view-command: /usr/lib/mime/playaudio '%s'
192 fields[1]: description=Basic uLaw Audio
193 fields[2]: nametemplate=%s.au
194
195 # End of Mailcap
1 ## Process this file with GNU Automake to create Makefile.in
2
3 ## Copyright (C) 2002, 2003, 2007, 2010 Free Software Foundation, Inc.
4 ##
5 ## GNU Mailutils is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU General Public License as
7 ## published by the Free Software Foundation; either version 3, or (at
8 ## your option) any later version.
9 ##
10 ## This program is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
18 ## 02110-1301 USA
19
20 AUTOMAKE_OPTIONS = dejagnu
21 DEJATOOL = mailbox
22 RUNTESTFLAGS =
23 CLEANFILES = *.log
24 test_dirs = lib mailbox
25 EXTRA_DIST = Addrs Argcv Mailcap Mime Urls Encode Decode Encode2047 Decode2047
26
27 dist-hook:
28 here=`cd $(top_builddir)/$(subdir) && pwd`; \
29 srcdir=`cd $(srcdir) && pwd`; \
30 distdir=`cd $(distdir) && pwd`; \
31 for dir in $(test_dirs); \
32 do \
33 cd $$srcdir;\
34 mkdir $$distdir/$$dir;\
35 cd $$dir;\
36 for file in DISTFILES `cat DISTFILES`; do \
37 d=$$srcdir/$$dir; \
38 if test -d $$d/$$file; then \
39 cp -pr $$d/$$file $$distdir/$$dir/$$file; \
40 else \
41 test -f $$distdir/$$dir/$$file \
42 || cp -p $$d/$$file $$distdir/$$dir/$$file || exit; \
43 fi; \
44 done;\
45 done;\
46 cd $$here
47
48 site.exp: Makefile remote.exp
49 @echo 'Making a new site.exp file...'
50 @test ! -f site.bak || rm -f site.bak
51 @echo '## these variables are automatically generated by make ##' > $@-t
52 @echo '# Do not edit here. If you wish to override these values' >> $@-t
53 @echo '# edit the last section' >> $@-t
54 @echo 'set tool $(DEJATOOL)' >> $@-t
55 @echo "set top_srcdir `cd $(top_srcdir); pwd`" >> $@-t
56 @echo "set top_builddir `cd $(top_builddir); pwd`" >> $@-t
57 @echo "set srcdir `cd $(srcdir); pwd`" >> $@-t
58 @echo 'set objdir' `pwd` >> $@-t
59 @echo 'set host_alias "$(host_alias)"' >> $@-t
60 @echo 'set host_triplet $(host_triplet)' >> $@-t
61 @echo 'set target_alias "$(target_alias)"' >> $@-t
62 @echo 'set target_triplet $(target_triplet)' >> $@-t
63 @echo 'set build_alias "$(build_alias)"' >> $@-t
64 @echo 'set build_triplet $(build_triplet)' >> $@-t
65 @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
66 @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
67 @test ! -f site.exp || mv site.exp site.bak
68 @mv $@-t site.exp
69
70 remote.exp:;
71 @echo 'Making a new remote.exp file...'
72 @test ! -f remote.bak || rm -f remote.bak
73 @echo '## These variables are used to set up for the remote testing.' >> $@-t
74 @echo '## Please, read file README in this directory for instructions' >> $@-t
75 @echo '## on how to use this file' >> $@-t
76 @echo "set host_board `hostname`" >> $@-t
77 @echo 'set board_info($$host_board,connect) rlogin' >> $@-t
78 @echo 'set board_info($$host_board,shell_prompt) "\\$$ "' >> $@-t
79 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
80 @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
81 @echo "set board_info(\$$host_board,srcdir) `cd $(srcdir); pwd`" >> $@-t
82 @echo "set board_info(\$$host_board,objdir) `pwd`" >> $@-t
83 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
84 @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
85 @test ! -f remote.exp || mv remote.exp remote.bak
86 @mv $@-t remote.exp
87
88
89 DISTCLEANFILES=*.exp *.log *.sum
90
91 distclean-local:
92 -rm -rf data
1 # This file is part of Mailutils testsuite.
2 # Copyright (C) 2002, 2007, 2008 Free Software Foundation
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 #
18 # NOTE: Expected lines must be indented with exactly one tab character.
19
20 scheme: => SUCCESS
21 scheme <scheme>
22 user <>
23 passwd <>
24 auth <>
25 host <>
26 port 0
27 path <>
28
29 scheme:/absolute/path => SUCCESS
30 scheme <scheme>
31 user <>
32 passwd <>
33 auth <>
34 host <>
35 port 0
36 path </absolute/path>
37
38 scheme:relative/path => SUCCESS
39 scheme <scheme>
40 user <>
41 passwd <>
42 auth <>
43 host <>
44 port 0
45 path <relative/path>
46
47 scheme:///absolute/path => SUCCESS
48 scheme <scheme>
49 user <>
50 passwd <>
51 auth <>
52 host <>
53 port 0
54 path </absolute/path>
55
56 scheme://%75%73%65%72:%70%61%73%73@%68%6f%73%74 => SUCCESS
57 scheme <scheme>
58 user <user>
59 passwd <pass>
60 auth <>
61 host <host>
62 port 0
63 path <>
64
65 ftp://user:pass@host//a/path => SUCCESS
66 scheme <ftp>
67 user <user>
68 passwd <pass>
69 auth <>
70 host <host>
71 port 0
72 path </a/path>
73
74 ftp://:pass@host//a/path => SUCCESS
75 scheme <ftp>
76 user <>
77 passwd <pass>
78 auth <>
79 host <host>
80 port 0
81 path </a/path>
82
83 ftp://user:@host//a/path => SUCCESS
84 scheme <ftp>
85 user <user>
86 passwd <>
87 auth <>
88 host <host>
89 port 0
90 path </a/path>
91
92 ftp://user:pass@//a/path => SUCCESS
93 scheme <ftp>
94 user <user>
95 passwd <pass>
96 auth <>
97 host <>
98 port 0
99 path </a/path>
100
101 ftp://user:@//a/path => SUCCESS
102 scheme <ftp>
103 user <user>
104 passwd <>
105 auth <>
106 host <>
107 port 0
108 path </a/path>
109
110 ftp://:@host//a/path => SUCCESS
111 scheme <ftp>
112 user <>
113 passwd <>
114 auth <>
115 host <host>
116 port 0
117 path </a/path>
118
119 ftp://:pass@//a/path => SUCCESS
120 scheme <ftp>
121 user <>
122 passwd <pass>
123 auth <>
124 host <>
125 port 0
126 path </a/path>
127
128 ftp://:@//a/path => SUCCESS
129 scheme <ftp>
130 user <>
131 passwd <>
132 auth <>
133 host <>
134 port 0
135 path </a/path>
136
137 ftp://://a/path => SUCCESS
138 scheme <ftp>
139 user <>
140 passwd <>
141 auth <>
142 host <>
143 port 0
144 path </a/path>
145
146 ftp://@//a/path => SUCCESS
147 scheme <ftp>
148 user <>
149 passwd <>
150 auth <>
151 host <>
152 port 0
153 path </a/path>
154
155 ftp:/a/path => SUCCESS
156 scheme <ftp>
157 user <>
158 passwd <>
159 auth <>
160 host <>
161 port 0
162 path </a/path>
163
164 ftp://user:pass@host/a/path => SUCCESS
165 scheme <ftp>
166 user <user>
167 passwd <pass>
168 auth <>
169 host <host>
170 port 0
171 path <a/path>
172
173 ftp://:pass@host/a/path => SUCCESS
174 scheme <ftp>
175 user <>
176 passwd <pass>
177 auth <>
178 host <host>
179 port 0
180 path <a/path>
181
182 ftp://user:@host/a/path => SUCCESS
183 scheme <ftp>
184 user <user>
185 passwd <>
186 auth <>
187 host <host>
188 port 0
189 path <a/path>
190
191 ftp://user:pass@/a/path => SUCCESS
192 scheme <ftp>
193 user <user>
194 passwd <pass>
195 auth <>
196 host <>
197 port 0
198 path <a/path>
199
200 ftp://user:@/a/path => SUCCESS
201 scheme <ftp>
202 user <user>
203 passwd <>
204 auth <>
205 host <>
206 port 0
207 path <a/path>
208
209 ftp://:@host/a/path => SUCCESS
210 scheme <ftp>
211 user <>
212 passwd <>
213 auth <>
214 host <host>
215 port 0
216 path <a/path>
217
218 ftp://:pass@/a/path => SUCCESS
219 scheme <ftp>
220 user <>
221 passwd <pass>
222 auth <>
223 host <>
224 port 0
225 path <a/path>
226
227 ftp://:@/a/path => SUCCESS
228 scheme <ftp>
229 user <>
230 passwd <>
231 auth <>
232 host <>
233 port 0
234 path <a/path>
235
236 ftp://:/a/path => SUCCESS
237 scheme <ftp>
238 user <>
239 passwd <>
240 auth <>
241 host <>
242 port 0
243 path <a/path>
244
245 ftp://@/a/path => SUCCESS
246 scheme <ftp>
247 user <>
248 passwd <>
249 auth <>
250 host <>
251 port 0
252 path <a/path>
253
254 ftp:///a/path => SUCCESS
255 scheme <ftp>
256 user <>
257 passwd <>
258 auth <>
259 host <>
260 port 0
261 path </a/path>
262
263 pop://pop.example.net => SUCCESS
264 scheme <pop>
265 user <>
266 passwd <>
267 auth <>
268 host <pop.example.net>
269 port 0
270 path <>
271
272 pop://user@pop.example.net => SUCCESS
273 scheme <pop>
274 user <user>
275 passwd <>
276 auth <>
277 host <pop.example.net>
278 port 0
279 path <>
280
281 pop://user:passwd@pop.example.net => SUCCESS
282 scheme <pop>
283 user <user>
284 passwd <passwd>
285 auth <>
286 host <pop.example.net>
287 port 0
288 path <>
289
290 pop://user;auth=*@pop.example.net => SUCCESS
291 scheme <pop>
292 user <user>
293 passwd <>
294 auth <*>
295 host <pop.example.net>
296 port 0
297 path <>
298
299 pop://pop.example.net:111 => SUCCESS
300 scheme <pop>
301 user <>
302 passwd <>
303 auth <>
304 host <pop.example.net>
305 port 111
306 path <>
307
308 pop://user@pop.example.net:111 => SUCCESS
309 scheme <pop>
310 user <user>
311 passwd <>
312 auth <>
313 host <pop.example.net>
314 port 111
315 path <>
316
317 pop://user:passwd@pop.example.net:111 => SUCCESS
318 scheme <pop>
319 user <user>
320 passwd <passwd>
321 auth <>
322 host <pop.example.net>
323 port 111
324 path <>
325
326 pop://user;auth=*@pop.example.net:111 => SUCCESS
327 scheme <pop>
328 user <user>
329 passwd <>
330 auth <*>
331 host <pop.example.net>
332 port 111
333 path <>
334
335 imap://imap.example.net => SUCCESS
336 scheme <imap>
337 user <>
338 passwd <>
339 auth <>
340 host <imap.example.net>
341 port 0
342 path <>
343
344 imap://user@imap.example.net => SUCCESS
345 scheme <imap>
346 user <user>
347 passwd <>
348 auth <>
349 host <imap.example.net>
350 port 0
351 path <>
352
353 imap://user:passwd@imap.example.net => SUCCESS
354 scheme <imap>
355 user <user>
356 passwd <passwd>
357 auth <>
358 host <imap.example.net>
359 port 0
360 path <>
361
362 imap://user;auth=*@imap.example.net => SUCCESS
363 scheme <imap>
364 user <user>
365 passwd <>
366 auth <*>
367 host <imap.example.net>
368 port 0
369 path <>
370
371 imap://imap.example.net:111 => SUCCESS
372 scheme <imap>
373 user <>
374 passwd <>
375 auth <>
376 host <imap.example.net>
377 port 111
378 path <>
379
380 imap://user@imap.example.net:111 => SUCCESS
381 scheme <imap>
382 user <user>
383 passwd <>
384 auth <>
385 host <imap.example.net>
386 port 111
387 path <>
388
389 imap://user:passwd@imap.example.net:111 => SUCCESS
390 scheme <imap>
391 user <user>
392 passwd <passwd>
393 auth <>
394 host <imap.example.net>
395 port 111
396 path <>
397
398 imap://user;auth=*@imap.example.net:111 => SUCCESS
399 scheme <imap>
400 user <user>
401 passwd <>
402 auth <*>
403 host <imap.example.net>
404 port 111
405 path <>
406
407 imap://imap.example.net/mbox => SUCCESS
408 scheme <imap>
409 user <>
410 passwd <>
411 auth <>
412 host <imap.example.net>
413 port 0
414 path <mbox>
415
416 imap://user@imap.example.net/mbox => SUCCESS
417 scheme <imap>
418 user <user>
419 passwd <>
420 auth <>
421 host <imap.example.net>
422 port 0
423 path <mbox>
424
425 imap://user:passwd@imap.example.net/mbox => SUCCESS
426 scheme <imap>
427 user <user>
428 passwd <passwd>
429 auth <>
430 host <imap.example.net>
431 port 0
432 path <mbox>
433
434 imap://user;auth=*@imap.example.net/mbox => SUCCESS
435 scheme <imap>
436 user <user>
437 passwd <>
438 auth <*>
439 host <imap.example.net>
440 port 0
441 path <mbox>
442
443 imap://imap.example.net:111/mbox => SUCCESS
444 scheme <imap>
445 user <>
446 passwd <>
447 auth <>
448 host <imap.example.net>
449 port 111
450 path <mbox>
451
452 imap://user@imap.example.net:111/mbox => SUCCESS
453 scheme <imap>
454 user <user>
455 passwd <>
456 auth <>
457 host <imap.example.net>
458 port 111
459 path <mbox>
460
461 imap://user:passwd@imap.example.net:111/mbox => SUCCESS
462 scheme <imap>
463 user <user>
464 passwd <passwd>
465 auth <>
466 host <imap.example.net>
467 port 111
468 path <mbox>
469
470 imap://user;auth=*@imap.example.net:111/mbox => SUCCESS
471 scheme <imap>
472 user <user>
473 passwd <>
474 auth <*>
475 host <imap.example.net>
476 port 111
477 path <mbox>
478
479 imap://imap.example.net/mbox/user@host => SUCCESS
480 scheme <imap>
481 user <imap.example.net/mbox/user>
482 passwd <>
483 auth <>
484 host <host>
485 port 0
486 path <>
487
488 imap://user@imap.example.net/mbox/user@host => SUCCESS
489 scheme <imap>
490 user <user>
491 passwd <>
492 auth <>
493 host <imap.example.net>
494 port 0
495 path <mbox/user@host>
496
497 imap://user:passwd@imap.example.net/mbox/user@host => SUCCESS
498 scheme <imap>
499 user <user>
500 passwd <passwd>
501 auth <>
502 host <imap.example.net>
503 port 0
504 path <mbox/user@host>
505
506 imap://user;auth=*@imap.example.net/mbox/user@host => SUCCESS
507 scheme <imap>
508 user <user>
509 passwd <>
510 auth <*>
511 host <imap.example.net>
512 port 0
513 path <mbox/user@host>
514
515 imap://imap.example.net:111/mbox/user@host => SUCCESS
516 scheme <imap>
517 user <imap.example.net>
518 passwd <111/mbox/user>
519 auth <>
520 host <host>
521 port 0
522 path <>
523
524 imap://user@imap.example.net:111/mbox/user@host => SUCCESS
525 scheme <imap>
526 user <user>
527 passwd <>
528 auth <>
529 host <imap.example.net>
530 port 111
531 path <mbox/user@host>
532
533 imap://user:passwd@imap.example.net:111/mbox/user@host => SUCCESS
534 scheme <imap>
535 user <user>
536 passwd <passwd>
537 auth <>
538 host <imap.example.net>
539 port 111
540 path <mbox/user@host>
541
542 imap://user;auth=*@imap.example.net:111/mbox/user@host => SUCCESS
543 scheme <imap>
544 user <user>
545 passwd <>
546 auth <*>
547 host <imap.example.net>
548 port 111
549 path <mbox/user@host>
550
551 ftp://ftp.example.org/mbox/user%40host => SUCCESS
552 scheme <ftp>
553 user <>
554 passwd <>
555 auth <>
556 host <ftp.example.org>
557 port 0
558 path <mbox/user@host>
559
560 ftp://ftp.example.org:111/mbox/user%40host => SUCCESS
561 scheme <ftp>
562 user <>
563 passwd <>
564 auth <>
565 host <ftp.example.org>
566 port 111
567 path <mbox/user@host>
568
569 ftp://ftp.example.org:111/mbox/user%40host;type=pass => SUCCESS
570 scheme <ftp>
571 user <>
572 passwd <>
573 auth <>
574 host <ftp.example.org>
575 port 111
576 path <mbox/user@host>
577 param[0] <type=pass>
578
579 mbox:/var/spool/mail;type=index;param=2;user=gray => SUCCESS
580 scheme <mbox>
581 user <>
582 passwd <>
583 auth <>
584 host <>
585 port 0
586 path </var/spool/mail>
587 param[0] <type=index>
588 param[1] <param=2>
589 param[2] <user=gray>
590
591 mbox:///var/spool/mail;type=index;param=2;user=gray => SUCCESS
592 scheme <mbox>
593 user <>
594 passwd <>
595 auth <>
596 host <>
597 port 0
598 path </var/spool/mail>
599 param[0] <type=index>
600 param[1] <param=2>
601 param[2] <user=gray>
602
603 http:///gnu.org.ua/home/gray?prog&arg1&arg2
604 scheme <http>
605 user <>
606 passwd <>
607 auth <>
608 host <gnu.org.ua>
609 port 0
610 path <home/gray>
611 query[0] <prog>
612 query[1] <arg1>
613 query[2] <arg2>
614
615 http:///gnu.org.ua/home/gray;foo=bar;baz=qux?prog&arg%201&arg%202
616 scheme <http>
617 user <>
618 passwd <>
619 auth <>
620 host <gnu.org.ua>
621 port 0
622 path <home/gray>
623 param[0] <foo=bar>
624 param[1] <baz=qux>
625 query[0] <prog>
626 query[1] <arg 1>
627 query[2] <arg 2>
628
629 # NOTE: This file must end with an empty line
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 source $top_srcdir/testsuite/lib/mailutils.exp
21
22 mu_init
23
24 proc mailbox_run {args} {
25 global verbose
26 global expect_out
27
28 set sw ""
29 for {set i 0} {$i < [llength $args]} {incr i} {
30 set a [lindex $args $i]
31 if {"$a" == "-mail-spool"} {
32 if [info exists host_board] {
33 if [board_info $host_board exists top_srcdir] {
34 append sw "--set mailbox.mail-spool=\"'[board_info $host_board top_srcdir]/mail/testsuite/spool'\""
35 }
36 }
37 if {![info exists init_spool]} {
38 set init_spool 1
39 }
40 } elseif {"$a" == "-reuse-spool"} {
41 set init_spool 0
42 } else {
43 break
44 }
45 }
46
47 if [info exists init_spool] {
48 mu_prepare_spools
49 }
50
51 set args "[lrange $args $i end] $sw"
52
53 verbose "Spawning $args"
54
55 set res [remote_spawn host $args]
56 if { $res < 0 || $res == "" } {
57 perror "Spawning $args failed."
58 return 1;
59 }
60
61 return 0
62 }
63
64 proc mailbox_send { string } {
65 return [mu_send "$string"]
66 }
67
68 # mailbox_test [-message MESSAGE][-default (FAIL|XFAIL)]
69 # COMMAND [-pattern PATTERN-LIST][PATTERN...]
70 # COMMAND - Command to send.
71 # PATTERN - Sequence to expect in return.
72 # MESSAGE - [optional] message to output
73 proc mailbox_test { args } {
74 global verbose
75 global suppress_flag;
76 upvar timeout timeout
77
78 set default ""
79 set message ""
80 for {set i 0} {$i < [llength $args]} {incr i} {
81 set a [lindex $args $i]
82 if {"$a" == "-default"} {
83 incr i
84 set default [lindex $args $i]
85 } elseif {"$a" == "-message"} {
86 incr i
87 set message [lindex $args $i]
88 } elseif {"$a" == "-pattern"} {
89 incr i
90 set pattern [lindex $args $i]
91 } else {
92 set args [lrange $args $i end]
93 break
94 }
95 }
96
97 if {"$message" == ""} {
98 set message [lindex $args 0]
99 }
100
101 if $verbose>2 then {
102 send_user "Message is \"$message\"\n"
103 }
104 set command [lindex $args 0]
105 if {[llength $args] >= 2} {
106 set pattern [lrange $args 1 end]
107 }
108
109 if [info exists pattern] {
110 set result [mu_test $command $pattern]
111 } else {
112 set result [mu_test $command]
113 }
114
115 if {$result == 0} {
116 pass "$message"
117 } elseif {$result == 1} {
118 if { "$default" == "" || "$default" != "FAIL" } {
119 fail "$message"
120 } else {
121 xfail "$message"
122 set result 0
123 }
124 } elseif {$result == -2} {
125 fail "$message (timeout)"
126 } elseif {$result == -3} {
127 fail "$message (eof)"
128 } else {
129 fail "$message"
130 }
131 return $result
132 }
133
134 proc mailbox_prog_start {cmd} {
135 global verbose
136 global MU_TOOL
137 global MU_TOOL_FLAGS
138 global mailbox_prog_prompt
139 global expect_out
140 global mailbox_spawn_id
141
142 verbose "Spawning $cmd"
143
144 set mailbox_spawn_id [remote_spawn host $cmd]
145 if { $mailbox_spawn_id < 0 || $mailbox_spawn_id == "" } {
146 perror "Spawning $cmd failed."
147 return 1;
148 }
149
150 mu_expect 360 {
151 -re "\[\r\n\]?${mailbox_prog_prompt}$" {
152 verbose "program initialized."
153 }
154 default {
155 perror "program not initialized"
156 return 1
157 }
158 }
159 return 0
160 }
161
162 proc mailbox_prog_send { string } {
163 return [mu_send "$string"]
164 }
165
166 proc mailbox_prog_command { cmd } {
167 return [mu_command $cmd]
168 }
169
170 proc mailbox_prog_stop {} {
171 verbose "Stopping program"
172 remote_close host
173
174 }
175
176 # mailbox_prog_test [-message MESSAGE][-default (FAIL|XFAIL)][-noprompt]
177 # COMMAND PATTERN [PATTERN...]
178 # COMMAND - Command to send.
179 # PATTERN - Sequence to expect in return.
180 # MESSAGE - [optional] message to output
181 proc mailbox_prog_test { args } {
182 global verbose
183 global mailbox_prog_prompt
184 global suppress_flag;
185 upvar timeout timeout
186
187 set default ""
188 set message ""
189 set wait_for_prompt 1
190 for {set i 0} {$i < [llength $args]} {incr i} {
191 set a [lindex $args $i]
192 if {"$a" == "-default"} {
193 set default [lindex $args [expr $i + 1]]
194 incr i
195 } elseif {"$a" == "-message"} {
196 set message [lindex $args [expr $i + 1]]
197 incr i
198 } elseif {"$a" == "-noprompt"} {
199 set wait_for_prompt 0
200 } else {
201 set args [lrange $args $i end]
202 break
203 }
204 }
205
206 if {"$message" == ""} {
207 set message [lindex $args 0]
208 }
209
210 if $verbose>2 then {
211 send_user "Message is \"$message\"\n"
212 }
213 set command [lindex $args 0]
214 set pattern [lrange $args 1 end]
215 set result [mu_test $command $pattern]
216 if {$wait_for_prompt} {
217 mu_expect 30 {
218 -re "\[\r\n\]?${mailbox_prog_prompt}$" {}
219 default {
220 perror "prog not initialized"
221 return 1
222 }
223 }
224 }
225
226 if {$result == 0} {
227 pass "$message"
228 } elseif {$result == 1} {
229 if { "$default" == "" || "$default" != "FAIL" } {
230 fail "$message"
231 } else {
232 xfail "$message"
233 set result 0
234 }
235 } elseif {$result == -2} {
236 fail "$message (timeout)"
237 } elseif {$result == -3} {
238 fail "$message (eof)"
239 } else {
240 fail "$message"
241 }
242 return $result
243 }
1 address.exp
2 argcv.exp
3 base64.exp
4 decode2047.exp
5 encode2047.exp
6 list.exp
7 mailcap.exp
8 mime.exp
9 url.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mailbox_run ${top_builddir}/examples/addr
21
22 set chan [open ${srcdir}/Addrs r]
23
24 set command ""
25 for {gets $chan line} {![eof $chan]} {gets $chan line} {
26 switch -regexp -- "$line" {
27 "^#.*" { }
28 "^[^ \t].*=>.*" {
29 regexp "(.*)=>.*" $line dummy command
30 set pattern [list $line]
31 }
32 "^\$" {
33 if {$command != ""} {
34 mailbox_test -pattern $pattern $command
35 set command ""
36 }
37 }
38 default {
39 if [info exist pattern] {
40 set pattern [concat $pattern [list $line]]
41 }
42 }
43 }
44 }
45
46 close $chan
47
48 # end of address.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mailbox_run ${top_builddir}/examples/argcv
21
22 set chan [open ${srcdir}/Argcv r]
23
24 set command ""
25 set message ""
26 for {gets $chan line} {![eof $chan]} {gets $chan line} {
27 switch -regexp -- "$line" {
28 "^#.*" { }
29 "^[ \t]*\$" { }
30 "message:" {
31 regexp "message:\[ \t\]*(.*)" $line dummy message
32 }
33 default {
34 if {$command == ""} {
35 set command $line
36 } else {
37 if {$message != ""} {
38 mailbox_test -message $message -pattern [list $line] $command
39 set message ""
40 } else {
41 mailbox_test -pattern [list $line] $command
42 }
43 set command ""
44 }
45 }
46 }
47 }
48
49 if {$command != ""} {
50 fail "Malformed input file ${srcdir}/Argcv"
51 }
52
53 close $chan
54
55 # end of argcv.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 set MU_TOOL ${top_builddir}/examples/base64
21 set MU_TOOL_FLAGS ""
22
23 mu_exec -message "encode" -arg -i${srcdir}/Encode \
24 "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4"\
25 "OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx"\
26 "cnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmq"\
27 "q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj"\
28 "5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="
29
30 ## Expect chokes on binary data, so let's switch base64 to printable
31 ## octal output.
32 ## The -l0 option ensures that the output is not split by inserting
33 ## additional newlines.
34 mu_exec -message "decode" -arg -i${srcdir}/Decode -arg -dpl0 \
35 "\\000\\001\\002\\003\\004\\005\\006\\007\\010\\011\\012\\013\\014\\015\\016\\017\\020\\021\\022\\023\\024\\025\\026\\027\\030\\031\\032\\033\\034\\035\\036\\037 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\[\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\177\\200\\201\\202\\203\\204\\205\\206\\207\\210\\211\\212\\213\\214\\215\\216\\217\\220\\221\\222\\223\\224\\225\\226\\227\\230\\231\\232\\233\\234\\235\\236\\237\\240\\241\\242\\243\\244\\245\\246\\247\\250\\251\\252\\253\\254\\255\\256\\257\\260\\261\\262\\263\\264\\265\\266\\267\\270\\271\\272\\273\\274\\275\\276\\277\\300\\301\\302\\303\\304\\305\\306\\307\\310\\311\\312\\313\\314\\315\\316\\317\\320\\321\\322\\323\\324\\325\\326\\327\\330\\331\\332\\333\\334\\335\\336\\337\\340\\341\\342\\343\\344\\345\\346\\347\\350\\351\\352\\353\\354\\355\\356\\357\\360\\361\\362\\363\\364\\365\\366\\367\\370\\371\\372\\373\\374\\375\\376\\377"
36
37 # End of base64.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2003, 2006, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mailbox_run ${top_builddir}/examples/decode2047 -p
21
22 set chan [open ${srcdir}/Decode2047 r]
23
24 set command ""
25 for {gets $chan line} {![eof $chan]} {gets $chan line} {
26 switch -regexp -- "$line" {
27 "^#.*" { }
28 "^[^ \t].*=>.*" {
29 regexp "(.*)=>.*" $line dummy command
30 set pattern [list $line]
31 }
32 "^\$" {
33 if {$command != ""} {
34 verbose "COMMAND $command"
35 verbose "PATTERN $pattern"
36 mailbox_test -pattern $pattern $command
37 set command ""
38 }
39 }
40 default {
41 if [info exist pattern] {
42 set pattern [concat $pattern [list $line]]
43 }
44 }
45 }
46 }
47
48 close $chan
49
50 # end of decode2047.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mailbox_run ${top_builddir}/examples/encode2047
21
22 set chan [open ${srcdir}/Encode2047 r]
23
24 set command ""
25 set message ""
26 for {gets $chan line} {![eof $chan]} {gets $chan line} {
27 switch -regexp -- "$line" {
28 "^#.*" { }
29 "-message.*" {
30 regexp -- "-message (.*)" $line dummy message
31 }
32 "^\\\\\[^\\\\\]" {
33 mu_command $line
34 }
35 "^[^ \t].*=>.*" {
36 regexp "(.*)=>.*" $line dummy command
37 set pattern [list $line]
38 }
39 "^\$" {
40 if {$command != ""} {
41 verbose "COMMAND $command"
42 verbose "PATTERN $pattern"
43 if {$message != ""} {
44 mailbox_test -message $message -pattern $pattern $command
45 } else {
46 mailbox_test -pattern $pattern $command
47 }
48 set command ""
49 set message ""
50 }
51 }
52 default {
53 if [info exist pattern] {
54 set pattern [concat $pattern [list $line]]
55 }
56 }
57 }
58 }
59
60 close $chan
61
62 # end of encode2037.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2003, 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 set current_text [list "NULL" "NULL" "NULL" "NULL"]
21 set current_iter 0
22
23 proc make_promt {} {
24 global current_iter
25 global current_text
26 global mailbox_prog_prompt
27
28 set mailbox_prog_prompt "${current_iter}:\\([lindex $current_text $current_iter]\\)> "
29 }
30
31 proc prompt_text {text} {
32 global current_iter
33 global current_text
34
35 set current_text [lreplace $current_text $current_iter $current_iter $text]
36 make_promt
37 }
38
39 proc prompt_iterator {iter} {
40 global current_iter
41
42 set current_iter $iter
43 make_promt
44 }
45
46 prompt_iterator 0
47 prompt_text "NULL"
48
49 mailbox_prog_start "${top_builddir}/examples/listop"
50
51 mailbox_prog_command "add en to tre fire fem"
52 mailbox_prog_test "print" \
53 "# items: 5" \
54 "en" \
55 "to" \
56 "tre" \
57 "fire" \
58 "fem"
59
60 prompt_text "en"
61 mailbox_prog_test "next"
62
63 prompt_text "tre"
64 mailbox_prog_test "next 2"
65
66 prompt_iterator 1
67 prompt_text "en"
68 mailbox_prog_test "iter 1"
69
70 prompt_text "to"
71 mailbox_prog_test "find to"
72
73 mailbox_prog_test "del tre fire"
74
75 prompt_text "fem"
76 mailbox_prog_test "next"
77
78 prompt_iterator 0
79 prompt_text "fem"
80 mailbox_prog_test "iter 0"
81 mailbox_prog_test "print" \
82 "# items: 3" \
83 "en" \
84 "to" \
85 "fem"
86
87 mailbox_prog_command "prep jeden dwa trzy cztery"
88
89 mailbox_prog_test "print" \
90 "# items: 7" \
91 "cztery" \
92 "trzy" \
93 "dwa" \
94 "jeden" \
95 "en" \
96 "to" \
97 "fem"
98
99 prompt_text "cztery"
100 mailbox_prog_test "first"
101
102 prompt_text "trzy"
103 mailbox_prog_test "del cztery"
104
105 prompt_text "3"
106 mailbox_prog_test "repl trzy 3"
107
108 prompt_iterator 1
109 mailbox_prog_test "iter 1"
110
111 prompt_text "3"
112 mailbox_prog_test "next 2"
113
114 mailbox_prog_command "ins jeden un"
115 mailbox_prog_test "print" \
116 "# items: 7" \
117 "3" \
118 "dwa" \
119 "jeden" \
120 "un" \
121 "en" \
122 "to" \
123 "fem"
124
125 mailbox_prog_command "ins before jeden zero"
126 mailbox_prog_test "print" \
127 "# items: 8" \
128 "3" \
129 "dwa" \
130 "zero" \
131 "jeden" \
132 "un" \
133 "en" \
134 "to" \
135 "fem"
136
137 prompt_text "un"
138 mailbox_prog_test "find un"
139
140 mailbox_prog_command "ins before un cero"
141 mailbox_prog_command "ins un dos"
142
143 mailbox_prog_test "print" \
144 "# items: 10" \
145 "3" \
146 "dwa" \
147 "zero" \
148 "jeden" \
149 "cero" \
150 "un" \
151 "dos" \
152 "en" \
153 "to" \
154 "fem"
155
156 mailbox_prog_command "ins before 3 1"
157 mailbox_prog_test "print" \
158 "# items: 11" \
159 "1" \
160 "3" \
161 "dwa" \
162 "zero" \
163 "jeden" \
164 "cero" \
165 "un" \
166 "dos" \
167 "en" \
168 "to" \
169 "fem"
170
171 mailbox_prog_command "ins before 3 2"
172 mailbox_prog_test "print" \
173 "# items: 12" \
174 "1" \
175 "2" \
176 "3" \
177 "dwa" \
178 "zero" \
179 "jeden" \
180 "cero" \
181 "un" \
182 "dos" \
183 "en" \
184 "to" \
185 "fem"
186
187 mailbox_prog_command "ins 3 4 5 6"
188 mailbox_prog_test "print" \
189 "# items: 15" \
190 "1" \
191 "2" \
192 "3" \
193 "4" \
194 "5" \
195 "6" \
196 "dwa" \
197 "zero" \
198 "jeden" \
199 "cero" \
200 "un" \
201 "dos" \
202 "en" \
203 "to" \
204 "fem"
205
206 mailbox_prog_command "ins before dwa zero jeden"
207 mailbox_prog_test "print" \
208 "# items: 17" \
209 "1" \
210 "2" \
211 "3" \
212 "4" \
213 "5" \
214 "6" \
215 "zero" \
216 "jeden" \
217 "dwa" \
218 "zero" \
219 "jeden" \
220 "cero" \
221 "un" \
222 "dos" \
223 "en" \
224 "to" \
225 "fem"
226
227 mailbox_prog_test "ictl tell" "12"
228
229 prompt_text "dos"
230 mailbox_prog_test "ictl del"
231
232 prompt_text "dos"
233 mailbox_prog_test "next"
234
235 mailbox_prog_test "print" \
236 "# items: 16" \
237 "1" \
238 "2" \
239 "3" \
240 "4" \
241 "5" \
242 "6" \
243 "zero" \
244 "jeden" \
245 "dwa" \
246 "zero" \
247 "jeden" \
248 "cero" \
249 "dos" \
250 "en" \
251 "to" \
252 "fem"
253
254 mailbox_prog_test "ictl ins seis"
255
256 mailbox_prog_test "print" \
257 "# items: 17" \
258 "1" \
259 "2" \
260 "3" \
261 "4" \
262 "5" \
263 "6" \
264 "zero" \
265 "jeden" \
266 "dwa" \
267 "zero" \
268 "jeden" \
269 "cero" \
270 "dos" \
271 "seis" \
272 "en" \
273 "to" \
274 "fem"
275
276 mailbox_prog_test "ictl ins tres quatro cinco"
277
278 mailbox_prog_test "print" \
279 "# items: 20" \
280 "1" \
281 "2" \
282 "3" \
283 "4" \
284 "5" \
285 "6" \
286 "zero" \
287 "jeden" \
288 "dwa" \
289 "zero" \
290 "jeden" \
291 "cero" \
292 "dos" \
293 "tres" \
294 "quatro" \
295 "cinco" \
296 "seis" \
297 "en" \
298 "to" \
299 "fem"
300
301 prompt_text "tres"
302 mailbox_prog_test "next"
303
304 mailbox_prog_test "ictl dir" "forwards"
305
306 mailbox_prog_test "ictl dir backwards"
307
308 prompt_text "dos"
309 mailbox_prog_test "next"
310
311 prompt_text "dwa"
312 mailbox_prog_test "next 4"
313
314 prompt_text "jeden"
315 mailbox_prog_test "ictl del"
316
317 mailbox_prog_test "next"
318
319 prompt_text "zero"
320 mailbox_prog_test "next"
321
322 mailbox_prog_test "ictl dir forwards"
323
324 prompt_text "jeden"
325 mailbox_prog_test "next"
326
327 mailbox_prog_send "quit"
328 mailbox_prog_stop
329
330 # End of list.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mu_prepare_spools
21
22 set mailcapfile ${MU_DATA_DIR}/mailcap
23 set chan [open ${srcdir}/Mailcap r]
24 set outchan [open "$mailcapfile" w]
25
26 set command ""
27 set state 0
28 set entry 0
29 set pattern [list]
30
31 for {gets $chan line} {![eof $chan]} {gets $chan line} {
32 if {$state == 0} {
33 switch -regexp -- "$line" {
34 "^#.*" { }
35 "^entry" {
36 set state 1
37 incr entry
38 lappend pattern "entry\[${entry}\]"
39 }
40 default {
41 puts $outchan $line
42 }
43 }
44 } else {
45 switch -regexp -- "$line" {
46 "^#.*" { }
47 "^\$" {
48 lappend pattern ""
49 set state 0
50 }
51 default {
52 lappend pattern $line
53 }
54 }
55 }
56 }
57
58 if {$state == 1} {
59 lappend pattern ""
60 }
61
62 close $outchan
63 close $chan
64
65 set MU_TOOL ${top_builddir}/examples/mailcap
66 set MU_TOOL_FLAGS ""
67
68 verbose "INVOKE $pattern"
69 eval mu_exec -message "mailcap" -arg "$mailcapfile" $pattern
70
71 # end of mailcap.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 set MU_TOOL "${top_builddir}/examples/mimetest"
21 set MU_TOOL_FLAGS "-i 0 -p $MU_SPOOL_DIR/mbox1"
22
23 mu_prepare_spools
24
25 set chan [open ${srcdir}/Mime r]
26
27 set pattern [list]
28 for {gets $chan line} {![eof $chan]} {gets $chan line} {
29 switch -regexp -- "$line" {
30 "^#.*" { }
31 default { set pattern [concat $pattern [list $line]] }
32 }
33 }
34
35 mu_exec -retcode 0 -message "MIME" -pattern $pattern
36
37 close $chan
38
39 # end of mime.exp
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 mailbox_run ${top_builddir}/examples/url-parse
21
22 set chan [open ${srcdir}/Urls r]
23
24 set command ""
25 for {gets $chan line} {![eof $chan]} {gets $chan line} {
26 verbose "LINE: $line"
27 switch -regexp -- "$line" {
28 "^#.*" { }
29 "^[^ \t].*=>.*" {
30 regexp "(.*\[^ \t\])\[ \t\]*=>.*" $line dummy command
31 verbose "COMMAND: \"$command\""
32 set pattern [list $line]
33 }
34 "^\$" {
35 if {$command != ""} {
36 mailbox_test -pattern $pattern $command
37 set command ""
38 }
39 }
40 default {
41 set pattern [concat $pattern [list $line]]
42 }
43 }
44 }
45
46 close $chan
47
48 # end of url.exp
...@@ -23,7 +23,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) ...@@ -23,7 +23,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
23 ## ------------ ## 23 ## ------------ ##
24 24
25 $(srcdir)/package.m4: $(top_srcdir)/configure.ac 25 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
26 { \ 26 $(AM_V_GEN) { \
27 echo '# Signature of the current package.'; \ 27 echo '# Signature of the current package.'; \
28 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ 28 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
29 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ 29 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
16 # This file is part of Mailfromd testsuite. 16 # This file is part of Mailfromd testsuite.
17 17
18 # Require a reasonably recent autotest. 18 # Require a reasonably recent autotest.
19 m4_version_prereq([2.52g])
20 m4_include([testsuite.inc]) 19 m4_include([testsuite.inc])
21 20
22 dnl ------------------------------------------------------------ 21 dnl ------------------------------------------------------------
......
...@@ -24,7 +24,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) ...@@ -24,7 +24,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
24 ## ------------ ## 24 ## ------------ ##
25 25
26 $(srcdir)/package.m4: $(top_srcdir)/configure.ac 26 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
27 { \ 27 $(AM_V_GEN) { \
28 echo '# Signature of the current package.'; \ 28 echo '# Signature of the current package.'; \
29 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ 29 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
30 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ 30 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. 15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite. 16 # This file is part of Mailfromd testsuite.
17 17
18 # Require a reasonably recent autotest. 18 m4_include([testsuite.inc])
19 m4_version_prereq([2.52g])
20 19
21 dnl ------------------------------------------------------------ 20 dnl ------------------------------------------------------------
22 dnl testcompile(SCRIPT) -- test compilation of the Sieve SCRIPT 21 dnl testcompile(SCRIPT) -- test compilation of the Sieve SCRIPT
......
...@@ -15,6 +15,6 @@ ...@@ -15,6 +15,6 @@
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. 15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite. 16 # This file is part of Mailfromd testsuite.
17 17
18 m4_include([testsuite.inc]) 18 dnl m4_include([testsuite.inc])
19 19
20 MUT_VERSION(sieve) 20 MUT_VERSION(sieve)
......
...@@ -15,6 +15,11 @@ ...@@ -15,6 +15,11 @@
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. 15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite. 16 # This file is part of Mailfromd testsuite.
17 17
18 # Require a reasonably recent autotest.
19 m4_version_prereq([2.52g])
20
21 m4_define([AT_SKIP_TEST],[exit 77])
22
18 dnl ------------------------------------------------------------ 23 dnl ------------------------------------------------------------
19 dnl MUT_VERSION(TOOL) -- checks the version output from TOOL 24 dnl MUT_VERSION(TOOL) -- checks the version output from TOOL
20 dnl 25 dnl
...@@ -38,5 +43,3 @@ _EOT ...@@ -38,5 +43,3 @@ _EOT
38 AT_CLEANUP 43 AT_CLEANUP
39 ]) 44 ])
40 45
41 m4_define([AT_SKIP_TEST],[exit 77])
42
......