commit-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Mailutils branch, master, updated. release-2.2-184-g2662827


From: Sergey Poznyakoff
Subject: [SCM] GNU Mailutils branch, master, updated. release-2.2-184-g2662827
Date: Wed, 10 Nov 2010 23:22:06 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Mailutils".

http://git.savannah.gnu.org/cgit/mailutils.git/commit/?id=2662827ca1abe42442d14cc3cbf08d076b3ee1ab

The branch, master has been updated
       via  2662827ca1abe42442d14cc3cbf08d076b3ee1ab (commit)
      from  50bf64db74ffa1d1cf1c5ebbda55cabdb530b8f5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2662827ca1abe42442d14cc3cbf08d076b3ee1ab
Author: Sergey Poznyakoff <address@hidden>
Date:   Wed Nov 10 22:40:41 2010 +0200

    Add MH testsuite.
    
    * configure.ac (mh/tests): New testdir
    * mh/Makefile.am (SUBDIRS): Add tests
    
    * tests/Makefile.am: New file.
    * mh/tests/Makefile.am: New file.
    * mh/tests/atlocal.in: New file.
    * mh/tests/folder.at: New file.
    * mh/tests/inc.at: New file.
    * mh/tests/mark.at: New file.
    * mh/tests/mhparam.at: New file.
    * mh/tests/mhpath.at: New file.
    * mh/tests/refile.at: New file.
    * mh/tests/rmf.at: New file.
    * mh/tests/rmm.at: New file.
    * mh/tests/scan.at: New file.
    * mh/tests/testsuite.at: New file.
    * mh/tests/.gitignore: New file.
    
    * testsuite/testsuite.inc (MUT_MBCOPY): Work correctly if
    DST is a directory name (for MH and maildir formats).
    
    * mh/folder.c (action_list): Treat empty value as
    equal to no value.
    * mh/install-mh.c (main): Honor MH environment variable.
    * mh/mh_ctx.c (mh_context_read, mh_context_write): Use MU streams
    instead of stdio FILE.
    (mh_context_iterate): Add error checking.
    Do not coredump on NULL header.
    * mh/mh_global.c (_mh_init_global_sequences): Destroy sequences.
    * mh/TODO: Update.
    
    * libmailutils/stream/message_stream.c (copy_trimmed_value): New
    static function.
    (scan_stream): Strip final newline from the saved envelope values.
    
    * mu/Makefile.am (BUILD_SOURCES, EXTRA_DIST): Add
    mu-setup.c and mu-setup.h.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                                |    5 +-
 libmailutils/stream/message_stream.c        |   28 ++++--
 mh/Makefile.am                              |    1 +
 mh/TODO                                     |    4 +-
 mh/folder.c                                 |    2 +-
 mh/install-mh.c                             |   17 ++-
 mh/mh_ctx.c                                 |  111 ++++++++++++--------
 mh/mh_global.c                              |    2 +-
 {frm => mh}/tests/.gitignore                |    0
 {frm => mh}/tests/Makefile.am               |   12 ++-
 {sieve => mh}/tests/atlocal.in              |    3 +-
 mh/tests/folder.at                          |  147 +++++++++++++++++++++++++++
 mh/tests/inc.at                             |   61 +++++++++++
 mh/tests/mark.at                            |  101 ++++++++++++++++++
 mh/tests/mhparam.at                         |   72 +++++++++++++
 mh/tests/mhpath.at                          |  110 ++++++++++++++++++++
 mh/tests/refile.at                          |   75 ++++++++++++++
 maidag/tests/url-mbox.at => mh/tests/rmf.at |   37 +++++---
 maidag/tests/url-mbox.at => mh/tests/rmm.at |   43 ++++++---
 mh/tests/scan.at                            |   82 +++++++++++++++
 {maidag => mh}/tests/testsuite.at           |   43 ++++++--
 mu/Makefile.am                              |    3 +
 testsuite/testsuite.inc                     |    8 +-
 23 files changed, 862 insertions(+), 105 deletions(-)
 copy {frm => mh}/tests/.gitignore (100%)
 copy {frm => mh}/tests/Makefile.am (94%)
 copy {sieve => mh}/tests/atlocal.in (73%)
 create mode 100644 mh/tests/folder.at
 create mode 100644 mh/tests/inc.at
 create mode 100644 mh/tests/mark.at
 create mode 100644 mh/tests/mhparam.at
 create mode 100644 mh/tests/mhpath.at
 create mode 100644 mh/tests/refile.at
 copy maidag/tests/url-mbox.at => mh/tests/rmf.at (54%)
 copy maidag/tests/url-mbox.at => mh/tests/rmm.at (52%)
 create mode 100644 mh/tests/scan.at
 copy {maidag => mh}/tests/testsuite.at (54%)

diff --git a/configure.ac b/configure.ac
index e20652d..67ddf6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1217,6 +1217,7 @@ AC_CONFIG_TESTDIR(maidag/tests)
 AC_CONFIG_TESTDIR(messages/tests)
 AC_CONFIG_TESTDIR(readmsg/tests)
 AC_CONFIG_TESTDIR(sieve/tests)
+AC_CONFIG_TESTDIR(mh/tests)
 
 AC_CONFIG_FILES([libmailutils/tests/Makefile
                  libmailutils/tests/atlocal
@@ -1231,7 +1232,9 @@ AC_CONFIG_FILES([libmailutils/tests/Makefile
                 readmsg/tests/Makefile
                 readmsg/tests/atlocal
                  sieve/tests/Makefile
-                 sieve/tests/atlocal]) 
+                 sieve/tests/atlocal
+                mh/tests/Makefile
+                mh/tests/atlocal]) 
 AM_MISSING_PROG([AUTOM4TE], [autom4te])
 
 dnl Make sysconfdir available to the application
