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 1035 additions and 2099 deletions
......@@ -1211,7 +1211,9 @@ AC_ARG_WITH([mh-bindir],
# Initialize the (autotest) test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([frm/tests/Makefile
AC_CONFIG_FILES([libmailutils/tests/Makefile
libmailutils/tests/atlocal
frm/tests/Makefile
frm/tests/atlocal
readmsg/tests/Makefile
readmsg/tests/atlocal
......@@ -1362,7 +1364,6 @@ AC_CONFIG_FILES([
mail/Makefile
mail/testsuite/Makefile
libmailutils/Makefile
libmailutils/testsuite/Makefile
messages/Makefile
messages/testsuite/Makefile
mh/Makefile
......
......@@ -35,18 +35,13 @@ SUBDIRS = config $(CPP_DIR) python scheme
noinst_PROGRAMS = \
aclck\
addr\
argcv\
base64\
decode2047\
echosrv\
encode2047\
header\
http\
iconv\
listop\
lsf\
mailcap\
mimetest\
msg-send\
mta\
mucat\
......@@ -56,8 +51,7 @@ noinst_PROGRAMS = \
musocio\
$(NNTPCLIENT)\
$(POP3CLIENT)\
sfrom\
url-parse
sfrom
EXTRA_PROGRAMS = pop3client nntpclient
......@@ -79,15 +73,6 @@ numaddr_la_SOURCES = numaddr.c
numaddr_la_LIBADD = ${MU_LIB_SIEVE}
numaddr_la_LDFLAGS = -module -avoid-version -no-undefined -rpath '$(moddir)'
mimetest_LDADD =\
../lib/libmuaux.la\
${MU_LIB_MBOX}\
${MU_LIB_IMAP}\
${MU_LIB_POP}\
${MU_LIB_AUTH}\
@MU_AUTHLIBS@\
${MU_LIB_MAILUTILS}
msg_send_LDADD =\
../lib/libmuaux.la\
${MU_LIB_MAILER}\
......
......@@ -23,7 +23,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
## ------------ ##
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
{ \
$(AM_V_GEN){ \
echo '# Signature of the current package.'; \
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
......
......@@ -15,10 +15,7 @@
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
# Require a reasonably recent autotest.
m4_version_prereq([2.52g])
m4_define([AT_SKIP_TEST],[exit 77])
m4_include([testsuite.inc])
dnl ------------------------------------------------------------
dnl FRM_MAILBOX -- mailbox used for testing
......@@ -47,8 +44,6 @@ AT_INIT
AT_TESTED([frm])
m4_include([testsuite.inc])
MUT_VERSION(frm)
FRMTEST([no options],[frm00],
......
......@@ -20,7 +20,7 @@
BUILT_SOURCES=errno.h debug.h
EXTRA_DIST=errno.hin debug.hm4 types.hin
errno.h: $(top_srcdir)/mailbox/errors errno.hin
errno.h: $(top_srcdir)/libmailutils/errors errno.hin
$(AM_V_GEN)$(AWK) -f $(mu_aux_dir)/generr.awk $^ > $@
debug.h: $(mu_aux_dir)/debugdef.m4 debug.hm4
......
......@@ -24,7 +24,7 @@ YLWRAP = $(SHELL) $(mu_aux_dir)/gylwrap
AM_YFLAGS=-vt
AM_LFLAGS=-dvp
SUBDIRS = testsuite
SUBDIRS = tests
lib_LTLIBRARIES = libmailutils.la
......
# This file is part of GNU Mailutils.
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4
DISTCLEANFILES = atconfig $(check_SCRIPTS)
MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
## ------------ ##
## package.m4. ##
## ------------ ##
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
$(AM_V_GEN){ \
echo '# Signature of the current package.'; \
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
} >$(srcdir)/package.m4
#
## -------------------------- ##
## Non-installable programs
## -------------------------- ##
INCLUDES = @MU_LIB_COMMON_INCLUDES@
noinst_PROGRAMS = \
addr\
argcv\
decode2047\
encode2047\
fltst\
mailcap\
mimetest\
url-parse
LDADD =\
../../lib/libmuaux.la\
${MU_LIB_MBOX}\
${MU_LIB_IMAP}\
${MU_LIB_POP}\
${MU_LIB_AUTH}\
@MU_AUTHLIBS@\
${MU_LIB_MAILUTILS}
EXTRA_DIST += Encode Decode
## ------------ ##
## Test suite. ##
## ------------ ##
TESTSUITE_AT = \
address.at\
argcv.at\
base64d.at\
base64e.at\
decode2047.at\
encode2047.at\
mailcap.at\
mime.at\
testsuite.at\
url.at
TESTSUITE = $(srcdir)/testsuite
M4=m4
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): package.m4 $(TESTSUITE_AT)
$(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp
$(AM_V_at)mv $@.tmp $@
atconfig: $(top_builddir)/config.status
cd $(top_builddir) && ./config.status tests/$@
clean-local:
@test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
check-local: atconfig atlocal $(TESTSUITE)
@$(SHELL) $(TESTSUITE)
# Run the test suite on the *installed* tree.
#installcheck-local:
# $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2010 Free Software
Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Mailutils is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Mailutils; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <mailutils/address.h>
#include <mailutils/errno.h>
#include <mailutils/kwd.h>
#include <mailutils/mutil.h>
#define EPARSE MU_ERR_NOENT
int
main (int argc, char *argv[])
{
char *str;
size_t i;
size_t pcount = 0;
int status;
const char *buf;
mu_address_t address = NULL;
struct mu_address hint;
if (argc != 2)
{
fprintf (stderr, "usage: %s address\n", argv[0]);
return 2;
}
str = argv[1];
hint.domain = "localhost";
status = mu_address_create_hint (&address, str, &hint, MU_ADDR_HINT_DOMAIN);
mu_address_get_count (address, &pcount);
if (status)
{
fprintf (stderr, "%s\n", mu_errname (status));
return 1;
}
else
printf ("naddr: %lu\n", (unsigned long) pcount);
for (i = 1; i <= pcount; i++)
{
int isgroup;
mu_address_is_group (address, i, &isgroup);
printf ("%lu. ", (unsigned long) i);
if (isgroup)
{
mu_address_sget_personal (address, i, &buf);
printf ("group <%s>:\n", buf);
}
else
{
mu_address_sget_email (address, i, &buf);
printf ("email <%s>:\n", buf);
}
if (mu_address_sget_personal (address, i, &buf) == 0 && buf && !isgroup)
printf ("personal <%s>\n", buf);
if (mu_address_sget_comments (address, i, &buf) == 0 && buf)
printf ("comments <%s>\n", buf);
if (mu_address_sget_local_part (address, i, &buf) == 0 && buf)
{
printf ("local-part <%s>", buf);
if (mu_address_sget_domain (address, i, &buf) == 0 && buf)
printf (" domain <%s>", buf);
printf ("\n");
}
if (mu_address_sget_route (address, i, &buf) == 0 && buf)
printf ("route <%s>\n", buf);
}
mu_address_destroy (&address);
return 0;
}
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
dnl ------------------------------------------------------------
dnl TESTARGS([NAME], [KW = `'], [INPUT], [STDOUT = `'],
dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
dnl
m4_define([TESTARGS],[
AT_SETUP([Argcv: $1])
AT_KEYWORDS([argcv $2])
AT_CHECK([
AT_DATA([input],[$3
])
argcv < input],[0],m4_shift(m4_shift(m4_shift($@))))
AT_CLEANUP
])
dnl ------------------------------------------------------------
TESTARGS([simple input],[],
[1 2 3],
[3: 1 2 3
])
TESTARGS([quoted space],[],
[quoted\ space],
[1: "quoted space"
])
TESTARGS([tab character],[],
[a "tab character"],
[2: a tab\tcharacter
])
TESTARGS([octal and hex escapes],[],
[\157\143\164\141\154\40and\x20\x68\x65\x78],
[1: "octal and hex"
])
TESTARGS([octal and hex escapes 2],[],
[\157\143\164\141\154\40 and \x20\x68\x65\x78],
[3: "octal " and " hex"
])
TESTARGS([escape representation],[],
[A\x3-\48\39],
[1: A\003-\0048\0039
])
TESTARG([8-bit input],[],
[×ÅÒÈÎÑÑ ÐÏÌÏ×ÉÎÁ ÔÁÂÌÉÃÙ],
[3: \327\305\322\310\316\321\321 \320\317\314\317\327\311\316\301 \324\301\302\314\311\303\331])
TESTARG([misquoted input],[],
[messed up'quotations ' in "a single'" "command" lin"e],
[6: messed "upquotations " in "a single'" command "lin\"e"
])
TESTARG([unbalanced quote],[],
['unbalanced "quote],
[2: 'unbalanced "\"quote"
])
TESTARG([unbalanced quote 2],[],
[unbalanced "quote],
[2: unbalanced "\"quote"
])
TESTARG([unbalanced quote 3],[],
["],
[1: "\""
])
# @configure_input@ -*- shell-script -*-
# Configurable variable values for Mailutils test suite.
# Copyright (C) 2004, 2010 Free Software Foundation, Inc.
PATH=@abs_builddir@:@abs_top_builddir@/frm:$top_srcdir:$srcdir:$PATH
top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
\ No newline at end of file
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
AT_SETUP([base64 decoding (read)])
AT_KEYWORDS([base64 base64d base64dr decode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Encode expout
fltst base64 decode read linelen=0 < $top_srcdir/libmailutils/tests/Decode],
[0],
[expout])
AT_CLEANUP
AT_SETUP([base64 decoding (write)])
AT_KEYWORDS([base64 base64d base64dw decode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Encode expout
fltst base64 decode write linelen=0 < $top_srcdir/libmailutils/tests/Decode],
[0],
[expout])
AT_CLEANUP
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
AT_SETUP([base64 encoding (read)])
AT_KEYWORDS([base64 base64e base64er encode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Decode expout
fltst base64 encode read nl < $top_srcdir/libmailutils/tests/Encode],
[0],
[expout])
AT_CLEANUP
AT_SETUP([base64 encoding (write)])
AT_KEYWORDS([base64 base64e base64ew encode])
AT_CHECK([
cp $top_srcdir/libmailutils/tests/Decode expout
fltst base64 encode write nl < $top_srcdir/libmailutils/tests/Encode],
[0],
[expout])
AT_CLEANUP
\ No newline at end of file
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
dnl ------------------------------------------------------------
dnl TESTDEC2047([NAME], [KW = `'], [INPUT], [STDOUT = `'],
dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
dnl
m4_define([TESTDEC2047],[
AT_SETUP([Decode 2047: m4_if([$1],[],[$3],[$1])])
AT_KEYWORDS([decode2047 decode $2])
AT_CHECK([
AT_DATA([input],[$3
])
decode2047 -p < input],[0],m4_shift(m4_shift(m4_shift($@))))
AT_CLEANUP
])
dnl ------------------------------------------------------------
TESTDEC2047([],[decode01],
[=?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>],
[Keith Moore <moore@cs.utk.edu>
])
TESTDEC2047([],[decode02],
[=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>],
[Keld J\370rn Simonsen <keld@dkuug.dk>
])
TESTDEC2047([],[decode03],
[=?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be>],
[Andr\351 Pirard <PIRARD@vm1.ulg.ac.be>
])
TESTDEC2047([],[decode04],
[=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= ... =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=],
[If you can read this yo ... u understand the example.
])
# Malformed input string: lacks trailing =. MU 0.6.90 hanged on it.
TESTDEC2047([malformed input],[decode05],
[=?koi8-r?B?RndkOiDSxcfJ09TSwcPJ0SDEz83FzsE?=],
[Fwd: \322\305\307\311\323\324\322\301\303\311\321 \304\317\315\305
])
......@@ -71,8 +71,9 @@ main (int argc, char *argv[])
if (len > 0 && buf[len - 1] == '\n')
buf[len - 1] = 0;
rc = mu_rfc2047_decode (charset, buf, &p);
printf ("%s=> %s\n", buf, mu_strerror (rc));
if (p)
if (rc)
fprintf (stderr, "%s", mu_strerror (rc));
else if (p)
print (p, printable);
putchar ('\n');
free (p);
......
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
AT_SETUP([encode2047])
AT_KEYWORDS([encode])
AT_CHECK([
AT_DATA(input,[dnl
\\345\326\305\304\316\305\327\316\331\312\040\317\324\336\305\324
])
encode2047 -c koi8-r -eB -o < input],
[0],
[=?koi8-r?B?5dbFxM7F187ZyiDP1N7F1A==?=
])
AT_CLEANUP
......@@ -197,8 +197,9 @@ main (int argc, char *argv[])
decode_octal (cmd);
rc = mu_rfc2047_encode (charset, encoding, cmd, &p);
printf ("%s=> %s\n", buf, mu_strerror (rc));
if (p)
if (rc)
fprintf (stderr, "%s", mu_strerror (rc));
else if (p)
printf ("%s\n", p);
free (p);
}
......
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2005, 2007, 2010 Free Software
Foundation, Inc.
GNU Mailutils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GNU Mailutils is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Mailutils; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
#include <string.h>
#include <mailutils/mailutils.h>
#define ISPRINT(c) ((c)>=' '&&(c)<127)
int verbose = 0;
int printable = 0;
static void
c_copy (mu_stream_t out, mu_stream_t in)
{
if (printable)
{
char c;
size_t size;
while (mu_stream_read (in, &c, 1, &size) == 0 && size > 0)
{
int rc;
if (printable && !ISPRINT (c))
{
char outbuf[24];
sprintf (outbuf, "\\%03o", (unsigned char) c);
rc = mu_stream_write (out, outbuf, strlen (outbuf), NULL);
}
else
rc = mu_stream_write (out, &c, 1, NULL);
}
}
else
MU_ASSERT (mu_stream_copy (out, in, 0, NULL));
if (verbose)
fprintf (stderr, "\ntotal: %lu/%lu bytes\n",
(unsigned long) mu_stream_bytes_in (in),
(unsigned long) mu_stream_bytes_out (out));
}
/* Set the maximum line length for the filter NAME to LENGTH.
FIXME: This is a kludge. Perhaps API should provide a function
for that. */
static void
reset_line_length (const char *name, size_t length)
{
mu_list_t list;
int status;
mu_filter_record_t frec;
mu_filter_get_list (&list);
status = mu_list_locate (list, (void*)name, (void**)&frec);
if (status == 0)
frec->max_line_length = length;
/* don't bail out, leave that to mu_filter_create */
}
void
usage (const char *diag)
{
FILE *fp;
if (diag)
{
fp = stderr;
fprintf (fp, "%s\n", diag);
}
else
fp = stdout;
fprintf (fp, "%s",
"usage: fltst FILTER {encode|decode} {read|write} [shift=N] [linelen=N] [verbose] [printable] [nl]\n");
exit (diag ? 1 : 0);
}
int
main (int argc, char * argv [])
{
mu_stream_t in, out, flt;
int i;
int mode = MU_FILTER_ENCODE;
int flags = MU_STREAM_READ;
char *fltname;
mu_off_t shift = 0;
size_t line_length;
int line_length_option = 0;
int newline_option = 0;
if (argc == 1)
usage (NULL);
if (argc < 3)
usage ("not enough arguments");
fltname = argv[1];
if (strcmp (argv[2], "encode") == 0)
mode = MU_FILTER_ENCODE;
else if (strcmp (argv[2], "decode") == 0)
mode = MU_FILTER_DECODE;
else
usage ("2nd arg is wrong");
if (strcmp (argv[3], "read") == 0)
flags = MU_STREAM_READ;
else if (strcmp (argv[3], "write") == 0)
flags = MU_STREAM_WRITE;
else
usage ("3rd arg is wrong");
for (i = 4; i < argc; i++)
{
if (strncmp (argv[i], "shift=", 6) == 0)
shift = strtoul (argv[i] + 6, NULL, 0);
else if (strncmp (argv[i], "linelen=", 8) == 0)
{
line_length = strtoul (argv[i] + 8, NULL, 10);
line_length_option = 1;
}
else if (strcmp (argv[i], "verbose") == 0)
verbose++;
else if (strcmp (argv[i], "printable") == 0)
printable++;
else if (strcmp (argv[i], "nl") == 0)
newline_option++;
else
usage ("wrong option");
}
MU_ASSERT (mu_stdio_stream_create (&in, MU_STDIN_FD, 0));
MU_ASSERT (mu_stream_open (in));
MU_ASSERT (mu_stdio_stream_create (&out, MU_STDOUT_FD, 0));
MU_ASSERT (mu_stream_open (out));
if (line_length_option)
reset_line_length (fltname, line_length);
if (flags == MU_STREAM_READ)
{
MU_ASSERT (mu_filter_create (&flt, in, fltname, mode,
MU_STREAM_READ|MU_STREAM_SEEK|
MU_STREAM_AUTOCLOSE));
if (shift)
MU_ASSERT (mu_stream_seek (flt, shift, MU_SEEK_SET, NULL));
c_copy (out, flt);
}
else
{
MU_ASSERT (mu_filter_create (&flt, out, fltname, mode,
MU_STREAM_WRITE));
if (shift)
MU_ASSERT (mu_stream_seek (in, shift, MU_SEEK_SET, NULL));
c_copy (flt, in);
mu_stream_close (in);
mu_stream_destroy (&in);
}
mu_stream_close (flt);
mu_stream_destroy (&flt);
if (newline_option)
mu_stream_write (out, "\n", 1, NULL);
mu_stream_close (out);
mu_stream_destroy (&out);
return 0;
}
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
dnl ------------------------------------------------------------
dnl MAILCAP([NAME], [KW = `'], [INPUT], [STDOUT = `'],
dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
dnl
m4_define([MAILCAP],[
AT_SETUP([Mailcap: [$1]])
AT_KEYWORDS([mailcap $2])
AT_CHECK([
AT_DATA([input],[$3
])
mailcap input],[0],m4_shift(m4_shift(m4_shift($@))))
AT_CLEANUP
])
dnl ------------------------------------------------------------
MAILCAP([1],[mailcap01],
[text/plain; less '%s'; needsterminal],
[[entry[1]
typefield: text/plain
view-command: less '%s'
fields[1]: needsterminal
]])
MAILCAP([2],[mailcap02],
[text/html; gnome-help-browser '%s'; nametemplate=%s.html; test=test -n "$DISPLAY"],
[[entry[1]
typefield: text/html
view-command: gnome-help-browser '%s'
fields[1]: nametemplate=%s.html
fields[2]: test=test -n "$DISPLAY"
]])
MAILCAP([3],[mailcap03],
[application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; \
copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
],
[[entry[1]
typefield: application/x-troff-man
view-command: /usr/bin/nroff -mandoc -Tlatin1
fields[1]: copiousoutput
fields[2]: print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
]])
MAILCAP([4],[mailcap04],
[text/plain; shownonascii iso-8859-1 '%s'; description="Plain ASCII Text"; \
test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""],
[[entry[1]
typefield: text/plain
view-command: shownonascii iso-8859-1 '%s'
fields[1]: description="Plain ASCII Text"
fields[2]: test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""
]])
MAILCAP([5],[mailcap05],
[text/richtext; shownonascii iso-8859-1 -e richtext -p '%s'; \
description="Richtext"; copiousoutput; \
test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""],
[[entry[1]
typefield: text/richtext
view-command: shownonascii iso-8859-1 -e richtext -p '%s'
fields[1]: description="Richtext"
fields[2]: copiousoutput
fields[3]: test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""
]])
MAILCAP([6],[mailcap06],
[text/enriched; shownonascii iso-8859-1 -e richtext -e -p '%s'; \
description="Enriched Text"; \
copiousoutput; \
test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""],
[[entry[1]
typefield: text/enriched
view-command: shownonascii iso-8859-1 -e richtext -e -p '%s'
fields[1]: description="Enriched Text"
fields[2]: copiousoutput
fields[3]: test=test "$(echo %{charset} | tr "A-Z" "a-z")" = iso-8859-1 -a "$DISPLAY" != ""
]])
MAILCAP([7],[mailcap07],
[message/partial; showpartial '%s' %{id} %{number} %{total}; description="An incomplete message"],
[[entry[1]
typefield: message/partial
view-command: showpartial '%s' %{id} %{number} %{total}
fields[1]: description="An incomplete message"
]])
MAILCAP([8],[mailcap08],
[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"'],
[[entry[1]
typefield: message/external-body
view-command: showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}
fields[1]: needsterminal
fields[2]: description="A reference to data stored in an external location"
fields[3]: composetyped="extcompose '%s"'
]])
MAILCAP([9],[mailcap09],
[application/x-dvi; /usr/bin/xdvi '%s'; test=test -n "$DISPLAY"; description=TeX DVI file; nametemplate=%s.dvi],
[[entry[1]
typefield: application/x-dvi
view-command: /usr/bin/xdvi '%s'
fields[1]: test=test -n "$DISPLAY"
fields[2]: description=TeX DVI file
fields[3]: nametemplate=%s.dvi
]])
MAILCAP([10],[mailcap10],
[text/plain; more '%s'; needsterminal],
[[entry[1]
typefield: text/plain
view-command: more '%s'
fields[1]: needsterminal
]])
MAILCAP([11],[mailcap11],
[text/html; /usr/bin/links '%s'; needsterminal; description=HTML Text; nametemplate=%s.html],
[[entry[1]
typefield: text/html
view-command: /usr/bin/links '%s'
fields[1]: needsterminal
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
]])
MAILCAP([12],[mailcap12],
[text/richtext; richtext '%s'; description="Richtext"; copiousoutput],
[[entry[1]
typefield: text/richtext
view-command: richtext '%s'
fields[1]: description="Richtext"
fields[2]: copiousoutput
]])
MAILCAP([13],[mailcap13],
[text/enriched; richtext -e '%s'; description="Enriched Text"; copiousoutput],
[[entry[1]
typefield: text/enriched
view-command: richtext -e '%s'
fields[1]: description="Enriched Text"
fields[2]: copiousoutput
]])
MAILCAP([14],[mailcap14],
[text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html],
[[entry[1]
typefield: text/html
view-command: /usr/bin/w3m -T text/html '%s'
fields[1]: needsterminal
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
]])
MAILCAP([15],[mailcap15],
[text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html],
[[entry[1]
typefield: text/html
view-command: /usr/bin/links -dump '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
]])
MAILCAP([16],[mailcap16],
[text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html],
[[entry[1]
typefield: text/html
view-command: /usr/bin/lynx -force_html '%s'
fields[1]: needsterminal
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
]])
MAILCAP([17],[mailcap17],
[text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html],
[[entry[1]
typefield: text/html
view-command: /usr/bin/w3m -dump -T text/html '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
]])
MAILCAP([18],[mailcap18],
[text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text],
[[entry[1]
typefield: text/html
view-command: /usr/bin/html2text '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
]])
MAILCAP([19],[mailcap19],
[text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html],
[[entry[1]
typefield: text/html
view-command: /usr/bin/lynx -dump -force_html '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
]])
MAILCAP([20],[mailcap20],
[text/*; less '%s'; needsterminal],
[[entry[1]
typefield: text/*
view-command: less '%s'
fields[1]: needsterminal
]])
MAILCAP([21],[mailcap21],
[text/*; more '%s'; needsterminal],
[[entry[1]
typefield: text/*
view-command: more '%s'
fields[1]: needsterminal
]])
MAILCAP([22],[mailcap22],
[application/x-debian-package; /usr/lib/mime/debian-view '%s'; \
needsterminal; description=Debian GNU/Linux Package; \
nametemplate=%s.deb],
[[entry[1]
typefield: application/x-debian-package
view-command: /usr/lib/mime/debian-view '%s'
fields[1]: needsterminal
fields[2]: description=Debian GNU/Linux Package
fields[3]: nametemplate=%s.deb
]])
MAILCAP([23],[mailcap23],
[audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; \
nametemplate=%s.au],
[[entry[1]
typefield: audio/basic
view-command: /usr/lib/mime/playaudio '%s'
fields[1]: description=Basic uLaw Audio
fields[2]: nametemplate=%s.au
]])
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# NOTE: Apart from this comment, the contents of this file is taken verbatim.
# Please be sure you don't add any extra newlines.
Message: 1
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
AT_SETUP([mime])
# FIXME: Mimetest should probably be fixed to avoid the use of `tr'
# and `sed' here.
AT_CHECK([mimetest -i 0 -p $top_srcdir/testsuite/spool/mbox1 | dnl
tr '\t' ' ' | sed 's/ *$//'],
[0],
[Message: 1
From: Foo Bar <foobar@nonexistent.net>
Subject: Jabberwocky
Number of parts in message - 1
......@@ -100,7 +105,7 @@ With gently smiling jaws!
End
Type of part 2 = application/octet-stream
Message part size - 645/11: 183/5, 462/6
Attachment - saving [msg.21]
Attachment - saving [[msg.21]]
Begin
`You are old, Father William,' the young man said,
`And your hair has become very white;
......@@ -141,7 +146,7 @@ Encapsulated message :
Begin
Type of part 1 = application/octet-stream
Message part size - 663/12: 184/5, 479/7
Attachment - saving [msg.22]
Attachment - saving [[msg.22]]
Begin
`You are old,' said the youth, `as I mentioned before,
And have grown most uncommonly fat;
......@@ -160,7 +165,7 @@ Encapsulated message :
Begin
Type of part 1 = application/octet-stream
Message part size - 668/12: 185/5, 483/7
Attachment - saving [msg.23]
Attachment - saving [[msg.23]]
Begin
`You are old,' said the youth, `and your jaws are too weak
For anything tougher than suet;
......@@ -175,7 +180,7 @@ Has lasted the rest of my life.'
End
Type of part 2 = application/octet-stream
Message part size - 679/12: 184/5, 495/7
Attachment - saving [msg.24]
Attachment - saving [[msg.24]]
Begin
`You are old,' said the youth, `one would hardly suppose
That your eye was as steady as ever;
......@@ -210,3 +215,6 @@ Begin
End
])
AT_CLEANUP
\ No newline at end of file
......
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#
# GNU Mailutils is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3, or (at
# your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
m4_include([testsuite.inc])
AT_INIT
m4_include([address.at])
m4_include([argcv.at])
m4_include([mime.at])
m4_include([url.at])
m4_include([mailcap.at])
m4_include([base64e.at])
m4_include([base64d.at])
m4_include([decode2047.at])
m4_include([encode2047.at])
......@@ -39,7 +39,7 @@
mu_error ("cannot get %s: %s", #field, mu_strerror (status)); \
exit (1); \
} \
printf ("\t" #field " <%s>\n", buf)
printf (#field " <%s>\n", buf)
static void
print_fvpairs (mu_url_t url)
......@@ -55,7 +55,7 @@ print_fvpairs (mu_url_t url)
if (fvc == 0)
return;
for (i = 0; i < fvc; i++)
printf ("\tparam[%lu] <%s>\n", (unsigned long) i, fvp[i]);
printf ("param[%lu] <%s>\n", (unsigned long) i, fvp[i]);
}
static void
......@@ -72,7 +72,7 @@ print_query (mu_url_t url)
if (qargc == 0)
return;
for (i = 0; i < qargc; i++)
printf ("\tquery[%lu] <%s>\n", (unsigned long) i, qargv[i]);
printf ("query[%lu] <%s>\n", (unsigned long) i, qargv[i]);
}
int
......@@ -99,18 +99,16 @@ main ()
}
if ((rc = mu_url_parse (u)) != 0)
{
printf ("%s => FAILED: [%d] %s\n",
str, rc, mu_strerror (rc));
fprintf (stderr, "%s\n", mu_errname (rc));
continue;
}
printf ("%s => SUCCESS\n", str);
GET_AND_PRINT (scheme, u, buf, rc);
GET_AND_PRINT (user, u, buf, rc);
rc = mu_url_get_secret (u, &secret);
if (rc == MU_ERR_NOENT)
printf ("\tpasswd <>\n");
printf ("passwd <>\n");
else if (rc)
{
mu_error ("cannot get %s: %s", "passwd", mu_strerror (rc));
......@@ -118,7 +116,7 @@ main ()
}
else
{
printf ("\tpasswd <%s>\n", mu_secret_password (secret));
printf ("passwd <%s>\n", mu_secret_password (secret));
mu_secret_password_unref (secret);
}
......@@ -131,7 +129,7 @@ main ()
mu_error ("cannot get %s: %s", "port", mu_strerror (rc));
exit (1);
}
printf ("\tport %ld\n", port);
printf ("port %ld\n", port);
GET_AND_PRINT (path, u, buf, rc);
print_fvpairs (u);
......
Makefile
Makefile.in
*.log
*.sum
site.exp
remote.exp
data
# This file is part of Mailutils testsuite.
# Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
1 2 3
3: 1 2 3
quoted\ space
1: "quoted space"
a "tab character"
2: a tab\tcharacter
\157\143\164\141\154\40and\x20\x68\x65\x78
1: "octal and hex"
\157\143\164\141\154\40 and \x20\x68\x65\x78
3: "octal " and " hex"
A\x3-\48\39
1: A\003-\0048\0039
# FIXME: Tcl is not able to properly handle binary data, even with
# fconfigure -binary, so I had to disable this test
#message: ASCII upper part
#×ÅÒÈÎÑÑ ÐÏÌÏ×ÉÎÁ ÔÁÂÌÉÃÙ
#3: \327\305\322\310\316\321\321 \320\317\314\317\327\311\316\301 \324\301\302\314\311\303\331
messed up'quotations ' in "a single'" "command" lin"e
6: messed "upquotations " in "a single'" command "lin\"e"
'unbalanced "quote
2: 'unbalanced "\"quote"
unbalanced "quote
2: unbalanced "\"quote"
"
1: "\""
# This file is part of Mailutils testsuite.
# Copyright (C) 2003, 2006, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
=?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu> => Success
Keith Moore <moore@cs.utk.edu>
=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk> => Success
Keld J\370rn Simonsen <keld@dkuug.dk>
=?ISO-8859-1?Q?Andr=E9?= Pirard <PIRARD@vm1.ulg.ac.be> => Success
Andr\351 Pirard <PIRARD@vm1.ulg.ac.be>
=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?= ... =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?= => Success
If you can read this yo ... u understand the example.
# Malformed input string: lacks trailing =. MU 0.6.90 hanged on it.
=?koi8-r?B?RndkOiDSxcfJ09TSwcPJ0SDEz83FzsE?= => Success
Fwd: \322\305\307\311\323\324\322\301\303
# NOTE: This file must end with an empty line
# EOF
# This file is part of Mailutils testsuite.
# Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
\ckoi8-r
\eB
\o
-message 16-bytes string
#Cyrillic: åÖÅÄÎÅ×ÎÙÊ ÏÔÞÅÔ
\\345\326\305\304\316\305\327\316\331\312\040\317\324\336\305\324=> Success
=?koi8-r?B?5dbFxM7F187ZyiDP1N7F1A==?=
# NOTE: This file must end with an empty line
# EOF
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
text/plain; less '%s'; needsterminal
entry
typefield: text/plain
view-command: less '%s'
fields[1]: needsterminal
text/html; gnome-help-browser '%s'; nametemplate=%s.html; test=test -n "$DISPLAY"
entry
typefield: text/html
view-command: gnome-help-browser '%s'
fields[1]: nametemplate=%s.html
fields[2]: test=test -n "$DISPLAY"
application/x-troff-man; /usr/bin/nroff -mandoc -Tlatin1; \
copiousoutput; print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
entry
typefield: application/x-troff-man
view-command: /usr/bin/nroff -mandoc -Tlatin1
fields[1]: copiousoutput
fields[2]: print=/usr/bin/nroff -mandoc -Tlatin1 | print text/plain:-
text/plain; shownonascii iso-8859-1 '%s'; description="Plain ASCII Text"; \
test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
entry
typefield: text/plain
view-command: shownonascii iso-8859-1 '%s'
fields[1]: description="Plain ASCII Text"
fields[2]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
text/richtext; shownonascii iso-8859-1 -e richtext -p '%s'; \
description="Richtext"; copiousoutput; \
test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
entry
typefield: text/richtext
view-command: shownonascii iso-8859-1 -e richtext -p '%s'
fields[1]: description="Richtext"
fields[2]: copiousoutput
fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
text/enriched; shownonascii iso-8859-1 -e richtext -e -p '%s'; \
description="Enriched Text"; \
copiousoutput; \
test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
entry
typefield: text/enriched
view-command: shownonascii iso-8859-1 -e richtext -e -p '%s'
fields[1]: description="Enriched Text"
fields[2]: copiousoutput
fields[3]: test=test "$(echo %{charset} | tr "[A-Z]" "[a-z]")" = iso-8859-1 -a "$DISPLAY" != ""
message/partial; showpartial '%s' %{id} %{number} %{total}; description="An incomplete message"
entry
typefield: message/partial
view-command: showpartial '%s' %{id} %{number} %{total}
fields[1]: description="An incomplete message"
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"'
entry
typefield: message/external-body
view-command: showexternal '%s' %{access-type} %{name} %{site} %{directory} %{mode} %{server}
fields[1]: needsterminal
fields[2]: description="A reference to data stored in an external location"
fields[3]: composetyped="extcompose '%s"'
application/x-dvi; /usr/bin/xdvi '%s'; test=test -n "$DISPLAY"; description=TeX DVI file; nametemplate=%s.dvi
entry
typefield: application/x-dvi
view-command: /usr/bin/xdvi '%s'
fields[1]: test=test -n "$DISPLAY"
fields[2]: description=TeX DVI file
fields[3]: nametemplate=%s.dvi
text/plain; more '%s'; needsterminal
entry
typefield: text/plain
view-command: more '%s'
fields[1]: needsterminal
text/html; /usr/bin/links '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
entry
typefield: text/html
view-command: /usr/bin/links '%s'
fields[1]: needsterminal
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
text/richtext; richtext '%s'; description="Richtext"; copiousoutput
entry
typefield: text/richtext
view-command: richtext '%s'
fields[1]: description="Richtext"
fields[2]: copiousoutput
text/enriched; richtext -e '%s'; description="Enriched Text"; copiousoutput
entry
typefield: text/enriched
view-command: richtext -e '%s'
fields[1]: description="Enriched Text"
fields[2]: copiousoutput
text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
entry
typefield: text/html
view-command: /usr/bin/w3m -T text/html '%s'
fields[1]: needsterminal
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
text/html; /usr/bin/links -dump '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
entry
typefield: text/html
view-command: /usr/bin/links -dump '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
text/html; /usr/bin/lynx -force_html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
entry
typefield: text/html
view-command: /usr/bin/lynx -force_html '%s'
fields[1]: needsterminal
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
text/html; /usr/bin/w3m -dump -T text/html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
entry
typefield: text/html
view-command: /usr/bin/w3m -dump -T text/html '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
text/html; /usr/bin/html2text '%s'; copiousoutput; description=HTML Text
entry
typefield: text/html
view-command: /usr/bin/html2text '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
text/html; /usr/bin/lynx -dump -force_html '%s'; copiousoutput; description=HTML Text; nametemplate=%s.html
entry
typefield: text/html
view-command: /usr/bin/lynx -dump -force_html '%s'
fields[1]: copiousoutput
fields[2]: description=HTML Text
fields[3]: nametemplate=%s.html
text/*; less '%s'; needsterminal
entry
typefield: text/*
view-command: less '%s'
fields[1]: needsterminal
text/*; more '%s'; needsterminal
entry
typefield: text/*
view-command: more '%s'
fields[1]: needsterminal
application/x-debian-package; /usr/lib/mime/debian-view '%s'; \
needsterminal; description=Debian GNU/Linux Package; \
nametemplate=%s.deb
entry
typefield: application/x-debian-package
view-command: /usr/lib/mime/debian-view '%s'
fields[1]: needsterminal
fields[2]: description=Debian GNU/Linux Package
fields[3]: nametemplate=%s.deb
audio/basic; /usr/lib/mime/playaudio '%s'; description=Basic uLaw Audio; \
nametemplate=%s.au
entry
typefield: audio/basic
view-command: /usr/lib/mime/playaudio '%s'
fields[1]: description=Basic uLaw Audio
fields[2]: nametemplate=%s.au
# End of Mailcap
## Process this file with GNU Automake to create Makefile.in
## Copyright (C) 2002, 2003, 2007, 2010 Free Software Foundation, Inc.
##
## GNU Mailutils is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 3, or (at
## your option) any later version.
##
## This program is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301 USA
AUTOMAKE_OPTIONS = dejagnu
DEJATOOL = mailbox
RUNTESTFLAGS =
CLEANFILES = *.log
test_dirs = lib mailbox
EXTRA_DIST = Addrs Argcv Mailcap Mime Urls Encode Decode Encode2047 Decode2047
dist-hook:
here=`cd $(top_builddir)/$(subdir) && pwd`; \
srcdir=`cd $(srcdir) && pwd`; \
distdir=`cd $(distdir) && pwd`; \
for dir in $(test_dirs); \
do \
cd $$srcdir;\
mkdir $$distdir/$$dir;\
cd $$dir;\
for file in DISTFILES `cat DISTFILES`; do \
d=$$srcdir/$$dir; \
if test -d $$d/$$file; then \
cp -pr $$d/$$file $$distdir/$$dir/$$file; \
else \
test -f $$distdir/$$dir/$$file \
|| cp -p $$d/$$file $$distdir/$$dir/$$file || exit; \
fi; \
done;\
done;\
cd $$here
site.exp: Makefile remote.exp
@echo 'Making a new site.exp file...'
@test ! -f site.bak || rm -f site.bak
@echo '## these variables are automatically generated by make ##' > $@-t
@echo '# Do not edit here. If you wish to override these values' >> $@-t
@echo '# edit the last section' >> $@-t
@echo 'set tool $(DEJATOOL)' >> $@-t
@echo "set top_srcdir `cd $(top_srcdir); pwd`" >> $@-t
@echo "set top_builddir `cd $(top_builddir); pwd`" >> $@-t
@echo "set srcdir `cd $(srcdir); pwd`" >> $@-t
@echo 'set objdir' `pwd` >> $@-t
@echo 'set host_alias "$(host_alias)"' >> $@-t
@echo 'set host_triplet $(host_triplet)' >> $@-t
@echo 'set target_alias "$(target_alias)"' >> $@-t
@echo 'set target_triplet $(target_triplet)' >> $@-t
@echo 'set build_alias "$(build_alias)"' >> $@-t
@echo 'set build_triplet $(build_triplet)' >> $@-t
@echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
@test ! -f site.exp || mv site.exp site.bak
@mv $@-t site.exp
remote.exp:;
@echo 'Making a new remote.exp file...'
@test ! -f remote.bak || rm -f remote.bak
@echo '## These variables are used to set up for the remote testing.' >> $@-t
@echo '## Please, read file README in this directory for instructions' >> $@-t
@echo '## on how to use this file' >> $@-t
@echo "set host_board `hostname`" >> $@-t
@echo 'set board_info($$host_board,connect) rlogin' >> $@-t
@echo 'set board_info($$host_board,shell_prompt) "\\$$ "' >> $@-t
@echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
@echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
@echo "set board_info(\$$host_board,srcdir) `cd $(srcdir); pwd`" >> $@-t
@echo "set board_info(\$$host_board,objdir) `pwd`" >> $@-t
@echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
@echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
@test ! -f remote.exp || mv remote.exp remote.bak
@mv $@-t remote.exp
DISTCLEANFILES=*.exp *.log *.sum
distclean-local:
-rm -rf data
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2008 Free Software Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# NOTE: Expected lines must be indented with exactly one tab character.
scheme: => SUCCESS
scheme <scheme>
user <>
passwd <>
auth <>
host <>
port 0
path <>
scheme:/absolute/path => SUCCESS
scheme <scheme>
user <>
passwd <>
auth <>
host <>
port 0
path </absolute/path>
scheme:relative/path => SUCCESS
scheme <scheme>
user <>
passwd <>
auth <>
host <>
port 0
path <relative/path>
scheme:///absolute/path => SUCCESS
scheme <scheme>
user <>
passwd <>
auth <>
host <>
port 0
path </absolute/path>
scheme://%75%73%65%72:%70%61%73%73@%68%6f%73%74 => SUCCESS
scheme <scheme>
user <user>
passwd <pass>
auth <>
host <host>
port 0
path <>
ftp://user:pass@host//a/path => SUCCESS
scheme <ftp>
user <user>
passwd <pass>
auth <>
host <host>
port 0
path </a/path>
ftp://:pass@host//a/path => SUCCESS
scheme <ftp>
user <>
passwd <pass>
auth <>
host <host>
port 0
path </a/path>
ftp://user:@host//a/path => SUCCESS
scheme <ftp>
user <user>
passwd <>
auth <>
host <host>
port 0
path </a/path>
ftp://user:pass@//a/path => SUCCESS
scheme <ftp>
user <user>
passwd <pass>
auth <>
host <>
port 0
path </a/path>
ftp://user:@//a/path => SUCCESS
scheme <ftp>
user <user>
passwd <>
auth <>
host <>
port 0
path </a/path>
ftp://:@host//a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <host>
port 0
path </a/path>
ftp://:pass@//a/path => SUCCESS
scheme <ftp>
user <>
passwd <pass>
auth <>
host <>
port 0
path </a/path>
ftp://:@//a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path </a/path>
ftp://://a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path </a/path>
ftp://@//a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path </a/path>
ftp:/a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path </a/path>
ftp://user:pass@host/a/path => SUCCESS
scheme <ftp>
user <user>
passwd <pass>
auth <>
host <host>
port 0
path <a/path>
ftp://:pass@host/a/path => SUCCESS
scheme <ftp>
user <>
passwd <pass>
auth <>
host <host>
port 0
path <a/path>
ftp://user:@host/a/path => SUCCESS
scheme <ftp>
user <user>
passwd <>
auth <>
host <host>
port 0
path <a/path>
ftp://user:pass@/a/path => SUCCESS
scheme <ftp>
user <user>
passwd <pass>
auth <>
host <>
port 0
path <a/path>
ftp://user:@/a/path => SUCCESS
scheme <ftp>
user <user>
passwd <>
auth <>
host <>
port 0
path <a/path>
ftp://:@host/a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <host>
port 0
path <a/path>
ftp://:pass@/a/path => SUCCESS
scheme <ftp>
user <>
passwd <pass>
auth <>
host <>
port 0
path <a/path>
ftp://:@/a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path <a/path>
ftp://:/a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path <a/path>
ftp://@/a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path <a/path>
ftp:///a/path => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <>
port 0
path </a/path>
pop://pop.example.net => SUCCESS
scheme <pop>
user <>
passwd <>
auth <>
host <pop.example.net>
port 0
path <>
pop://user@pop.example.net => SUCCESS
scheme <pop>
user <user>
passwd <>
auth <>
host <pop.example.net>
port 0
path <>
pop://user:passwd@pop.example.net => SUCCESS
scheme <pop>
user <user>
passwd <passwd>
auth <>
host <pop.example.net>
port 0
path <>
pop://user;auth=*@pop.example.net => SUCCESS
scheme <pop>
user <user>
passwd <>
auth <*>
host <pop.example.net>
port 0
path <>
pop://pop.example.net:111 => SUCCESS
scheme <pop>
user <>
passwd <>
auth <>
host <pop.example.net>
port 111
path <>
pop://user@pop.example.net:111 => SUCCESS
scheme <pop>
user <user>
passwd <>
auth <>
host <pop.example.net>
port 111
path <>
pop://user:passwd@pop.example.net:111 => SUCCESS
scheme <pop>
user <user>
passwd <passwd>
auth <>
host <pop.example.net>
port 111
path <>
pop://user;auth=*@pop.example.net:111 => SUCCESS
scheme <pop>
user <user>
passwd <>
auth <*>
host <pop.example.net>
port 111
path <>
imap://imap.example.net => SUCCESS
scheme <imap>
user <>
passwd <>
auth <>
host <imap.example.net>
port 0
path <>
imap://user@imap.example.net => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <>
host <imap.example.net>
port 0
path <>
imap://user:passwd@imap.example.net => SUCCESS
scheme <imap>
user <user>
passwd <passwd>
auth <>
host <imap.example.net>
port 0
path <>
imap://user;auth=*@imap.example.net => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <*>
host <imap.example.net>
port 0
path <>
imap://imap.example.net:111 => SUCCESS
scheme <imap>
user <>
passwd <>
auth <>
host <imap.example.net>
port 111
path <>
imap://user@imap.example.net:111 => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <>
host <imap.example.net>
port 111
path <>
imap://user:passwd@imap.example.net:111 => SUCCESS
scheme <imap>
user <user>
passwd <passwd>
auth <>
host <imap.example.net>
port 111
path <>
imap://user;auth=*@imap.example.net:111 => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <*>
host <imap.example.net>
port 111
path <>
imap://imap.example.net/mbox => SUCCESS
scheme <imap>
user <>
passwd <>
auth <>
host <imap.example.net>
port 0
path <mbox>
imap://user@imap.example.net/mbox => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <>
host <imap.example.net>
port 0
path <mbox>
imap://user:passwd@imap.example.net/mbox => SUCCESS
scheme <imap>
user <user>
passwd <passwd>
auth <>
host <imap.example.net>
port 0
path <mbox>
imap://user;auth=*@imap.example.net/mbox => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <*>
host <imap.example.net>
port 0
path <mbox>
imap://imap.example.net:111/mbox => SUCCESS
scheme <imap>
user <>
passwd <>
auth <>
host <imap.example.net>
port 111
path <mbox>
imap://user@imap.example.net:111/mbox => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <>
host <imap.example.net>
port 111
path <mbox>
imap://user:passwd@imap.example.net:111/mbox => SUCCESS
scheme <imap>
user <user>
passwd <passwd>
auth <>
host <imap.example.net>
port 111
path <mbox>
imap://user;auth=*@imap.example.net:111/mbox => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <*>
host <imap.example.net>
port 111
path <mbox>
imap://imap.example.net/mbox/user@host => SUCCESS
scheme <imap>
user <imap.example.net/mbox/user>
passwd <>
auth <>
host <host>
port 0
path <>
imap://user@imap.example.net/mbox/user@host => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <>
host <imap.example.net>
port 0
path <mbox/user@host>
imap://user:passwd@imap.example.net/mbox/user@host => SUCCESS
scheme <imap>
user <user>
passwd <passwd>
auth <>
host <imap.example.net>
port 0
path <mbox/user@host>
imap://user;auth=*@imap.example.net/mbox/user@host => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <*>
host <imap.example.net>
port 0
path <mbox/user@host>
imap://imap.example.net:111/mbox/user@host => SUCCESS
scheme <imap>
user <imap.example.net>
passwd <111/mbox/user>
auth <>
host <host>
port 0
path <>
imap://user@imap.example.net:111/mbox/user@host => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <>
host <imap.example.net>
port 111
path <mbox/user@host>
imap://user:passwd@imap.example.net:111/mbox/user@host => SUCCESS
scheme <imap>
user <user>
passwd <passwd>
auth <>
host <imap.example.net>
port 111
path <mbox/user@host>
imap://user;auth=*@imap.example.net:111/mbox/user@host => SUCCESS
scheme <imap>
user <user>
passwd <>
auth <*>
host <imap.example.net>
port 111
path <mbox/user@host>
ftp://ftp.example.org/mbox/user%40host => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <ftp.example.org>
port 0
path <mbox/user@host>
ftp://ftp.example.org:111/mbox/user%40host => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <ftp.example.org>
port 111
path <mbox/user@host>
ftp://ftp.example.org:111/mbox/user%40host;type=pass => SUCCESS
scheme <ftp>
user <>
passwd <>
auth <>
host <ftp.example.org>
port 111
path <mbox/user@host>
param[0] <type=pass>
mbox:/var/spool/mail;type=index;param=2;user=gray => SUCCESS
scheme <mbox>
user <>
passwd <>
auth <>
host <>
port 0
path </var/spool/mail>
param[0] <type=index>
param[1] <param=2>
param[2] <user=gray>
mbox:///var/spool/mail;type=index;param=2;user=gray => SUCCESS
scheme <mbox>
user <>
passwd <>
auth <>
host <>
port 0
path </var/spool/mail>
param[0] <type=index>
param[1] <param=2>
param[2] <user=gray>
http:///gnu.org.ua/home/gray?prog&arg1&arg2
scheme <http>
user <>
passwd <>
auth <>
host <gnu.org.ua>
port 0
path <home/gray>
query[0] <prog>
query[1] <arg1>
query[2] <arg2>
http:///gnu.org.ua/home/gray;foo=bar;baz=qux?prog&arg%201&arg%202
scheme <http>
user <>
passwd <>
auth <>
host <gnu.org.ua>
port 0
path <home/gray>
param[0] <foo=bar>
param[1] <baz=qux>
query[0] <prog>
query[1] <arg 1>
query[2] <arg 2>
# NOTE: This file must end with an empty line
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
source $top_srcdir/testsuite/lib/mailutils.exp
mu_init
proc mailbox_run {args} {
global verbose
global expect_out
set sw ""
for {set i 0} {$i < [llength $args]} {incr i} {
set a [lindex $args $i]
if {"$a" == "-mail-spool"} {
if [info exists host_board] {
if [board_info $host_board exists top_srcdir] {
append sw "--set mailbox.mail-spool=\"'[board_info $host_board top_srcdir]/mail/testsuite/spool'\""
}
}
if {![info exists init_spool]} {
set init_spool 1
}
} elseif {"$a" == "-reuse-spool"} {
set init_spool 0
} else {
break
}
}
if [info exists init_spool] {
mu_prepare_spools
}
set args "[lrange $args $i end] $sw"
verbose "Spawning $args"
set res [remote_spawn host $args]
if { $res < 0 || $res == "" } {
perror "Spawning $args failed."
return 1;
}
return 0
}
proc mailbox_send { string } {
return [mu_send "$string"]
}
# mailbox_test [-message MESSAGE][-default (FAIL|XFAIL)]
# COMMAND [-pattern PATTERN-LIST][PATTERN...]
# COMMAND - Command to send.
# PATTERN - Sequence to expect in return.
# MESSAGE - [optional] message to output
proc mailbox_test { args } {
global verbose
global suppress_flag;
upvar timeout timeout
set default ""
set message ""
for {set i 0} {$i < [llength $args]} {incr i} {
set a [lindex $args $i]
if {"$a" == "-default"} {
incr i
set default [lindex $args $i]
} elseif {"$a" == "-message"} {
incr i
set message [lindex $args $i]
} elseif {"$a" == "-pattern"} {
incr i
set pattern [lindex $args $i]
} else {
set args [lrange $args $i end]
break
}
}
if {"$message" == ""} {
set message [lindex $args 0]
}
if $verbose>2 then {
send_user "Message is \"$message\"\n"
}
set command [lindex $args 0]
if {[llength $args] >= 2} {
set pattern [lrange $args 1 end]
}
if [info exists pattern] {
set result [mu_test $command $pattern]
} else {
set result [mu_test $command]
}
if {$result == 0} {
pass "$message"
} elseif {$result == 1} {
if { "$default" == "" || "$default" != "FAIL" } {
fail "$message"
} else {
xfail "$message"
set result 0
}
} elseif {$result == -2} {
fail "$message (timeout)"
} elseif {$result == -3} {
fail "$message (eof)"
} else {
fail "$message"
}
return $result
}
proc mailbox_prog_start {cmd} {
global verbose
global MU_TOOL
global MU_TOOL_FLAGS
global mailbox_prog_prompt
global expect_out
global mailbox_spawn_id
verbose "Spawning $cmd"
set mailbox_spawn_id [remote_spawn host $cmd]
if { $mailbox_spawn_id < 0 || $mailbox_spawn_id == "" } {
perror "Spawning $cmd failed."
return 1;
}
mu_expect 360 {
-re "\[\r\n\]?${mailbox_prog_prompt}$" {
verbose "program initialized."
}
default {
perror "program not initialized"
return 1
}
}
return 0
}
proc mailbox_prog_send { string } {
return [mu_send "$string"]
}
proc mailbox_prog_command { cmd } {
return [mu_command $cmd]
}
proc mailbox_prog_stop {} {
verbose "Stopping program"
remote_close host
}
# mailbox_prog_test [-message MESSAGE][-default (FAIL|XFAIL)][-noprompt]
# COMMAND PATTERN [PATTERN...]
# COMMAND - Command to send.
# PATTERN - Sequence to expect in return.
# MESSAGE - [optional] message to output
proc mailbox_prog_test { args } {
global verbose
global mailbox_prog_prompt
global suppress_flag;
upvar timeout timeout
set default ""
set message ""
set wait_for_prompt 1
for {set i 0} {$i < [llength $args]} {incr i} {
set a [lindex $args $i]
if {"$a" == "-default"} {
set default [lindex $args [expr $i + 1]]
incr i
} elseif {"$a" == "-message"} {
set message [lindex $args [expr $i + 1]]
incr i
} elseif {"$a" == "-noprompt"} {
set wait_for_prompt 0
} else {
set args [lrange $args $i end]
break
}
}
if {"$message" == ""} {
set message [lindex $args 0]
}
if $verbose>2 then {
send_user "Message is \"$message\"\n"
}
set command [lindex $args 0]
set pattern [lrange $args 1 end]
set result [mu_test $command $pattern]
if {$wait_for_prompt} {
mu_expect 30 {
-re "\[\r\n\]?${mailbox_prog_prompt}$" {}
default {
perror "prog not initialized"
return 1
}
}
}
if {$result == 0} {
pass "$message"
} elseif {$result == 1} {
if { "$default" == "" || "$default" != "FAIL" } {
fail "$message"
} else {
xfail "$message"
set result 0
}
} elseif {$result == -2} {
fail "$message (timeout)"
} elseif {$result == -3} {
fail "$message (eof)"
} else {
fail "$message"
}
return $result
}
address.exp
argcv.exp
base64.exp
decode2047.exp
encode2047.exp
list.exp
mailcap.exp
mime.exp
url.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
mailbox_run ${top_builddir}/examples/addr
set chan [open ${srcdir}/Addrs r]
set command ""
for {gets $chan line} {![eof $chan]} {gets $chan line} {
switch -regexp -- "$line" {
"^#.*" { }
"^[^ \t].*=>.*" {
regexp "(.*)=>.*" $line dummy command
set pattern [list $line]
}
"^\$" {
if {$command != ""} {
mailbox_test -pattern $pattern $command
set command ""
}
}
default {
if [info exist pattern] {
set pattern [concat $pattern [list $line]]
}
}
}
}
close $chan
# end of address.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2005, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
mailbox_run ${top_builddir}/examples/argcv
set chan [open ${srcdir}/Argcv r]
set command ""
set message ""
for {gets $chan line} {![eof $chan]} {gets $chan line} {
switch -regexp -- "$line" {
"^#.*" { }
"^[ \t]*\$" { }
"message:" {
regexp "message:\[ \t\]*(.*)" $line dummy message
}
default {
if {$command == ""} {
set command $line
} else {
if {$message != ""} {
mailbox_test -message $message -pattern [list $line] $command
set message ""
} else {
mailbox_test -pattern [list $line] $command
}
set command ""
}
}
}
}
if {$command != ""} {
fail "Malformed input file ${srcdir}/Argcv"
}
close $chan
# end of argcv.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
set MU_TOOL ${top_builddir}/examples/base64
set MU_TOOL_FLAGS ""
mu_exec -message "encode" -arg -i${srcdir}/Encode \
"AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4"\
"OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3Bx"\
"cnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmq"\
"q6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj"\
"5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w=="
## Expect chokes on binary data, so let's switch base64 to printable
## octal output.
## The -l0 option ensures that the output is not split by inserting
## additional newlines.
mu_exec -message "decode" -arg -i${srcdir}/Decode -arg -dpl0 \
"\\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"
# End of base64.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2003, 2006, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
mailbox_run ${top_builddir}/examples/decode2047 -p
set chan [open ${srcdir}/Decode2047 r]
set command ""
for {gets $chan line} {![eof $chan]} {gets $chan line} {
switch -regexp -- "$line" {
"^#.*" { }
"^[^ \t].*=>.*" {
regexp "(.*)=>.*" $line dummy command
set pattern [list $line]
}
"^\$" {
if {$command != ""} {
verbose "COMMAND $command"
verbose "PATTERN $pattern"
mailbox_test -pattern $pattern $command
set command ""
}
}
default {
if [info exist pattern] {
set pattern [concat $pattern [list $line]]
}
}
}
}
close $chan
# end of decode2047.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2006, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
mailbox_run ${top_builddir}/examples/encode2047
set chan [open ${srcdir}/Encode2047 r]
set command ""
set message ""
for {gets $chan line} {![eof $chan]} {gets $chan line} {
switch -regexp -- "$line" {
"^#.*" { }
"-message.*" {
regexp -- "-message (.*)" $line dummy message
}
"^\\\\\[^\\\\\]" {
mu_command $line
}
"^[^ \t].*=>.*" {
regexp "(.*)=>.*" $line dummy command
set pattern [list $line]
}
"^\$" {
if {$command != ""} {
verbose "COMMAND $command"
verbose "PATTERN $pattern"
if {$message != ""} {
mailbox_test -message $message -pattern $pattern $command
} else {
mailbox_test -pattern $pattern $command
}
set command ""
set message ""
}
}
default {
if [info exist pattern] {
set pattern [concat $pattern [list $line]]
}
}
}
}
close $chan
# end of encode2037.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2003, 2005, 2007, 2008, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
set current_text [list "NULL" "NULL" "NULL" "NULL"]
set current_iter 0
proc make_promt {} {
global current_iter
global current_text
global mailbox_prog_prompt
set mailbox_prog_prompt "${current_iter}:\\([lindex $current_text $current_iter]\\)> "
}
proc prompt_text {text} {
global current_iter
global current_text
set current_text [lreplace $current_text $current_iter $current_iter $text]
make_promt
}
proc prompt_iterator {iter} {
global current_iter
set current_iter $iter
make_promt
}
prompt_iterator 0
prompt_text "NULL"
mailbox_prog_start "${top_builddir}/examples/listop"
mailbox_prog_command "add en to tre fire fem"
mailbox_prog_test "print" \
"# items: 5" \
"en" \
"to" \
"tre" \
"fire" \
"fem"
prompt_text "en"
mailbox_prog_test "next"
prompt_text "tre"
mailbox_prog_test "next 2"
prompt_iterator 1
prompt_text "en"
mailbox_prog_test "iter 1"
prompt_text "to"
mailbox_prog_test "find to"
mailbox_prog_test "del tre fire"
prompt_text "fem"
mailbox_prog_test "next"
prompt_iterator 0
prompt_text "fem"
mailbox_prog_test "iter 0"
mailbox_prog_test "print" \
"# items: 3" \
"en" \
"to" \
"fem"
mailbox_prog_command "prep jeden dwa trzy cztery"
mailbox_prog_test "print" \
"# items: 7" \
"cztery" \
"trzy" \
"dwa" \
"jeden" \
"en" \
"to" \
"fem"
prompt_text "cztery"
mailbox_prog_test "first"
prompt_text "trzy"
mailbox_prog_test "del cztery"
prompt_text "3"
mailbox_prog_test "repl trzy 3"
prompt_iterator 1
mailbox_prog_test "iter 1"
prompt_text "3"
mailbox_prog_test "next 2"
mailbox_prog_command "ins jeden un"
mailbox_prog_test "print" \
"# items: 7" \
"3" \
"dwa" \
"jeden" \
"un" \
"en" \
"to" \
"fem"
mailbox_prog_command "ins before jeden zero"
mailbox_prog_test "print" \
"# items: 8" \
"3" \
"dwa" \
"zero" \
"jeden" \
"un" \
"en" \
"to" \
"fem"
prompt_text "un"
mailbox_prog_test "find un"
mailbox_prog_command "ins before un cero"
mailbox_prog_command "ins un dos"
mailbox_prog_test "print" \
"# items: 10" \
"3" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"un" \
"dos" \
"en" \
"to" \
"fem"
mailbox_prog_command "ins before 3 1"
mailbox_prog_test "print" \
"# items: 11" \
"1" \
"3" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"un" \
"dos" \
"en" \
"to" \
"fem"
mailbox_prog_command "ins before 3 2"
mailbox_prog_test "print" \
"# items: 12" \
"1" \
"2" \
"3" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"un" \
"dos" \
"en" \
"to" \
"fem"
mailbox_prog_command "ins 3 4 5 6"
mailbox_prog_test "print" \
"# items: 15" \
"1" \
"2" \
"3" \
"4" \
"5" \
"6" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"un" \
"dos" \
"en" \
"to" \
"fem"
mailbox_prog_command "ins before dwa zero jeden"
mailbox_prog_test "print" \
"# items: 17" \
"1" \
"2" \
"3" \
"4" \
"5" \
"6" \
"zero" \
"jeden" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"un" \
"dos" \
"en" \
"to" \
"fem"
mailbox_prog_test "ictl tell" "12"
prompt_text "dos"
mailbox_prog_test "ictl del"
prompt_text "dos"
mailbox_prog_test "next"
mailbox_prog_test "print" \
"# items: 16" \
"1" \
"2" \
"3" \
"4" \
"5" \
"6" \
"zero" \
"jeden" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"dos" \
"en" \
"to" \
"fem"
mailbox_prog_test "ictl ins seis"
mailbox_prog_test "print" \
"# items: 17" \
"1" \
"2" \
"3" \
"4" \
"5" \
"6" \
"zero" \
"jeden" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"dos" \
"seis" \
"en" \
"to" \
"fem"
mailbox_prog_test "ictl ins tres quatro cinco"
mailbox_prog_test "print" \
"# items: 20" \
"1" \
"2" \
"3" \
"4" \
"5" \
"6" \
"zero" \
"jeden" \
"dwa" \
"zero" \
"jeden" \
"cero" \
"dos" \
"tres" \
"quatro" \
"cinco" \
"seis" \
"en" \
"to" \
"fem"
prompt_text "tres"
mailbox_prog_test "next"
mailbox_prog_test "ictl dir" "forwards"
mailbox_prog_test "ictl dir backwards"
prompt_text "dos"
mailbox_prog_test "next"
prompt_text "dwa"
mailbox_prog_test "next 4"
prompt_text "jeden"
mailbox_prog_test "ictl del"
mailbox_prog_test "next"
prompt_text "zero"
mailbox_prog_test "next"
mailbox_prog_test "ictl dir forwards"
prompt_text "jeden"
mailbox_prog_test "next"
mailbox_prog_send "quit"
mailbox_prog_stop
# End of list.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
mu_prepare_spools
set mailcapfile ${MU_DATA_DIR}/mailcap
set chan [open ${srcdir}/Mailcap r]
set outchan [open "$mailcapfile" w]
set command ""
set state 0
set entry 0
set pattern [list]
for {gets $chan line} {![eof $chan]} {gets $chan line} {
if {$state == 0} {
switch -regexp -- "$line" {
"^#.*" { }
"^entry" {
set state 1
incr entry
lappend pattern "entry\[${entry}\]"
}
default {
puts $outchan $line
}
}
} else {
switch -regexp -- "$line" {
"^#.*" { }
"^\$" {
lappend pattern ""
set state 0
}
default {
lappend pattern $line
}
}
}
}
if {$state == 1} {
lappend pattern ""
}
close $outchan
close $chan
set MU_TOOL ${top_builddir}/examples/mailcap
set MU_TOOL_FLAGS ""
verbose "INVOKE $pattern"
eval mu_exec -message "mailcap" -arg "$mailcapfile" $pattern
# end of mailcap.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
set MU_TOOL "${top_builddir}/examples/mimetest"
set MU_TOOL_FLAGS "-i 0 -p $MU_SPOOL_DIR/mbox1"
mu_prepare_spools
set chan [open ${srcdir}/Mime r]
set pattern [list]
for {gets $chan line} {![eof $chan]} {gets $chan line} {
switch -regexp -- "$line" {
"^#.*" { }
default { set pattern [concat $pattern [list $line]] }
}
}
mu_exec -retcode 0 -message "MIME" -pattern $pattern
close $chan
# end of mime.exp
# -*- tcl -*-
# This file is part of Mailutils testsuite.
# Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.
mailbox_run ${top_builddir}/examples/url-parse
set chan [open ${srcdir}/Urls r]
set command ""
for {gets $chan line} {![eof $chan]} {gets $chan line} {
verbose "LINE: $line"
switch -regexp -- "$line" {
"^#.*" { }
"^[^ \t].*=>.*" {
regexp "(.*\[^ \t\])\[ \t\]*=>.*" $line dummy command
verbose "COMMAND: \"$command\""
set pattern [list $line]
}
"^\$" {
if {$command != ""} {
mailbox_test -pattern $pattern $command
set command ""
}
}
default {
set pattern [concat $pattern [list $line]]
}
}
}
close $chan
# end of url.exp
......@@ -23,7 +23,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
## ------------ ##
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
{ \
$(AM_V_GEN) { \
echo '# Signature of the current package.'; \
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
......
......@@ -16,7 +16,6 @@
# This file is part of Mailfromd testsuite.
# Require a reasonably recent autotest.
m4_version_prereq([2.52g])
m4_include([testsuite.inc])
dnl ------------------------------------------------------------
......
......@@ -24,7 +24,7 @@ MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE)
## ------------ ##
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
{ \
$(AM_V_GEN) { \
echo '# Signature of the current package.'; \
echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
......
......@@ -15,8 +15,7 @@
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
# Require a reasonably recent autotest.
m4_version_prereq([2.52g])
m4_include([testsuite.inc])
dnl ------------------------------------------------------------
dnl testcompile(SCRIPT) -- test compilation of the Sieve SCRIPT
......
......@@ -15,6 +15,6 @@
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
m4_include([testsuite.inc])
dnl m4_include([testsuite.inc])
MUT_VERSION(sieve)
......
......@@ -15,6 +15,11 @@
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
# Require a reasonably recent autotest.
m4_version_prereq([2.52g])
m4_define([AT_SKIP_TEST],[exit 77])
dnl ------------------------------------------------------------
dnl MUT_VERSION(TOOL) -- checks the version output from TOOL
dnl
......@@ -38,5 +43,3 @@ _EOT
AT_CLEANUP
])
m4_define([AT_SKIP_TEST],[exit 77])
......