summaryrefslogtreecommitdiff
path: root/mh/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2012-05-31 16:52:18 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2012-06-01 12:23:13 +0300
commit5bce3efcd164e4c8dae1a7bcf892dd9da419eacd (patch)
treeaec03f7d63586b6327016447547c3432cccee22b /mh/tests
parente02df56cb384465b3238c46c6f214f27ee8431ab (diff)
downloadmailutils-5bce3efcd164e4c8dae1a7bcf892dd9da419eacd.tar.gz
mailutils-5bce3efcd164e4c8dae1a7bcf892dd9da419eacd.tar.bz2
inc: accept mail from multiple source mailboxes.
* doc/texinfo/mu-mh.texi: Document changes to inc. * NEWS: Likewise. * mh/inc.c: Accept multiple source mailboxes. (input_file): Remove. (input_file_list): New variable. (opt_handler): Multiple -file options augment input_file_list. (incmbox): New function. (main): Iterate over input_file_list, incorporating mail from each mailbox in it. Bugfix: * libproto/imap/mbox.c (_imap_env_date): Return a 0-terminated string. Fix MH test suite. The ali-everybody tests fails on machines with user database kept in a non-standard storage (e.g. LDAP or NIS). This patch attempts to fix it. * mh/tests/lu.c: New file. * mh/tests/.gitignore: Add lu. * mh/tests/Makefile.am (noinst_PROGRAMS): New variable. * mh/tests/ali.at: Use lu instead of scanning /etc/passwd directly.
Diffstat (limited to 'mh/tests')
-rw-r--r--mh/tests/.gitignore1
-rw-r--r--mh/tests/Makefile.am7
-rw-r--r--mh/tests/ali.at2
-rw-r--r--mh/tests/lu.c31
4 files changed, 40 insertions, 1 deletions
diff --git a/mh/tests/.gitignore b/mh/tests/.gitignore
index 33e4e9a57..cea5b74a8 100644
--- a/mh/tests/.gitignore
+++ b/mh/tests/.gitignore
@@ -1,5 +1,6 @@
atconfig
atlocal
+lu
package.m4
status.mf
testsuite
diff --git a/mh/tests/Makefile.am b/mh/tests/Makefile.am
index c2e991ed3..227adbfec 100644
--- a/mh/tests/Makefile.am
+++ b/mh/tests/Makefile.am
@@ -34,6 +34,13 @@ $(srcdir)/package.m4: $(top_srcdir)/configure.ac
#
+## -------------------------- ##
+## Non-installable programs ##
+## -------------------------- ##
+
+INCLUDES = @MU_LIB_COMMON_INCLUDES@
+noinst_PROGRAMS = lu
+
## ------------ ##
## Test suite. ##
## ------------ ##
diff --git a/mh/tests/ali.at b/mh/tests/ali.at
index 487a6807a..98cd4771a 100644
--- a/mh/tests/ali.at
+++ b/mh/tests/ali.at
@@ -98,7 +98,7 @@ ali -list -a ./mh_aliases korzen
[expout])
MH_CHECK([ali: everybody],[ali06 ali-everybody],[
-cat /etc/passwd | awk -F : '/^#/ { next } $3>200 { print $1 }' > expout
+lu 200 > expout
test -s expout || AT_SKIP_TEST
AT_DATA([mh_aliases],[
everybody: *
diff --git a/mh/tests/lu.c b/mh/tests/lu.c
new file mode 100644
index 000000000..c438f9d8a
--- /dev/null
+++ b/mh/tests/lu.c
@@ -0,0 +1,31 @@
+/* This file is part of GNU Mailutils test suite.
+ Copyright (C) 2012 Free Software Foundation, Inc.
+
+ This file is free software; as a special exception the author gives
+ unlimited permission to copy and/or distribute it, with or without
+ modifications.
+
+ This file is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+#include <sys/types.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* List all user names. With a single numeric argument, list users with UID
+ greater than that argument. */
+int
+main (int argc, char **argv)
+{
+ struct passwd *pw;
+ int minuid = 0;
+
+ if (argc == 2)
+ minuid = atoi (argv[1]);
+ while ((pw = getpwent ()))
+ if (pw->pw_uid > minuid)
+ printf ("%s\n", pw->pw_name);
+ return 0;
+}

Return to:

Send suggestions and report system problems to the System administrator.