diff --git a/libmailutils/stream/message_stream.c 
b/libmailutils/stream/message_stream.c
index a404ccd..dfa8b70 100644
--- a/libmailutils/stream/message_stream.c
+++ b/libmailutils/stream/message_stream.c
@@ -129,6 +129,20 @@ _message_size (mu_stream_t stream, mu_off_t *psize)
     *psize -= s->envelope_length + s->mark_length;
   return rc;
 }
+
+static char *
+copy_trimmed_value (const char *str)
+{
+  char *p;
+  size_t len;
+  
+  str = mu_str_skip_class (str, MU_CTYPE_SPACE);
+  len = strlen (str) - 1;
+  p = malloc (len);
+  memcpy (p, str, len);
+  p[len] = 0;
+  return p;
+}
   
 static int
 scan_stream (struct _mu_message_stream *str)
@@ -180,21 +194,17 @@ scan_stream (struct _mu_message_stream *str)
          if (!from && mu_c_strncasecmp (buffer, MU_HEADER_FROM,
                                         sizeof (MU_HEADER_FROM) - 1) == 0)
            
-           from = mu_strdup (mu_str_skip_class (buffer +
-                                                sizeof (MU_HEADER_FROM),
-                                                MU_CTYPE_SPACE));
+           from = copy_trimmed_value (buffer + sizeof (MU_HEADER_FROM));
          else if (!env_from
                   && mu_c_strncasecmp (buffer, MU_HEADER_ENV_SENDER,
                                        sizeof (MU_HEADER_ENV_SENDER) - 1) == 0)
-           env_from = mu_strdup (mu_str_skip_class (buffer +
-                                       sizeof (MU_HEADER_ENV_SENDER),
-                                                    MU_CTYPE_SPACE));
+           env_from = copy_trimmed_value (buffer +
+                                          sizeof (MU_HEADER_ENV_SENDER));
          else if (!env_date
                   && mu_c_strncasecmp (buffer, MU_HEADER_ENV_DATE,
                                        sizeof (MU_HEADER_ENV_DATE) - 1) == 0)
-           env_date = mu_strdup (mu_str_skip_class (buffer +
-                                                 sizeof (MU_HEADER_ENV_DATE),
-                                                    MU_CTYPE_SPACE));
+           env_date = copy_trimmed_value (buffer +
+                                          sizeof (MU_HEADER_ENV_DATE));
        }
     }
 
diff --git a/mh/Makefile.am b/mh/Makefile.am
index 2cceef0..2c52f55 100644
--- a/mh/Makefile.am
+++ b/mh/Makefile.am
@@ -15,6 +15,7 @@
 ## You should have received a copy of the GNU General Public License
 ## along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>. 
 
+SUBDIRS = . tests
 bindir = @MH_BIN_DIR@
 mhlibdir = $(pkgdatadir)/mh
 bin_PROGRAMS = \
diff --git a/mh/TODO b/mh/TODO
index d58b4da..8dfe2c6 100644
--- a/mh/TODO
+++ b/mh/TODO
@@ -24,7 +24,7 @@ State Nice    Utility         Comments
 *      -20     forw            --inplace,--whatnowproc
 *      -20     send            --alias,--filter,--format,--forward,--mime,
                                --width
-*      -20     refile          --link copies messages.
+*      -20     refile          --link copies messages; rmmproc ignored.
 *      -20     rmm             rmproc: 
 +      -15     folder(s)       
 +      -15     mhn             
@@ -34,7 +34,7 @@ State Nice    Utility         Comments
                                center,split,datefield
 +      5       mark
 +      5       pick            See the README entry.
-+      10      anno
++      10      anno            -inplace
 +      10      burst           See the README entry.
 *      10      whom            --check 
 +      10      mhpath
diff --git a/mh/folder.c b/mh/folder.c
index 5dba885..2b8f04e 100644
--- a/mh/folder.c
+++ b/mh/folder.c
@@ -506,7 +506,7 @@ action_list ()
   const char *stack = mh_global_context_get ("Folder-Stack", NULL);
 
   printf ("%s", mh_current_folder ());
-  if (stack)
+  if (stack && stack[0])
     printf (" %s", stack);
   printf ("\n");
   return 0;
diff --git a/mh/install-mh.c b/mh/install-mh.c
index 4bf3cff..5b48244 100644
--- a/mh/install-mh.c
+++ b/mh/install-mh.c
@@ -57,7 +57,7 @@ opt_handler (int key, char *arg, struct argp_state *state)
 int
 main (int argc, char **argv)
 {
-  char *home, *name;
+  char *name;
   extern int mh_auto_install;
   
   /* Native Language Support */
@@ -68,10 +68,17 @@ main (int argc, char **argv)
   mh_argp_parse (&argc, &argv, 0, options, mh_option, args_doc, doc,
                 opt_handler, NULL, NULL);
 
-  home = mu_get_homedir ();
-  if (!home)
-    abort (); /* shouldn't happen */
-  name = mh_safe_make_file_name (home, MH_USER_PROFILE);
+  name = getenv ("MH");
+  if (name)
+    name = mu_tilde_expansion (name, "/", NULL);
+  else
+    {
+      char *home = mu_get_homedir ();
+      if (!home)
+       abort (); /* shouldn't happen */
+      name = mh_safe_make_file_name (home, MH_USER_PROFILE);
+      free (home);
+    }
   mh_install (name, automode);
   return 0;
 }
