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)
AC_CONFIG_TESTDIR(libmu_compat/tests)
AC_CONFIG_TESTDIR(frm/tests)
AC_CONFIG_TESTDIR(maidag/tests)
AC_CONFIG_TESTDIR(mail/tests)
AC_CONFIG_TESTDIR(messages/tests)
AC_CONFIG_TESTDIR(readmsg/tests)
AC_CONFIG_TESTDIR(sieve/tests)
......@@ -1337,6 +1338,8 @@ AC_CONFIG_FILES([libmailutils/tests/Makefile
imap4d/tests/atlocal
maidag/tests/Makefile
maidag/tests/atlocal
mail/tests/Makefile
mail/tests/atlocal
messages/tests/Makefile
messages/tests/atlocal
readmsg/tests/Makefile
......
......@@ -100,5 +100,5 @@ mail_SOURCES = \
write.c\
z.c
SUBDIRS = testsuite
SUBDIRS = testsuite tests
......
atconfig
atlocal
package.m4
testsuite
testsuite.dir
testsuite.log
# This file is part of GNU Mailutils.
# Copyright (C) 2007-2012, 2014-2015 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/>.
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
#
## ------------ ##
## Test suite. ##
## ------------ ##
TESTSUITE_AT =\
cols00.at\
cols01.at\
copy00.at\
nohome.at\
testsuite.at\
version.at
TESTSUITE = $(srcdir)/testsuite
M4=m4
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(top_srcdir)/testsuite/testsuite.inc
$(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
# @configure_input@ -*- shell-script -*-
# Configurable variable values for Mailutils test suite.
# Copyright (C) 2004, 2010-2012, 2014-2015 Free Software Foundation,
# Inc.
PATH=@abs_builddir@:@abs_top_builddir@/mail:$top_srcdir:$srcdir:$PATH
testsuitedir=@abs_top_srcdir@/testsuite
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2015 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/>.
AT_SETUP([setting columns from environment])
AT_KEYWORDS([columns cols00])
# Description: Check if COLUMNS setting is honored.
# Reported-By: Dan Jacobson <jidanni@jidanni.org>
# References: <87vbgemcc7.fsf@jidanni.org>,
# http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00002.html
AT_CHECK([
unset MAILRC
COLUMNS=26 mail -nH -E 'set columns=26' -f $testsuitedir/spool/mbox
COLUMNS=31 mail -nH -f $testsuitedir/spool/mbox
],
[0],
[>N 1 Sergey Poznyakoff
>N 1 Sergey Poznyakoff Tue
])
AT_CLEANUP
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2015 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/>.
AT_SETUP([setting columns])
AT_KEYWORDS([columns cols01])
# Description: Mailutils 2.99.98 ignored columns setting
# Reported-By: Dan Jacobson <jidanni@jidanni.org>
# References: <87pp6rumzl.fsf@jidanni.org>,
# http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00000.html
AT_CHECK([
unset MAILRC
mail -nH -E 'set columns=26' -f $testsuitedir/spool/mbox
mail -nH -E 'set columns=31' -f $testsuitedir/spool/mbox
],
[0],
[>N 1 Sergey Poznyakoff
>N 1 Sergey Poznyakoff Tue
])
AT_CLEANUP
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2015 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/>.
AT_SETUP([copy to stdout])
AT_KEYWORDS([copy copy00])
# Description: Check if COLUMNS setting is honored
# Reported-By: Dan Jacobson <jidanni@jidanni.org>
# References: <87vbgemcc7.fsf@jidanni.org>,
# http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00002.html
AT_CHECK([
test -f /dev/stdout || AT_SKIP_TEST
unset MAILRC
echo 'copy 1 /dev/stdout' | mail -N -E 'set readonly' -f $testsuitedir/spool/mbox | sed 's/ *$//;/^Held 1 message/d';
],
[0],
[From gray@example.net Tue Jul 16 12:11:35 2002
Organization: Mailutils-tests
Received: from example.net (localhost [[127.0.0.1]])
by example.net with ESMTP id g6G9BZb00791
for <gray@example.net>; Tue, 16 Jul 2002 12:11:35 +0300
Message-Id: <200207160911.g6G9BZb00791@example.net>
To: Bar <bar@dontmailme.org>
Subject: MBOX
Date: Tue, 16 Jul 2002 12:11:35 +0300
From: Sergey Poznyakoff <gray@example.net>
This is a sample user's mbox.
"/dev/stdout" 14/438
])
AT_CLEANUP
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2015 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/>.
AT_SETUP([reading mail with HOME unset])
AT_KEYWORDS([nohome])
# Description: Unsetting HOME caused undesirable effects in mail
# Reported-By: Dan Jacobson <jidanni@jidanni.org>
# References: <87vbgemcc7.fsf@jidanni.org>,
# http://lists.gnu.org/archive/html/bug-mailutils/2015-04/msg00002.html
AT_CHECK([
unset MAILRC
unset HOME
MAIL=$testsuitedir/spool/mbox mail -nH
],
[0],
[>N 1 Sergey Poznyakoff Tue Jul 16 12:11 12/390 MBOX
])
AT_CLEANUP
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007-2012, 2014-2015 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_include([testsuite.inc])
AT_INIT
AT_TESTED([mail])
m4_include([version.at])
m4_include([nohome.at])
m4_include([cols00.at])
m4_include([cols01.at])
m4_include([copy00.at])
\ No newline at end of file
# This file is part of GNU Mailutils. -*- Autotest -*-
# Copyright (C) 2007-2012, 2014-2015 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/>.
dnl m4_include([testsuite.inc])
MUT_VERSION(mail)