diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-09-15 00:38:16 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-09-15 00:48:22 +0300 |
commit | 548d50fb19cd66dbe153e4d7e879501bab58c0aa (patch) | |
tree | 15d314cb92ab33406233ffcf79f72461a7b2f280 /libmailutils | |
parent | 7b79a6edcda94d4224bc4cbbe47cb6dcf2ea42db (diff) | |
download | mailutils-548d50fb19cd66dbe153e4d7e879501bab58c0aa.tar.gz mailutils-548d50fb19cd66dbe153e4d7e879501bab58c0aa.tar.bz2 |
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.
Diffstat (limited to 'libmailutils')
43 files changed, 3754 insertions, 2699 deletions
diff --git a/libmailutils/Makefile.am b/libmailutils/Makefile.am index f28b1bdbc..ea8d7389d 100644 --- a/libmailutils/Makefile.am +++ b/libmailutils/Makefile.am | |||
@@ -24,7 +24,7 @@ YLWRAP = $(SHELL) $(mu_aux_dir)/gylwrap | |||
24 | AM_YFLAGS=-vt | 24 | AM_YFLAGS=-vt |
25 | AM_LFLAGS=-dvp | 25 | AM_LFLAGS=-dvp |
26 | 26 | ||
27 | SUBDIRS = testsuite | 27 | SUBDIRS = tests |
28 | 28 | ||
29 | lib_LTLIBRARIES = libmailutils.la | 29 | lib_LTLIBRARIES = libmailutils.la |
30 | 30 | ||
diff --git a/libmailutils/testsuite/Decode b/libmailutils/tests/Decode index da6724734..da6724734 100644 --- a/libmailutils/testsuite/Decode +++ b/libmailutils/tests/Decode | |||
diff --git a/libmailutils/testsuite/Encode b/libmailutils/tests/Encode index c86626638..c86626638 100644 --- a/libmailutils/testsuite/Encode +++ b/libmailutils/tests/Encode | |||
Binary files differ | |||
diff --git a/libmailutils/tests/Makefile.am b/libmailutils/tests/Makefile.am new file mode 100644 index 000000000..4cee19cfb --- /dev/null +++ b/libmailutils/tests/Makefile.am | |||
@@ -0,0 +1,100 @@ | |||
1 | # This file is part of GNU Mailutils. | ||
2 | # Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | ||
3 | # | ||
4 | # GNU Mailutils is free software; you can redistribute it and/or | ||
5 | # modify it under the terms of the GNU General Public License as | ||
6 | # published by the Free Software Foundation; either version 3, or (at | ||
7 | # your option) any later version. | ||
8 | # | ||
9 | # This program is distributed in the hope that it will be useful, but | ||
10 | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
12 | # General Public License for more details. | ||
13 | # | ||
14 | # You should have received a copy of the GNU General Public License | ||
15 | # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. | ||
16 | |||
17 | EXTRA_DIST = $(TESTSUITE_AT) testsuite package.m4 | ||
18 | DISTCLEANFILES = atconfig $(check_SCRIPTS) | ||
19 | MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE) | ||
20 | |||
21 | ## ------------ ## | ||
22 | ## package.m4. ## | ||
23 | ## ------------ ## | ||
24 | |||
25 | $(srcdir)/package.m4: $(top_srcdir)/configure.ac | ||
26 | $(AM_V_GEN){ \ | ||
27 | echo '# Signature of the current package.'; \ | ||
28 | echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \ | ||
29 | echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \ | ||
30 | echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \ | ||
31 | echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \ | ||
32 | echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \ | ||
33 | } >$(srcdir)/package.m4 | ||
34 | |||
35 | # | ||
36 | |||
37 | ## -------------------------- ## | ||
38 | ## Non-installable programs | ||
39 | ## -------------------------- ## | ||
40 | |||
41 | INCLUDES = @MU_LIB_COMMON_INCLUDES@ | ||
42 | noinst_PROGRAMS = \ | ||
43 | addr\ | ||
44 | argcv\ | ||
45 | decode2047\ | ||
46 | encode2047\ | ||
47 | fltst\ | ||
48 | mailcap\ | ||
49 | mimetest\ | ||
50 | url-parse | ||
51 | |||
52 | LDADD =\ | ||
53 | ../../lib/libmuaux.la\ | ||
54 | ${MU_LIB_MBOX}\ | ||
55 | ${MU_LIB_IMAP}\ | ||
56 | ${MU_LIB_POP}\ | ||
57 | ${MU_LIB_AUTH}\ | ||
58 | @MU_AUTHLIBS@\ | ||
59 | ${MU_LIB_MAILUTILS} | ||
60 | |||
61 | EXTRA_DIST += Encode Decode | ||
62 | |||
63 | ## ------------ ## | ||
64 | ## Test suite. ## | ||
65 | ## ------------ ## | ||
66 | |||
67 | TESTSUITE_AT = \ | ||
68 | address.at\ | ||
69 | argcv.at\ | ||
70 | base64d.at\ | ||
71 | base64e.at\ | ||
72 | decode2047.at\ | ||
73 | encode2047.at\ | ||
74 | mailcap.at\ | ||
75 | mime.at\ | ||
76 | testsuite.at\ | ||
77 | url.at | ||
78 | |||
79 | TESTSUITE = $(srcdir)/testsuite | ||
80 | M4=m4 | ||
81 | |||
82 | AUTOTEST = $(AUTOM4TE) --language=autotest | ||
83 | $(TESTSUITE): package.m4 $(TESTSUITE_AT) | ||
84 | $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp | ||
85 | $(AM_V_at)mv $@.tmp $@ | ||
86 | |||
87 | atconfig: $(top_builddir)/config.status | ||
88 | cd $(top_builddir) && ./config.status tests/$@ | ||
89 | |||
90 | clean-local: | ||
91 | @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean | ||
92 | |||
93 | check-local: atconfig atlocal $(TESTSUITE) | ||
94 | @$(SHELL) $(TESTSUITE) | ||
95 | |||
96 | # Run the test suite on the *installed* tree. | ||
97 | #installcheck-local: | ||
98 | # $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin | ||
99 | |||
100 | |||
diff --git a/libmailutils/tests/addr.c b/libmailutils/tests/addr.c new file mode 100644 index 000000000..7e91f9953 --- /dev/null +++ b/libmailutils/tests/addr.c | |||
@@ -0,0 +1,103 @@ | |||
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | ||
2 | Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007, 2010 Free Software | ||
3 | Foundation, Inc. | ||
4 | |||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 3, or (at your option) | ||
8 | any later version. | ||
9 | |||
10 | GNU Mailutils is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNU Mailutils; if not, write to the Free Software | ||
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
18 | MA 02110-1301 USA */ | ||
19 | |||
20 | #ifdef HAVE_CONFIG_H | ||
21 | # include <config.h> | ||
22 | #endif | ||
23 | #include <stdio.h> | ||
24 | #include <string.h> | ||
25 | #include <errno.h> | ||
26 | |||
27 | #include <mailutils/address.h> | ||