diff --git a/mh/mh_ctx.c b/mh/mh_ctx.c
index 33a1069..ca497f2 100644
--- a/mh/mh_ctx.c
+++ b/mh/mh_ctx.c
@@ -80,80 +80,81 @@ mh_context_merge (mh_context_t *dst, mh_context_t *src)
 int 
 mh_context_read (mh_context_t *ctx)
 {
-  int status;
+  int rc;
   char *blurb, *p;
-  struct stat st;
-  FILE *fp;
+  mu_stream_t stream;
+  mu_off_t stream_size;
   char *buf = NULL;
-  size_t size = 0;
+  size_t size = 0, n;
   
   if (!ctx)
     return MU_ERR_OUT_NULL;
   
-  if (stat (ctx->name, &st))
-    return errno;
+  rc = mu_file_stream_create (&stream, ctx->name, MU_STREAM_READ);
+  if (rc)
+    return rc;
 
-  blurb = malloc (st.st_size);
-  if (!blurb)
-    return ENOMEM;
-  
-  fp = fopen (ctx->name, "r");
-  if (!fp)
+  rc = mu_stream_size (stream, &stream_size);
+  if (rc)
     {
-      free (blurb);
-      return errno;
+      mu_stream_destroy (&stream);
+      return rc;
     }
 
+  blurb = malloc (stream_size + 1);
+  if (!blurb)
+    {
+      mu_stream_destroy (&stream);
+      return ENOMEM;
+    }
+  
   p = blurb;
-  while (getline (&buf, &size, fp) > 0)
+  while (mu_stream_getline (stream, &buf, &size, &n) == 0 && n > 0)
     {
-      char *q;
-
-      for (q = buf; *q && mu_isspace (*q); q++)
-       ;
+      char *q = mu_str_skip_class (buf, MU_CTYPE_SPACE);
       if (!*q || *q == '#')
        continue;
-      
       for (q = buf; *q;)
        *p++ = *q++;
     }
-  fclose (fp);
-
-  status = mu_header_create (&ctx->header, blurb, p - blurb);
+  mu_stream_destroy (&stream);
+  rc = mu_header_create (&ctx->header, blurb, p - blurb);
   free (blurb);
 
-  return status;
+  return rc;
 }
 
 int 
 mh_context_write (mh_context_t *ctx)
 {
-  mu_stream_t stream;
-  char buffer[512];
-  size_t n;
-  FILE *fp;
+  int rc;
+  mu_stream_t instream, outstream;
+  mu_off_t size;
   
   if (!ctx)
     return MU_ERR_OUT_NULL;
 
-  fp = fopen (ctx->name, "w");
-  if (!fp)
+  rc = mu_file_stream_create (&outstream, ctx->name,
+                             MU_STREAM_WRITE|MU_STREAM_CREAT);
+  if (rc)
     {
-      mu_error (_("cannot open context file %s: %s"),
-               ctx->name, strerror (errno));
+      mu_error (_("cannot open context file %s for writing: %s"),
+               ctx->name, mu_strerror (rc));
       return MU_ERR_FAILURE;
     }
-
-  /* FIXME: Use mu_stream+copy */
-  mu_header_get_streamref (ctx->header, &stream);
-  while (mu_stream_read (stream, buffer, sizeof buffer - 1, &n) == 0
-        && n != 0)
+  
+  mu_header_get_streamref (ctx->header, &instream);
+  rc = mu_stream_copy (outstream, instream, 0, &size);
+  if (rc)
     {
-      buffer[n] = '\0';
-      fprintf (fp, "%s", buffer);
+      mu_error (_("error writing to context file %s: %s"),
+               ctx->name, mu_strerror (rc));
+      return MU_ERR_FAILURE;
     }
-  mu_stream_destroy (&stream);
-  fclose (fp);
+  else
+    rc = mu_stream_truncate (outstream, size);
+  mu_stream_destroy (&instream);
+  mu_stream_destroy (&outstream);
   return 0;
 }
 
@@ -194,13 +195,35 @@ mh_context_iterate (mh_context_t *ctx, 
mh_context_iterator fp, void *data)
   
   if (!ctx)
     return EINVAL;
-  mu_header_get_field_count (ctx->header, &nfields);
+  if (!ctx->header)
+    return 0;
+  rc = mu_header_get_field_count (ctx->header, &nfields);
+  if (rc)
+    {
+      mu_error (_("cannot obtain field count for context %s"), ctx->name);
+      return rc;
+    }
+  
   for (i = 1; i <= nfields && rc == 0; i++)
     {
       const char *name, *value;
       
-      mu_header_sget_field_name (ctx->header, i, &name);
-      mu_header_sget_field_value (ctx->header, i, &value);
+      rc = mu_header_sget_field_name (ctx->header, i, &name);
+      if (rc)
+       {
+         mu_error (_("cannot obtain field name for context %s:%d: %s"),
+                   ctx->name,i,mu_strerror (rc));
+         break;
+       }
+      
+      rc = mu_header_sget_field_value (ctx->header, i, &value);
+      if (rc)
+       {
+         mu_error (_("cannot obtain field value for context %s:%d: %s"),
+                   ctx->name,i,mu_strerror (rc));
+         break;
+       }
+      
       rc = fp (name, value, data);
     }
 
