diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-09-15 01:08:00 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-09-15 01:08:00 +0300 |
commit | 3397a3ae738cd7f1dfc8820c6575b241394f7c85 (patch) | |
tree | ef397e3de4ee9ee552a847a3305fac971839e6a2 /messages | |
parent | 548d50fb19cd66dbe153e4d7e879501bab58c0aa (diff) | |
download | mailutils-3397a3ae738cd7f1dfc8820c6575b241394f7c85.tar.gz mailutils-3397a3ae738cd7f1dfc8820c6575b241394f7c85.tar.bz2 |
Rewrite testsuite for messages in Autotest.
* configure.ac: Remove messages/testsuite
* messages/Makefile.am (SUBDIRS): Replace testsuite with tests.
* messages/tests/.gitignore: New file.
* messages/tests/Makefile.am: New file.
* messages/tests/atlocal.in: New file.
* messages/tests/testsuite.at: New file.
* messages/testsuite: Remove.
Diffstat (limited to 'messages')
-rw-r--r-- | messages/Makefile.am | 2 | ||||
-rw-r--r-- | messages/tests/.gitignore | 6 | ||||
-rw-r--r-- | messages/tests/Makefile.am | 64 | ||||
-rw-r--r-- | messages/tests/atlocal.in | 9 | ||||
-rw-r--r-- | messages/tests/testsuite.at | 66 | ||||
-rw-r--r-- | messages/testsuite/.gitignore | 7 | ||||
-rw-r--r-- | messages/testsuite/Makefile.am | 89 | ||||
-rw-r--r-- | messages/testsuite/messages/DISTFILES | 1 | ||||
-rw-r--r-- | messages/testsuite/messages/test.exp | 38 |
9 files changed, 146 insertions, 136 deletions
diff --git a/messages/Makefile.am b/messages/Makefile.am index c9edf3504..a6e49ac5a 100644 --- a/messages/Makefile.am +++ b/messages/Makefile.am @@ -20,7 +20,7 @@ INCLUDES = @MU_APP_COMMON_INCLUDES@ -SUBDIRS = testsuite +SUBDIRS = tests bin_PROGRAMS = messages messages_SOURCES = messages.c diff --git a/messages/tests/.gitignore b/messages/tests/.gitignore new file mode 100644 index 000000000..93f8f46ad --- /dev/null +++ b/messages/tests/.gitignore @@ -0,0 +1,6 @@ +atconfig +atlocal +package.m4 +testsuite +testsuite.dir +testsuite.log diff --git a/messages/tests/Makefile.am b/messages/tests/Makefile.am new file mode 100644 index 000000000..be7ac1011 --- /dev/null +++ b/messages/tests/Makefile.am @@ -0,0 +1,64 @@ +# This file is part of GNU Mailutils. +# Copyright (C) 2007, 2008, 2009, 2010 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. +# +# This program 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 = testsuite.at + +TESTSUITE = $(srcdir)/testsuite +M4=m4 + +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): package.m4 $(TESTSUITE_AT) + $(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/messages/tests/atlocal.in b/messages/tests/atlocal.in new file mode 100644 index 000000000..31b50eaf9 --- /dev/null +++ b/messages/tests/atlocal.in @@ -0,0 +1,9 @@ +# @configure_input@ -*- shell-script -*- +# Configurable variable values for Mailutils test suite. +# Copyright (C) 2004, 2010 Free Software Foundation, Inc. + +PATH=@abs_builddir@:@abs_top_builddir@/messages:$top_srcdir:$srcdir:$PATH +top_srcdir=@abs_top_srcdir@ +top_builddir=@abs_top_builddir@ + +
\ No newline at end of file diff --git a/messages/tests/testsuite.at b/messages/tests/testsuite.at new file mode 100644 index 000000000..fe0eacacd --- /dev/null +++ b/messages/tests/testsuite.at @@ -0,0 +1,66 @@ +# This file is part of GNU Mailutils. -*- Autotest -*- +# Copyright (C) 2007, 2008, 2009, 2010 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. +# +# This program 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/>. +# This file is part of Mailfromd testsuite. + +m4_include([testsuite.inc]) + +dnl ------------------------------------------------------------ +dnl MSG_MAILBOX -- mailbox used for testing +m4_define([MSG_MAILBOX],[mbox1]) + +dnl ------------------------------------------------------------ +dnl MSG_OPTIONS -- default options for frm +m4_define([MSG_OPTIONS],[--no-site --no-user]) + +dnl ------------------------------------------------------------ +dnl MSGTEST(DESCR, KW, CMDLINE, [STATUS = `0'], [STDOUT = `'], +dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS]) +dnl +m4_define([MSGTEST],[ +AT_SETUP([$1]) +AT_KEYWORDS([messages $2]) +AT_CHECK([ +MAIL=$top_srcdir/testsuite/spool/MSG_MAILBOX +FOLDER=$MAIL +export MAIL FOLDER +messages MSG_OPTIONS $3 | sed 's|in /.*/|in |'], +m4_shift(m4_shift(m4_shift($@)))) +AT_CLEANUP]) + +AT_INIT + +AT_TESTED([messages]) + +MUT_VERSION(messages) + +MSGTEST([messages],[messages00], +[], +[0], +[Number of messages in mbox1: 5 +]) + +MSGTEST([messages -q],[messages01 messages-q], +[-q], +[0], +[5 +]) + +MSGTEST([messages 2],[messages02], +[--set ":mailbox:folder=$top_srcdir/testsuite/spool" +teaparty.mbox], +[0], +[Number of messages in teaparty.mbox: 95 +]) + diff --git a/messages/testsuite/.gitignore b/messages/testsuite/.gitignore deleted file mode 100644 index 989f5903e..000000000 --- a/messages/testsuite/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -*.log -*.sum -site.exp -remote.exp -data diff --git a/messages/testsuite/Makefile.am b/messages/testsuite/Makefile.am deleted file mode 100644 index 80bb8ec4b..000000000 --- a/messages/testsuite/Makefile.am +++ /dev/null @@ -1,89 +0,0 @@ -## Process this file with GNU Automake to create Makefile.in - -## Copyright (C) 2002, 2007, 2010 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. -## -## This program 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 this program; if not, write to the Free Software -## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA -## 02110-1301 USA - -AUTOMAKE_OPTIONS = dejagnu -DEJATOOL = messages -RUNTESTFLAGS = -CLEANFILES = *.log -test_dirs = messages - -dist-hook: - here=`cd $(top_builddir)/$(subdir) && pwd`; \ - srcdir=`cd $(srcdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - for dir in $(test_dirs); \ - do \ - cd $$srcdir;\ - mkdir $$distdir/$$dir;\ - cd $$dir;\ - for file in DISTFILES `cat DISTFILES`; do \ - d=$$srcdir/$$dir; \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $$distdir/$$dir/$$file; \ - else \ - test -f $$distdir/$$dir/$$file \ - || cp -p $$d/$$file $$distdir/$$dir/$$file || exit; \ - fi; \ - done;\ - done;\ - cd $$here - -site.exp: Makefile remote.exp - @echo 'Making a new site.exp file...' - @test ! -f site.bak || rm -f site.bak - @echo '## these variables are automatically generated by make ##' > $@-t - @echo '# Do not edit here. If you wish to override these values' >> $@-t - @echo '# edit the last section' >> $@-t - @echo 'set tool $(DEJATOOL)' >> $@-t - @echo "set top_srcdir `cd $(top_srcdir); pwd`" >> $@-t - @echo "set srcdir `cd $(srcdir); pwd`" >> $@-t - @echo 'set objdir' `pwd` >> $@-t - @echo 'set host_alias "$(host_alias)"' >> $@-t - @echo 'set host_triplet $(host_triplet)' >> $@-t - @echo 'set target_alias "$(target_alias)"' >> $@-t - @echo 'set target_triplet $(target_triplet)' >> $@-t - @echo 'set build_alias "$(build_alias)"' >> $@-t - @echo 'set build_triplet $(build_triplet)' >> $@-t - @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t - @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t - @test ! -f site.exp || mv site.exp site.bak - @mv $@-t site.exp - -remote.exp:; - @echo 'Making a new remote.exp file...' - @test ! -f remote.bak || rm -f remote.bak - @echo '## These variables are used to set up for the remote testing.' >> $@-t - @echo '## Please, read file README in this directory for instructions' >> $@-t - @echo '## on how to use this file' >> $@-t - @echo "set host_board `hostname`" >> $@-t - @echo 'set board_info($$host_board,connect) rlogin' >> $@-t - @echo 'set board_info($$host_board,shell_prompt) "\\$$ "' >> $@-t - @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t - @echo "set board_info(\$$host_board,srcdir) `cd $(srcdir); pwd`" >> $@-t - @echo "set board_info(\$$host_board,objdir) `pwd`" >> $@-t - @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t - @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t - @test ! -f remote.exp || mv remote.exp remote.bak - @mv $@-t remote.exp - - -DISTCLEANFILES=*.exp *.log *.sum - -distclean-local: - -rm -rf data diff --git a/messages/testsuite/messages/DISTFILES b/messages/testsuite/messages/DISTFILES deleted file mode 100644 index adf7c0985..000000000 --- a/messages/testsuite/messages/DISTFILES +++ /dev/null @@ -1 +0,0 @@ -test.exp diff --git a/messages/testsuite/messages/test.exp b/messages/testsuite/messages/test.exp deleted file mode 100644 index 8af2d0448..000000000 --- a/messages/testsuite/messages/test.exp +++ /dev/null @@ -1,38 +0,0 @@ -# -*- tcl -*- -# This file is part of Mailutils testsuite. -# Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc. -# -# This program 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 of the License, or -# (at your option) any later version. -# -# This program 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 this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA. - -source $top_srcdir/testsuite/lib/mailutils.exp - -mu_init -noflags -set env(MAIL) $MU_SPOOL_DIR/mbox1 -set env(FOLDER) $env(MAIL) - -mu_prepare_spools - -mu_exec -message "messages" \ -"Number of messages in $MU_SPOOL_DIR/mbox1: 5" - -mu_exec -message "messages -q" -arg -q "5" - -mu_exec -message "messages +teaparty.mbox" \ - -arg "--set mailbox.folder=\"'$MU_SPOOL_DIR'\"" -arg +teaparty.mbox \ -"Number of messages in $MU_SPOOL_DIR/teaparty.mbox: 95" - -#end of test.exp - |