diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2015-05-05 08:39:24 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2015-05-05 08:40:44 +0300 |
commit | b6e0ad60c137cde4f70a897710a9597b68e52f6f (patch) | |
tree | 87a6e5db366794dfe16659e8b8037aa335e30fc8 /mail | |
parent | eea2c4aa6f4383f3288ddc0c9e5084e36d31d9ac (diff) | |
download | mailutils-b6e0ad60c137cde4f70a897710a9597b68e52f6f.tar.gz mailutils-b6e0ad60c137cde4f70a897710a9597b68e52f6f.tar.bz2 |
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.
Diffstat (limited to 'mail')
-rw-r--r-- | mail/Makefile.am | 2 | ||||
-rw-r--r-- | mail/tests/.gitignore | 6 | ||||
-rw-r--r-- | mail/tests/Makefile.am | 70 | ||||
-rw-r--r-- | mail/tests/atlocal.in | 7 | ||||
-rw-r--r-- | mail/tests/cols00.at | 37 | ||||
-rw-r--r-- | mail/tests/cols01.at | 37 | ||||
-rw-r--r-- | mail/tests/copy00.at | 51 | ||||
-rw-r--r-- | mail/tests/nohome.at | 35 | ||||
-rw-r--r-- | mail/tests/testsuite.at | 26 | ||||
-rw-r--r-- | mail/tests/version.at | 19 |
10 files changed, 289 insertions, 1 deletions
diff --git a/mail/Makefile.am b/mail/Makefile.am index 564fda844..85d1a20ea 100644 --- a/mail/Makefile.am +++ b/mail/Makefile.am @@ -100,5 +100,5 @@ mail_SOURCES = \ write.c\ z.c -SUBDIRS = testsuite +SUBDIRS = testsuite tests diff --git a/mail/tests/.gitignore b/mail/tests/.gitignore new file mode 100644 index 000000000..93f8f46ad --- /dev/null +++ b/mail/tests/.gitignore @@ -0,0 +1,6 @@ +atconfig +atlocal +package.m4 +testsuite +testsuite.dir +testsuite.log diff --git a/mail/tests/Makefile.am b/mail/tests/Makefile.am new file mode 100644 index 000000000..166532e45 --- /dev/null +++ b/mail/tests/Makefile.am @@ -0,0 +1,70 @@ +# 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 + + diff --git a/mail/tests/atlocal.in b/mail/tests/atlocal.in new file mode 100644 index 000000000..ee031b58f --- /dev/null +++ b/mail/tests/atlocal.in @@ -0,0 +1,7 @@ +# @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 diff --git a/mail/tests/cols00.at b/mail/tests/cols00.at new file mode 100644 index 000000000..f7497ecd1 --- /dev/null +++ b/mail/tests/cols00.at @@ -0,0 +1,37 @@ +# 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 + + diff --git a/mail/tests/cols01.at b/mail/tests/cols01.at new file mode 100644 index 000000000..cefda5771 --- /dev/null +++ b/mail/tests/cols01.at @@ -0,0 +1,37 @@ +# 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 + + diff --git a/mail/tests/copy00.at b/mail/tests/copy00.at new file mode 100644 index 000000000..c8c96088d --- /dev/null +++ b/mail/tests/copy00.at @@ -0,0 +1,51 @@ +# 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 + + diff --git a/mail/tests/nohome.at b/mail/tests/nohome.at new file mode 100644 index 000000000..31d9b47b5 --- /dev/null +++ b/mail/tests/nohome.at @@ -0,0 +1,35 @@ +# 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 + diff --git a/mail/tests/testsuite.at b/mail/tests/testsuite.at new file mode 100644 index 000000000..9254a2c7e --- /dev/null +++ b/mail/tests/testsuite.at @@ -0,0 +1,26 @@ +# 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 diff --git a/mail/tests/version.at b/mail/tests/version.at new file mode 100644 index 000000000..5f817d8be --- /dev/null +++ b/mail/tests/version.at @@ -0,0 +1,19 @@ +# 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) |