diff --git a/mh/mh_global.c b/mh/mh_global.c
index 06b4417..25873dd 100644
--- a/mh/mh_global.c
+++ b/mh/mh_global.c
@@ -163,7 +163,7 @@ _mh_init_global_sequences ()
 void
 mh_global_sequences_drop ()
 {
-  sequences = NULL;
+  mh_context_destroy (&sequences);
 }
 
 const char *
diff --git a/frm/tests/.gitignore b/mh/tests/.gitignore
similarity index 100%
copy from frm/tests/.gitignore
copy to mh/tests/.gitignore
diff --git a/frm/tests/Makefile.am b/mh/tests/Makefile.am
similarity index 94%
copy from frm/tests/Makefile.am
copy to mh/tests/Makefile.am
index d587c2f..26be1c7 100644
--- a/frm/tests/Makefile.am
+++ b/mh/tests/Makefile.am
@@ -38,7 +38,17 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
 ## Test suite.  ##
 ## ------------ ##
 
-TESTSUITE_AT = testsuite.at
+TESTSUITE_AT = \
+ folder.at\
+ inc.at\
+ mark.at\
+ mhparam.at\
+ mhpath.at\
+ scan.at\
+ refile.at\
+ rmf.at\
+ rmm.at\
+ testsuite.at
 
 TESTSUITE = $(srcdir)/testsuite
 M4=m4
diff --git a/sieve/tests/atlocal.in b/mh/tests/atlocal.in
similarity index 73%
copy from sieve/tests/atlocal.in
copy to mh/tests/atlocal.in
index a50bc9c..66fb14c 100644
--- a/sieve/tests/atlocal.in
+++ b/mh/tests/atlocal.in
@@ -2,4 +2,5 @@
 # Configurable variable values for Mailutils test suite.
 # Copyright (C) 2004, 2010 Free Software Foundation, Inc.
 
