Commit b6e0ad60 b6e0ad60c137cde4f70a897710a9597b68e52f6f by Sergey Poznyakoff

mail: add tests in a non-interactive mode

* configure.ac: Configure mail/tests subdirectory.
* mail/Makefile.am (SUBDIRS): Add tests.
* mail/tests/testsuite.at: New file.
* mail/tests/Makefile.am: New file.
* mail/tests/.gitignore: New file.
* mail/tests/atlocal.in: New file.
* mail/tests/cols00.at: New file.
* mail/tests/cols01.at: New file.
* mail/tests/copy00.at: New file.
* mail/tests/nohome.at: New file.
* mail/tests/version.at: New file.
1 parent eea2c4aa
...@@ -1316,6 +1316,7 @@ AC_CONFIG_TESTDIR(testsuite) ...@@ -1316,6 +1316,7 @@ AC_CONFIG_TESTDIR(testsuite)
1316 AC_CONFIG_TESTDIR(libmu_compat/tests) 1316 AC_CONFIG_TESTDIR(libmu_compat/tests)
1317 AC_CONFIG_TESTDIR(frm/tests) 1317 AC_CONFIG_TESTDIR(frm/tests)
1318 AC_CONFIG_TESTDIR(maidag/tests) 1318 AC_CONFIG_TESTDIR(maidag/tests)
1319 AC_CONFIG_TESTDIR(mail/tests)
1319 AC_CONFIG_TESTDIR(messages/tests) 1320 AC_CONFIG_TESTDIR(messages/tests)
1320 AC_CONFIG_TESTDIR(readmsg/tests) 1321 AC_CONFIG_TESTDIR(readmsg/tests)
1321 AC_CONFIG_TESTDIR(sieve/tests) 1322 AC_CONFIG_TESTDIR(sieve/tests)
...@@ -1337,6 +1338,8 @@ AC_CONFIG_FILES([libmailutils/tests/Makefile ...@@ -1337,6 +1338,8 @@ AC_CONFIG_FILES([libmailutils/tests/Makefile
1337 imap4d/tests/atlocal 1338 imap4d/tests/atlocal
1338 maidag/tests/Makefile 1339 maidag/tests/Makefile
1339 maidag/tests/atlocal 1340 maidag/tests/atlocal
1341 mail/tests/Makefile
1342 mail/tests/atlocal
1340 messages/tests/Makefile 1343 messages/tests/Makefile
1341 messages/tests/atlocal 1344 messages/tests/atlocal
1342 readmsg/tests/Makefile 1345 readmsg/tests/Makefile
......
...@@ -100,5 +100,5 @@ mail_SOURCES = \ ...@@ -100,5 +100,5 @@ mail_SOURCES = \
100 write.c\ 100 write.c\
101 z.c 101 z.c
102 102
103 SUBDIRS = testsuite 103 SUBDIRS = testsuite tests
104 104
......
1 atconfig
2 atlocal
3 package.m4
4 testsuite
5 testsuite.dir
6 testsuite.log
1 # This file is part of GNU Mailutils.
2 # Copyright (C) 2007-2012, 2014-2015 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 # GNU Mailutils 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 ## Test suite. ##
39 ## ------------ ##
40
41 TESTSUITE_AT =\
42 cols00.at\
43 cols01.at\
44 copy00.at\
45 nohome.at\
46 testsuite.at\
47 version.at
48
49 TESTSUITE = $(srcdir)/testsuite
50 M4=m4
51
52 AUTOTEST = $(AUTOM4TE) --language=autotest
53 $(TESTSUITE): package.m4 $(TESTSUITE_AT) $(top_srcdir)/testsuite/testsuite.inc
54 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp
55 $(AM_V_at)mv $@.tmp $@
56
57 atconfig: $(top_builddir)/config.status
58 cd $(top_builddir) && ./config.status tests/$@
59
60 clean-local:
61 @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
62
63 check-local: atconfig atlocal $(TESTSUITE)
64 @$(SHELL) $(TESTSUITE)
65
66 # Run the test suite on the *installed* tree.
67 #installcheck-local:
68 # $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
69
70
1 # @configure_input@ -*- shell-script -*-
2 # Configurable variable values for Mailutils test suite.
3 # Copyright (C) 2004, 2010-2012, 2014-2015 Free Software Foundation,
4 # Inc.
5
6 PATH=@abs_builddir@:@abs_top_builddir@/mail:$top_srcdir:$srcdir:$PATH
7 testsuitedir=@abs_top_srcdir@/testsuite
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2015 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 # GNU Mailutils 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 AT_SETUP([setting columns from environment])
18 AT_KEYWORDS([columns cols00])
19
20 # Description: Check if COLUMNS setting is honored.
21 # Reported-By: Dan Jacobson <jidanni@jidanni.org>
22 # References: <87vbgemcc7.fsf@jidanni.org>,
23 # http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00002.html
24
25 AT_CHECK([
26 unset MAILRC
27 COLUMNS=26 mail -nH -E 'set columns=26' -f $testsuitedir/spool/mbox
28 COLUMNS=31 mail -nH -f $testsuitedir/spool/mbox
29 ],
30 [0],
31 [>N 1 Sergey Poznyakoff
32 >N 1 Sergey Poznyakoff Tue
33 ])
34
35 AT_CLEANUP
36
37
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2015 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 # GNU Mailutils 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 AT_SETUP([setting columns])
18 AT_KEYWORDS([columns cols01])
19
20 # Description: Mailutils 2.99.98 ignored columns setting
21 # Reported-By: Dan Jacobson <jidanni@jidanni.org>
22 # References: <87pp6rumzl.fsf@jidanni.org>,
23 # http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00000.html
24
25 AT_CHECK([
26 unset MAILRC
27 mail -nH -E 'set columns=26' -f $testsuitedir/spool/mbox
28 mail -nH -E 'set columns=31' -f $testsuitedir/spool/mbox
29 ],
30 [0],
31 [>N 1 Sergey Poznyakoff
32 >N 1 Sergey Poznyakoff Tue
33 ])
34
35 AT_CLEANUP
36
37
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2015 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 # GNU Mailutils 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 AT_SETUP([copy to stdout])
18 AT_KEYWORDS([copy copy00])
19
20 # Description: Check if COLUMNS setting is honored
21 # Reported-By: Dan Jacobson <jidanni@jidanni.org>
22 # References: <87vbgemcc7.fsf@jidanni.org>,
23 # http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00002.html
24
25 AT_CHECK([
26 test -f /dev/stdout || AT_SKIP_TEST
27 unset MAILRC
28 echo 'copy 1 /dev/stdout' | mail -N -E 'set readonly' -f $testsuitedir/spool/mbox | sed 's/ *$//;/^Held 1 message/d';
29 ],
30 [0],
31 [From gray@example.net Tue Jul 16 12:11:35 2002
32 Organization: Mailutils-tests
33 Received: from example.net (localhost [[127.0.0.1]])
34 by example.net with ESMTP id g6G9BZb00791
35 for <gray@example.net>; Tue, 16 Jul 2002 12:11:35 +0300
36 Message-Id: <200207160911.g6G9BZb00791@example.net>
37 To: Bar <bar@dontmailme.org>
38 Subject: MBOX
39 Date: Tue, 16 Jul 2002 12:11:35 +0300
40 From: Sergey Poznyakoff <gray@example.net>
41
42
43 This is a sample user's mbox.
44
45 "/dev/stdout" 14/438
46
47 ])
48
49 AT_CLEANUP
50
51
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2015 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 # GNU Mailutils 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 AT_SETUP([reading mail with HOME unset])
18 AT_KEYWORDS([nohome])
19
20 # Description: Unsetting HOME caused undesirable effects in mail
21 # Reported-By: Dan Jacobson <jidanni@jidanni.org>
22 # References: <87vbgemcc7.fsf@jidanni.org>,
23 # http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00002.html
24
25 AT_CHECK([
26 unset MAILRC
27 unset HOME
28 MAIL=$testsuitedir/spool/mbox mail -nH
29 ],
30 [0],
31 [>N 1 Sergey Poznyakoff Tue Jul 16 12:11 12/390 MBOX
32 ])
33
34 AT_CLEANUP
35
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007-2012, 2014-2015 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 # GNU Mailutils 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 m4_include([testsuite.inc])
18
19 AT_INIT
20 AT_TESTED([mail])
21
22 m4_include([version.at])
23 m4_include([nohome.at])
24 m4_include([cols00.at])
25 m4_include([cols01.at])
26 m4_include([copy00.at])
...\ No newline at end of file ...\ No newline at end of file
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007-2012, 2014-2015 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 # GNU Mailutils 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 dnl m4_include([testsuite.inc])
18
19 MUT_VERSION(mail)