Commit 41286c83 41286c83435775028014014e9f7f6414190b4045 by Sergey Poznyakoff

Rewrite frm testsuite in Autotest.

* configure.ac: Build frm/testsuite/Makefile.am and atlocal.
Remove frm/testsuite/Makefile.
* testsuite/testsuite.inc: New file.

* frm/testsuite: Remove DejaGNU-based testsuite.
* frm/tests: Autotest-based testsuite.
* frm/tests/.gitignore
* frm/tests/Makefile.am
* frm/tests/atlocal.in
* frm/tests/testsuite.at

* frm/Makefile.am (SUBDIRS): Replace testsuite with tests.

* sieve/tests/Makefile.am (TESTSUITE): Add an include option.
* sieve/tests/version.at: Use macro from testsuite.inc.
1 parent c68f3eea
......@@ -1211,7 +1211,10 @@ AC_ARG_WITH([mh-bindir],
# Initialize the (autotest) test suite.
AC_CONFIG_TESTDIR(tests)
AC_CONFIG_FILES([sieve/tests/Makefile sieve/tests/atlocal])
AC_CONFIG_FILES([frm/tests/Makefile
frm/tests/atlocal
sieve/tests/Makefile
sieve/tests/atlocal])
AM_MISSING_PROG([AUTOM4TE], [autom4te])
dnl Make sysconfdir available to the application
......@@ -1329,7 +1332,6 @@ AC_CONFIG_FILES([
examples/scheme/Makefile
gint/Makefile
frm/Makefile
frm/testsuite/Makefile
guimb/Makefile
guimb/scm/Makefile
imap4d/Makefile
......
......@@ -20,7 +20,7 @@
INCLUDES = @MU_APP_COMMON_INCLUDES@
SUBDIRS = testsuite
SUBDIRS = tests
bin_PROGRAMS = frm from
frm_SOURCES = frm.c common.c frm.h
......
atconfig
atlocal
package.m4
status.mf
testsuite
testsuite.dir
testsuite.log
# 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
{ \
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\
version.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
# @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@/frm:$top_srcdir:$srcdir:$PATH
top_srcdir=@abs_top_srcdir@
top_builddir=@abs_top_builddir@
initspool() {
test -d data || mkdir data
test -d data/spool || mkdir data/spool
cp $top_srcdir/testsuite/spool/* data/spool
}
\ No newline at end of file
# 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.
# Require a reasonably recent autotest.
m4_version_prereq([2.52g])
m4_define([AT_SKIP_TEST],[exit 77])
dnl ------------------------------------------------------------
dnl FRM_MAILBOX -- mailbox used for testing
m4_define([FRM_MAILBOX],[mbox1])
dnl ------------------------------------------------------------
dnl FRM_OPTIONS -- default options for frm
m4_define([FRM_OPTIONS],[--no-site --no-user])
dnl ------------------------------------------------------------
dnl FRMTEST(DESCR, KW, CMDLINE, [STATUS = `0'], [STDOUT = `'],
dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
dnl
m4_define([FRMTEST],[
AT_SETUP([$1])
AT_KEYWORDS([$2])
AT_CHECK([
MAIL=$top_srcdir/testsuite/spool/FRM_MAILBOX
FOLDER=$MAIL
export MAIL FOLDER
frm FRM_OPTIONS $3],
m4_shift(m4_shift(m4_shift($@))))
AT_CLEANUP])
AT_INIT
AT_TESTED([frm])
m4_include([testsuite.inc])
MUT_VERSION(frm)
FRMTEST([no options],[frm00],
[],
[1],
[Foo Bar Jabberwocky
Bar Re: Jabberwocky
Sergey Poznyakoff Simple MIME
Sergey Poznyakoff Nested MIME
Sergey Poznyakoff Empty MIME Parts
])
FRMTEST([frm -n],[frm-n frm01],
[-n],
[1],
[ 1: Foo Bar Jabberwocky
2: Bar Re: Jabberwocky
3: Sergey Poznyakoff Simple MIME
4: Sergey Poznyakoff Nested MIME
5: Sergey Poznyakoff Empty MIME Parts
])
FRMTEST([frm -l],[frm-l frm02],
[-l],
[1],
[(Bar) Foo Bar Jabberwocky
(Foo Bar) Bar Re: Jabberwocky
(Foo Bar) Sergey Poznyakoff Simple MIME
(Foo Bar) Sergey Poznyakoff Nested MIME
(Foo Bar) Sergey Poznyakoff Empty MIME Parts
])
FRMTEST([frm -qS],[frm-qS frm03],
[-qS],
[1],
[Folder contains 5 new messages.
])
FRMTEST([frm -q],[frm-q frm04],
[-q],
[1],
[There are messages in that folder.
])
FRMTEST([frm +mbox],[frm+mbox frm05],
[--set ":mailbox:folder=$top_srcdir/testsuite/spool" +mbox],
[1],
[Sergey Poznyakoff MBOX
])
FRMTEST([nonexistent mailbox],[frm06],
[-q %nonexistent],
[2],
[No messages in that folder!
])
m4_pushdef([FRM_MAILBOX],[bigto.mbox])
FRMTEST([frm -l on long headers],[frm07],
[-l],
[1],
[(Ayoung-Chee, Nigel Paul -- Nigel Paul Ayoung-Chee) Patrick Chan New email address, etc.
])
m4_popdef([FRM_MAILBOX])
Makefile
Makefile.in
*.log
*.sum
site.exp
remote.exp
data
## 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 = frm
RUNTESTFLAGS =
CLEANFILES = *.log
test_dirs = frm
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
test.exp
\ No newline at end of file
# -*- 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 -retcode 1 -message "frm" "Foo Bar\tJabberwocky"\
"Bar\tRe: Jabberwocky"\
"Sergey Poznyakoff\tSimple MIME"\
"Sergey Poznyakoff\tNested MIME"\
"Sergey Poznyakoff\tEmpty MIME Parts"
mu_exec -retcode 1 -message "frm -n" -arg -n \
" 1:\tFoo Bar\tJabberwocky"\
" 2:\tBar\tRe: Jabberwocky"\
" 3:\tSergey Poznyakoff\tSimple MIME"\
" 4:\tSergey Poznyakoff\tNested MIME"\
" 5:\tSergey Poznyakoff\tEmpty MIME Parts"
mu_exec -retcode 1 -message "frm -l" -arg -l \
"(Bar)\tFoo Bar\tJabberwocky"\
"(Foo Bar)\tBar\tRe: Jabberwocky"\
"(Foo Bar)\tSergey Poznyakoff\tSimple MIME"\
"(Foo Bar)\tSergey Poznyakoff\tNested MIME"\
"(Foo Bar)\tSergey Poznyakoff\tEmpty MIME Parts"
mu_exec -retcode 1 -message "frm -qS" -arg -qS \
"Folder contains 5 new messages."
mu_exec -retcode 1 -arg -q -message "frm -q" \
"There are messages in that folder."
mu_exec -retcode 1 -arg "--set mailbox.folder=\"'$MU_SPOOL_DIR'\"" -arg +mbox -message "frm +mbox" \
"Sergey Poznyakoff\tMBOX"
mu_exec -arg -q -arg %nonexistent -retcode 2 -message "frm -q %nonexistent" \
"No messages in that folder!"
set env(MAIL) $MU_SPOOL_DIR/bigto.mbox
unset env(FOLDER)
mu_exec -retcode 1 -message "frm -l on long headers" -arg -l \
"(Ayoung-Chee, Nigel Paul -- Nigel Paul Ayoung-Chee)\tPatrick Chan\tNew email address, etc."
#end of test.exp
......@@ -68,7 +68,7 @@ M4=m4
AUTOTEST = $(AUTOM4TE) --language=autotest
$(TESTSUITE): package.m4 $(TESTSUITE_AT)
$(AM_V_GEN)$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp
$(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp
$(AM_V_at)mv $@.tmp $@
atconfig: $(top_builddir)/config.status
......
......@@ -15,20 +15,6 @@
# along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
# This file is part of Mailfromd testsuite.
AT_SETUP([sieve version])
m4_include([testsuite.inc])
AT_CHECK([sieve --version | sed '1{s/ *[\[.*\]]//;q}' ],
[0],
[sieve (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
],
[],
[cat >$[]XFAILFILE <<'_EOT'
==============================================================
WARNING: Not using the proper version, *all* checks dubious...
==============================================================
_EOT
],
[rm -f $[]XFAILFILE])
AT_CLEANUP
MUT_VERSION(frm)
......
# 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.
dnl ------------------------------------------------------------
dnl MUT_VERSION(TOOL) -- checks the version output from TOOL
dnl
m4_define([MUT_VERSION],[
AT_SETUP([$1 version])
AT_CHECK([$1 --version | sed '1{s/ *[\[.*\]]//;q}' ],
[0],
[$1 (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
],
[],
[cat >$[]XFAILFILE <<'_EOT'
==============================================================
WARNING: Not using the proper version, *all* checks dubious...
==============================================================
_EOT
],
[rm -f $[]XFAILFILE])
AT_CLEANUP
])
\ No newline at end of file