address@hidden@:@abs_top_builddir@/sieve:$top_srcdir:$srcdir:$PATH
address@hidden@:@abs_top_builddir@/mh:$top_srcdir:$srcdir:$PATH
+  
\ No newline at end of file
diff --git a/mh/tests/folder.at b/mh/tests/folder.at
new file mode 100644
index 0000000..c7d1d70
--- /dev/null
+++ b/mh/tests/folder.at
@@ -0,0 +1,147 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[folder])
+
+MH_CHECK([folder],[folder00 folder-print],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+echo 'Current-Folder: inbox' > Mail/context
+folder
+],
+[0],
+[                 inbox+ has    5 messages (   1-   5).
+])
+
+MH_CHECK([folder -all],[folder01 folder-all],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+echo 'Current-Folder: inbox' > Mail/context
+folder -all
+],
+[0],
+[dnl
+Folder                  # of messages     (  range  )  cur msg   (other files)
+                 inbox+ has    5 messages (   1-   5).
+              teaparty  has   95 messages (   1-  95).
+
+                   TOTAL= 100 messages in    2 folders
+])
+
+MH_CHECK([folder -all -fast],[folder02 folder-all folder-all-fast],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+echo 'Current-Folder: inbox' > Mail/context
+folder -all -fast
+],
+[0],
+[inbox
+teaparty
+])
+
+MH_CHECK([folder +mbox],[folder03 folder+mbox],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+echo 'Current-Folder: inbox' > Mail/context
+folder +teaparty
+sed -n 's/^\(Current-Folder\): *\(.*\)/\1: \2/p' Mail/context
+],
+[0],
+[dnl
+              teaparty+ has   95 messages (   1-  95).
+Current-Folder: teaparty             
+])
+
+MH_CHECK([folder +mbox msg],[folder04 folder+mbox_msg],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+echo 'Current-Folder: inbox' > Mail/context
+folder +teaparty 35
+sed -n 's/^\(Current-Folder\): *\(.*\)/context: \1: \2/p' Mail/context
+sed -n 's/^\(cur\): *\(.*\)/mh_sequences: \1: \2/p' Mail/teaparty/.mh_sequences
+],
+[0],
+[dnl
+              teaparty+ has   95 messages (   1-  95); cur=  35.
+context: Current-Folder: teaparty
+mh_sequences: cur: 35
+])
+
+MH_CHECK([folder -pack],[folder05 folder-pack],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+for i in 2 3 4 5
+do
+  mv Mail/inbox/$i Mail/inbox/${i}0
+done
+folder -pack || exit $?
+find Mail/inbox
+],
+[0],
+[Mail/inbox
+Mail/inbox/1
+Mail/inbox/2
+Mail/inbox/3
+Mail/inbox/4
+Mail/inbox/5
+Mail/inbox/.mh_sequences
+])
+
+MH_CHECK([folder --pack=N],[folder06 folder--pack=N],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+for i in 1 2 3 4 5
+do
+  mv Mail/inbox/$i Mail/inbox/${i}0
+done
+folder --pack=1 || exit $?
+find Mail/inbox
+],
+[0],
+[Mail/inbox
+Mail/inbox/1
+Mail/inbox/2
+Mail/inbox/3
+Mail/inbox/4
+Mail/inbox/5
+Mail/inbox/.mh_sequences
+])
+
+MH_CHECK([folder -push/-pop],[folder07 folder-push folder-pop folder-push-pop],
+[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+folder -push +teaparty
+folder -pop
+folder -push +teaparty
+folder -push
+folder -pop
+],
+[0],
+[teaparty inbox
+inbox
+teaparty inbox
+inbox teaparty
+teaparty
+])
+
+MH_CHECK([folder -create],[folder08 folder-create],[
+folder -create +new
+],
+[0],
+[                   new+ has no messages.
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of folder.at
diff --git a/mh/tests/inc.at b/mh/tests/inc.at
new file mode 100644
index 0000000..46b90a4
--- /dev/null
+++ b/mh/tests/inc.at
@@ -0,0 +1,61 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[inc])
+
+MH_CHECK([inc -notruncate],[inc00 inc-notruncate],[
+MUT_MBCOPY([$abs_top_srcdir/testsuite/spool/mbox1])
+inc -notruncate -file ./mbox1 | sed 's/ *$//'
+cmp $abs_top_srcdir/testsuite/spool/mbox1 mbox1
+],
+[0],
+[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+   2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   5  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
+])
+
+MH_CHECK([inc -truncate],[inc01 inc-truncate],[
+MUT_MBCOPY([$abs_top_srcdir/testsuite/spool/mbox1])
+inc -truncate -file ./mbox1 | sed 's/ *$//'
+echo "Next"
+inc -truncate -file ./mbox1 | sed 's/ *$//'
+],
+[0],
+[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+   2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   5  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
+Next    
+])
+
+MH_CHECK([inc -folder],[inc02 inc-folder],[
+MUT_MBCOPY([$abs_top_srcdir/testsuite/spool/mbox1])
+mkdir Mail/new
+inc +new -file ./mbox1 | sed 's/ *$//'
+],
+[0],
+[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+   2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   5  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of inc.at
diff --git a/mh/tests/mark.at b/mh/tests/mark.at
new file mode 100644
index 0000000..65af674
--- /dev/null
+++ b/mh/tests/mark.at
@@ -0,0 +1,101 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[mark])
+
+MH_CHECK([mark -add],[mark00 mark-add],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+mark -sequence andro -add 2
+mark -sequence andro -add 3-5
+sed -n '/^andro:/{s/  */ /g;s/ $//;p}' Mail/inbox/.mh_sequences
+],
+[0],
+[andro: 2 3 4 5
+])
+
+MH_CHECK([mark -add -zero],[mark01 mark-add-zero],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+mark -sequence andro -add 2
+sed -n '/^andro:/{s/  */ /g;s/ $//;p}' Mail/inbox/.mh_sequences
+mark -zero -sequence andro -add 1 3
+sed -n '/^andro:/{s/  */ /g;s/ $//;p}' Mail/inbox/.mh_sequences
+],
+[0],
+[andro: 2
+andro: 1 3
+])
+
+MH_CHECK([mark -add -nopublic],[mark02 mark-add-nopublic],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+mark -nopublic -sequence andro -add 1 2 3
+dir=`pwd`
+sed -n '/^atr-andro/{s/  */ /g;s/ $//;s/^[[^:]]*:/atr-andro:/;p}' Mail/context
+],
+[0],
+[atr-andro: 1 2 3
+])
+
+MH_CHECK([mark -del],[mark03 mark-del],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+echo 'andro: 2 3 4 5' > Mail/inbox/.mh_sequences
+mark -sequence andro -del 3
+sed -n '/^andro:/{s/  */ /g;s/ $//;p}' Mail/inbox/.mh_sequences
+],
+[0],
+[andro: 2 4 5
+])
+
+MH_CHECK([mark -del -nopublic],[mark04 mark-del-nopublic],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+inbox=`pwd`/Mail/inbox
+cat > Mail/context <<EOT
+atr-andro-$inbox: 2 3 4 5
+EOT
+mark -nopublic -sequence andro -del 3
+sed -n '/^atr-andro/{s/  */ /g;s/ $//;s/^[[^:]]*:/atr-andro:/;p}' Mail/context
+],
+[0],
+[atr-andro: 2 4 5
+])
+
+MH_CHECK([mark -list],[mark05 mark-list],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+inbox=`pwd`/Mail/inbox
+cat > Mail/context <<EOT
+atr-andro-$inbox: 2 3
+EOT
+cat > Mail/inbox/.mh_sequences <<EOT
+cur: 1
+andro: 1 5
+gwerz: 4
+EOT
+mark -list
+],
+[0],
+[cur: 1
+andro: 1 5
+gwerz: 4
+andro (private): 2 3
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of mark.at
diff --git a/mh/tests/mhparam.at b/mh/tests/mhparam.at
new file mode 100644
index 0000000..5e03fb2
--- /dev/null
+++ b/mh/tests/mhparam.at
@@ -0,0 +1,72 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[mhparam])
+
+MH_CHECK([mhparam -all],[mhparam00 mhparam-all],[
+cat >>$MH <<EOT
+Sequence-Negation: not
+Draft-Folder: Mail/drafts
+Aliasfile: .mh_aliases
+EOT
+mhparam -all | tr '\t' ' ' | sed 's/^Path:.*/Path: Mail/;s/  */ /g'
+],
+[0],
+[Path: Mail
+Sequence-Negation: not
+Draft-Folder: Mail/drafts
+Aliasfile: .mh_aliases
+])
+
+MH_CHECK([mhparam comp],[mhparam01 mhparam_comp],[
+cat >>$MH <<EOT
+Sequence-Negation: not
+Draft-Folder: Mail/drafts
+Aliasfile: .mh_aliases
+EOT
+mhparam Sequence-Negation
+],
+[0],
+[not
+])
+
+MH_CHECK([mhparam comp comp],[mhparam02 mhparam_comp_comp],[
+cat >>$MH <<EOT
+Sequence-Negation: not
+Draft-Folder: Mail/drafts
+Aliasfile: .mh_aliases
+EOT
+mhparam Sequence-Negation Aliasfile | tr '\t' ' '
+],
+[0],
+[Sequence-Negation: not
+Aliasfile: .mh_aliases
+])
+
+MH_CHECK([mhparam -component comp],[mhparam03 mhparam-component_comp],[
+cat >>$MH <<EOT
+Sequence-Negation: not
+Draft-Folder: Mail/drafts
+Aliasfile: .mh_aliases
+EOT
+mhparam -component Sequence-Negation | tr '\t' ' ' | sed 's/  */ /g'
+],
+[0],
+[Sequence-Negation: not
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of mhparam.at
diff --git a/mh/tests/mhpath.at b/mh/tests/mhpath.at
new file mode 100644
index 0000000..45cef81
--- /dev/null
+++ b/mh/tests/mhpath.at
@@ -0,0 +1,110 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[mhpath])
+
+MH_CHECK([mhpath],[mhpath00],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+mhpath | sed 's|^'"$dir"'/||'
+],
+[0],
+[Mail/inbox
+])
+
+MH_CHECK([mhpath +],[mhpath01 mhpath+],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+mhpath +| sed 's|^'"$dir"'/||'
+],
+[0],
+[Mail
+])
+
+MH_CHECK([mhpath msgs],[mhpath02 mhparam_msgs],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+dir=`pwd`
+mhpath 1-3 | sed 's|^'"$dir"'/||'
+],
+[0],
+[Mail/inbox/1
+Mail/inbox/2
+Mail/inbox/3
+])
+
+MH_CHECK([mhpath msgs (some nonexistent)],[mhpath03 mhparam_msgs_some_nonex],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+dir=`pwd`
+mhpath 4-10 | sed 's|^'"$dir"'/||'
+],
+[0],
+[Mail/inbox/4
+Mail/inbox/5
+])
+
+MH_CHECK([mhpath msgs (all nonexistent)],[mhpath04 mhparam_msgs_all_nonex],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+dir=`pwd`
+mhpath 8-10 | sed 's|^'"$dir"'/||'
+],
+[0],
+[],
+[mhpath: no messages in range 8-10
+])
+
+# FIXME: This test is dubious:
+#  1. Both MH and nmh manuals claim that:
+#
+#      2) Within a message list, the following designations may refer to  mes-
+#         sages that do not exist: a single numeric message name[...]
+#
+#     However, neither mhpath implementation follows this claim.  Should we?
+#  2. If a single non-existent message number is given, both MH and nmh
+#     implementations of mhpath produce the following error message:
+#
+#      mhpath: message N out of range X-Y
+#
+#     The diagnostics produced by my implementation differs.  This should
+#     be fixed, all the more that:
+#  3. The rest of utilities, when given a single non-existent message number,
+#     produce the following error message:
+#      
+#      folder: message N doesn't exist
+#
+#     Note the contracted negation, in place of a full one in MU diagnostics.
+#
+
+MH_CHECK([mhpath nonexistent],[mhpath05 mhparam_nonexistent],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+dir=`pwd`
+mhpath 10 | sed 's|^'"$dir"'/||'
+],
+[0],
+[],
+[mhpath: message 10 does not exist
+])
+
+MH_CHECK([mhpath new],[mhpath06 mhparam_new],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+dir=`pwd`
+mhpath new | sed 's|^'"$dir"'/||'
+],
+[0],
+[Mail/inbox/6
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of mhpath.at
diff --git a/mh/tests/refile.at b/mh/tests/refile.at
new file mode 100644
index 0000000..2fee41f
--- /dev/null
+++ b/mh/tests/refile.at
@@ -0,0 +1,75 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[refile])
+
+MH_CHECK([refile],[refile00],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/teaparty])
+echo 'Current-Folder: teaparty' > Mail/context
+refile 3 4 +inbox || exit $?
+find Mail/inbox -name '[[0-9]]' | sort
+cmp Mail/inbox/6 Mail/teaparty/,3 >/dev/null || echo "Message 3 differs"
+cmp Mail/inbox/7 Mail/teaparty/,4 >/dev/null || echo "Message 4 differs"
+],
+[0],
+[Mail/inbox/1
+Mail/inbox/2
+Mail/inbox/3
+Mail/inbox/4
+Mail/inbox/5
+Mail/inbox/6
+Mail/inbox/7
+])
+
+MH_CHECK([refile -file],[refile01 refile-file],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+cp Mail/inbox/2 message
+refile -file `pwd`/message +inbox || exit $?
+find Mail/inbox -name '[[0-9]]' | sort
+cmp Mail/inbox/2 Mail/inbox/6 >/dev/null || echo "Message differs"
+],
+[0],
+[Mail/inbox/1
+Mail/inbox/2
+Mail/inbox/3
+Mail/inbox/4
+Mail/inbox/5
+Mail/inbox/6
+])
+
+MH_CHECK([refile --copy],[refile02 refile--copy],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail/teaparty])
+echo 'Current-Folder: teaparty' > Mail/context
+refile --copy 3 4 +inbox || exit $?
+find Mail/inbox -name '[[0-9]]' | sort
+cmp Mail/inbox/6 Mail/teaparty/3 >/dev/null || echo "Message 3 differs"
+cmp Mail/inbox/7 Mail/teaparty/4 >/dev/null || echo "Message 4 differs"
+],
+[0],
+[Mail/inbox/1
+Mail/inbox/2
+Mail/inbox/3
+Mail/inbox/4
+Mail/inbox/5
+Mail/inbox/6
+Mail/inbox/7
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of refile.at
diff --git a/maidag/tests/url-mbox.at b/mh/tests/rmf.at
similarity index 54%
copy from maidag/tests/url-mbox.at
copy to mh/tests/rmf.at
index dd29ab4..7b0b37a 100644
--- a/maidag/tests/url-mbox.at
+++ b/mh/tests/rmf.at
@@ -14,21 +14,32 @@
 # You should have received a copy of the GNU General Public License
 # along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
 
-AT_SETUP([URL mode])
-AT_KEYWORDS([maidag url-mbox url])
+m4_pushdef[MH_KEYWORDS],[rmm])
 
-AT_CHECK([
-echo ENVELOPE > expout
-cat $abs_top_srcdir/maidag/tests/input.msg >> expout
-echo "" >> expout
-mkdir spool
+MH_CHECK([rmf +folder],[rmf00 rmf+folder],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+echo 'Current-Folder: inbox' > Mail/context
+rmf +teaparty || exit $?
+find Mail -type d
+],
+[0],
+[Mail
+Mail/inbox
+])
 
-maidag MAIDAG_OPTIONS --from 'address@hidden' --url mbox:spool/out < dnl
- $abs_top_srcdir/maidag/tests/input.msg || exit $?
-sed '1s/From address@hidden/ENVELOPE/' spool/out
+MH_CHECK([rmf],[rmf01 rmf_cur],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/teaparty,[Mail])
+echo 'Current-Folder: teaparty' > Mail/context
+rmf || exit $?
+find Mail -type d
 ],
 [0],
-[expout])
+[[[+inbox now current]]
+Mail
+Mail/inbox
+])
 
-AT_CLEANUP
- 
\ No newline at end of file
+m4_popdef[MH_KEYWORDS])
+# End of rmf.at
diff --git a/maidag/tests/url-mbox.at b/mh/tests/rmm.at
similarity index 52%
copy from maidag/tests/url-mbox.at
copy to mh/tests/rmm.at
index dd29ab4..52ece5b 100644
--- a/maidag/tests/url-mbox.at
+++ b/mh/tests/rmm.at
@@ -14,21 +14,38 @@
 # You should have received a copy of the GNU General Public License
 # along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
 
-AT_SETUP([URL mode])
-AT_KEYWORDS([maidag url-mbox url])
+m4_pushdef[MH_KEYWORDS],[rmm])
 
-AT_CHECK([
-echo ENVELOPE > expout
-cat $abs_top_srcdir/maidag/tests/input.msg >> expout
-echo "" >> expout
-mkdir spool
+MH_CHECK([rmm msg],[rmm00 rmm-msg],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+rmm 4 || exit $?
+find Mail/inbox -name '[[0-9]]' | sort
+],
+[0],
+[Mail/inbox/1
+Mail/inbox/2
+Mail/inbox/3
+Mail/inbox/5
+])
 
-maidag MAIDAG_OPTIONS --from 'address@hidden' --url mbox:spool/out < dnl
- $abs_top_srcdir/maidag/tests/input.msg || exit $?
-sed '1s/From address@hidden/ENVELOPE/' spool/out
+MH_CHECK([rmm seq],[rmm01 rmm-seq],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo 'Current-Folder: inbox' > Mail/context
+cat > Mail/inbox/.mh_sequences <<EOT
+test: 2 3 5 
+cur: 1
+EOT
+rmm test || exit $?
+find Mail/inbox -name '[[0-9]]' | sort
+sed '/^$/d' Mail/inbox/.mh_sequences
 ],
 [0],
-[expout])
+[Mail/inbox/1
+Mail/inbox/4
+test: 2 3 5 
+cur: 1
+])
 
-AT_CLEANUP
- 
\ No newline at end of file
+m4_popdef[MH_KEYWORDS])
+# End of rmm.at
diff --git a/mh/tests/scan.at b/mh/tests/scan.at
new file mode 100644
index 0000000..f62c0c6
--- /dev/null
+++ b/mh/tests/scan.at
@@ -0,0 +1,82 @@
+# This file is part of GNU Mailutils. -*- Autotest -*-
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# GNU Mailutils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 3, or (at
+# your option) any later version.
+#
+# GNU Mailutils is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Mailutils.  If not, see <http://www.gnu.org/licenses/>.
+
+m4_pushdef[MH_KEYWORDS],[scan])
+
+MH_CHECK([scan],[scan00],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+echo "Current-Folder: inbox" > Mail/context
+scan | sed 's/ *$//'
+],
+[0],
+[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+   2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   5  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
+])
+
+MH_CHECK([scan -folder],[scan01 scan-folder],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail/inbox])
+scan +inbox | sed 's/ *$//'
+],
+[0],
+[   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+   2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   5  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 Content-
+])
+
+MH_CHECK([scan -format],[scan02 scan-format],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail])
+scan +mbox1 -format '%4(msg) %(decode(friendly{from})) - 
%(decode(friendly{to}))'
+],
+[0],
+[   1 Foo Bar <address@hidden> - Bar <address@hidden>
+   2 Bar <address@hidden> - Foo Bar <address@hidden>
+   3 Sergey Poznyakoff <address@hidden> - Foo Bar <address@hidden
+   4 Sergey Poznyakoff <address@hidden> - Foo Bar <address@hidden
+   5 Sergey Poznyakoff <address@hidden> - Foo Bar <address@hidden
+])
+
+MH_CHECK([scan -form],[scan03 scan-form],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail])
+echo '%4(msg) %(decode(friendly{from})) - %(decode(friendly{to}))' > formfile
+scan +mbox1 -form formfile
+],
+[0],
+[   1 Foo Bar <address@hidden> - Bar <address@hidden>
+   2 Bar <address@hidden> - Foo Bar <address@hidden>
+   3 Sergey Poznyakoff <address@hidden> - Foo Bar <address@hidden
+   4 Sergey Poznyakoff <address@hidden> - Foo Bar <address@hidden
+   5 Sergey Poznyakoff <address@hidden> - Foo Bar <address@hidden
+])
+
+MH_CHECK([scan -reverse],[scan04 scan-reverse],[
+MUT_MBCOPY($abs_top_srcdir/testsuite/mh/mbox1,[Mail])
+scan +mbox1 -reverse | sed 's/ *$//'
+],
+[0],
+[   5  07/13 Sergey Poznyakoff  Empty MIME Parts<<------- =_aaaaaaaaaa0 
Content-
+   4  07/13 Sergey Poznyakoff  Nested MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   3  07/13 Sergey Poznyakoff  Simple MIME<<------- =_aaaaaaaaaa0 Content-Type:
+   2  12/28 Bar <address@hidden  Re: Jabberwocky<<It seems very pretty, but 
it's
+   1  12/28 Foo Bar <address@hidden  Jabberwocky<<`Twas brillig, and the 
slithy toves
+])
+
+m4_popdef[MH_KEYWORDS])
+# End of scan.at
diff --git a/maidag/tests/testsuite.at b/mh/tests/testsuite.at
similarity index 54%
copy from maidag/tests/testsuite.at
copy to mh/tests/testsuite.at
index cb8ff4f..b992930 100644
--- a/maidag/tests/testsuite.at
+++ b/mh/tests/testsuite.at
@@ -16,18 +16,37 @@
 
 m4_include([testsuite.inc])
 
-m4_define([MAIDAG_OPTIONS],[dnl
---no-site-config dnl
---no-user-config dnl
---set '|mailbox|mailbox-pattern='`pwd`/spool/'${user}' dnl
---set .auth.authorization=system dnl
---stderr])
+m4_define([MH_SETUP],[
+test -d Mail || mkdir Mail
+dir=`pwd`
+MH=$dir/mh_profile
+export MH
+echo "Path: $dir/Mail" > $MH
+exec <&-
+])
+
+m4_define([MH_KEYWORDS])
+
+dnl --------------------------------------------------------------
+dnl MH_CHECK(DESCR, [KW = `'], COMMANDS, [STATUS = `0'],
+dnl          [STDOUT = `'], [STDERR = `']
+dnl
+m4_define([MH_CHECK],[
+AT_SETUP($1)
+AT_KEYWORDS(MH_KEYWORDS[ $2])
+MH_SETUP
+AT_CHECK([$3],[$4],[$5],[$6])
+AT_CLEANUP
+])
 
 AT_INIT
-AT_TESTED([maidag])
-MUT_VERSION(maidag)
-m4_include([mda.at])
-m4_include([lmtp.at])
-m4_include([url-mbox.at])
-m4_include([forward.at])
 
+m4_include([folder.at])
+m4_include([inc.at])
+m4_include([scan.at])
+m4_include([rmm.at])
+m4_include([rmf.at])
+m4_include([mark.at])
+m4_include([mhparam.at])
+m4_include([refile.at])
+m4_include([mhpath.at])
diff --git a/mu/Makefile.am b/mu/Makefile.am
index dfd2c44..7684892 100644
--- a/mu/Makefile.am
+++ b/mu/Makefile.am
@@ -78,6 +78,9 @@ AM_CPPFLAGS = \
   -DPYTHON_LIBS="\"$(PYTHON_LIBS)\"" \
   -DI18NLIBS="\"$(LIBINTL)\""
 
+BUILD_SOURCES=mu-setup.c mu-setup.h
+EXTRA_DIST=mu-setup.c mu-setup.h
+
 mu-setup.h: Makefile.am $(MODULES) $(IDLE_MODULES) 
        $(AM_V_GEN)$(AWK) -f $(top_srcdir)/mu/mu-setup.awk -v mode=h \
            $(MODULES) $(IDLE_MODULES) > mu-setup.h
diff --git a/testsuite/testsuite.inc b/testsuite/testsuite.inc
index 363913f..8c4ab62 100644
--- a/testsuite/testsuite.inc
+++ b/testsuite/testsuite.inc
@@ -44,14 +44,18 @@ AT_CLEANUP
 ])
 
 dnl ------------------------------------------------------------
-dnl MUT_MBCOPY(SRC, DST)  -- Copy mailbox SRC to DST.
+dnl MUT_MBCOPY(SRC, [DST = `.'])  -- Copy mailbox SRC to DST.
 dnl 
 dnl
 m4_define([MUT_MBCOPY],[
 m4_pushdef([__dst],[m4_if([$2],,[.],[$2])])
 m4_pushdef([__basename],[m4_bregexp($1,[.*/\([^/]+\)$],\1)])
 cp -r $1 __dst
-chmod -R +w __dst/__basename
+if test -e __dst/__basename; then
+ chmod -R +w __dst/__basename
+else
+ chmod -R +w __dst
+fi
 m4_popdef([__basename])
 m4_popdef([__dst])
 ])


hooks/post-receive
-- 
GNU Mailutils



reply via email to

[Prev in Thread] Current Thread [Next in Thread]