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], ...@@ -1211,7 +1211,10 @@ AC_ARG_WITH([mh-bindir],
1211 1211
1212 # Initialize the (autotest) test suite. 1212 # Initialize the (autotest) test suite.
1213 AC_CONFIG_TESTDIR(tests) 1213 AC_CONFIG_TESTDIR(tests)
1214 AC_CONFIG_FILES([sieve/tests/Makefile sieve/tests/atlocal]) 1214 AC_CONFIG_FILES([frm/tests/Makefile
1215 frm/tests/atlocal
1216 sieve/tests/Makefile
1217 sieve/tests/atlocal])
1215 AM_MISSING_PROG([AUTOM4TE], [autom4te]) 1218 AM_MISSING_PROG([AUTOM4TE], [autom4te])
1216 1219
1217 dnl Make sysconfdir available to the application 1220 dnl Make sysconfdir available to the application
...@@ -1329,7 +1332,6 @@ AC_CONFIG_FILES([ ...@@ -1329,7 +1332,6 @@ AC_CONFIG_FILES([
1329 examples/scheme/Makefile 1332 examples/scheme/Makefile
1330 gint/Makefile 1333 gint/Makefile
1331 frm/Makefile 1334 frm/Makefile
1332 frm/testsuite/Makefile
1333 guimb/Makefile 1335 guimb/Makefile
1334 guimb/scm/Makefile 1336 guimb/scm/Makefile
1335 imap4d/Makefile 1337 imap4d/Makefile
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 20
21 INCLUDES = @MU_APP_COMMON_INCLUDES@ 21 INCLUDES = @MU_APP_COMMON_INCLUDES@
22 22
23 SUBDIRS = testsuite 23 SUBDIRS = tests
24 24
25 bin_PROGRAMS = frm from 25 bin_PROGRAMS = frm from
26 frm_SOURCES = frm.c common.c frm.h 26 frm_SOURCES = frm.c common.c frm.h
......
1 atconfig
2 atlocal
3 package.m4
4 status.mf
5 testsuite
6 testsuite.dir
7 testsuite.log
1 # This file is part of GNU Mailutils.
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 { \
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 testsuite.at\
43 version.at
44
45 TESTSUITE = $(srcdir)/testsuite
46 M4=m4
47
48 AUTOTEST = $(AUTOM4TE) --language=autotest
49 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
50 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp
51 $(AM_V_at)mv $@.tmp $@
52
53 atconfig: $(top_builddir)/config.status
54 cd $(top_builddir) && ./config.status tests/$@
55
56 clean-local:
57 @test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
58
59 check-local: atconfig atlocal $(TESTSUITE)
60 @$(SHELL) $(TESTSUITE)
61
62 # Run the test suite on the *installed* tree.
63 #installcheck-local:
64 # $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
65
66
1 # @configure_input@ -*- shell-script -*-
2 # Configurable variable values for Mailutils test suite.
3 # Copyright (C) 2004, 2010 Free Software Foundation, Inc.
4
5 PATH=@abs_builddir@:@abs_top_builddir@/frm:$top_srcdir:$srcdir:$PATH
6 top_srcdir=@abs_top_srcdir@
7 top_builddir=@abs_top_builddir@
8
9 initspool() {
10 test -d data || mkdir data
11 test -d data/spool || mkdir data/spool
12 cp $top_srcdir/testsuite/spool/* data/spool
13 }
14
...\ 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, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 # Require a reasonably recent autotest.
19 m4_version_prereq([2.52g])
20
21 m4_define([AT_SKIP_TEST],[exit 77])
22
23 dnl ------------------------------------------------------------
24 dnl FRM_MAILBOX -- mailbox used for testing
25 m4_define([FRM_MAILBOX],[mbox1])
26
27 dnl ------------------------------------------------------------
28 dnl FRM_OPTIONS -- default options for frm
29 m4_define([FRM_OPTIONS],[--no-site --no-user])
30
31 dnl ------------------------------------------------------------
32 dnl FRMTEST(DESCR, KW, CMDLINE, [STATUS = `0'], [STDOUT = `'],
33 dnl [STDERR = `'], [RUN-IF-FAIL], [RUN-IF-PASS])
34 dnl
35 m4_define([FRMTEST],[
36 AT_SETUP([$1])
37 AT_KEYWORDS([$2])
38 AT_CHECK([
39 MAIL=$top_srcdir/testsuite/spool/FRM_MAILBOX
40 FOLDER=$MAIL
41 export MAIL FOLDER
42 frm FRM_OPTIONS $3],
43 m4_shift(m4_shift(m4_shift($@))))
44 AT_CLEANUP])
45
46 AT_INIT
47
48 AT_TESTED([frm])
49
50 m4_include([testsuite.inc])
51
52 MUT_VERSION(frm)
53
54 FRMTEST([no options],[frm00],
55 [],
56 [1],
57 [Foo Bar Jabberwocky
58 Bar Re: Jabberwocky
59 Sergey Poznyakoff Simple MIME
60 Sergey Poznyakoff Nested MIME
61 Sergey Poznyakoff Empty MIME Parts
62 ])
63
64 FRMTEST([frm -n],[frm-n frm01],
65 [-n],
66 [1],
67 [ 1: Foo Bar Jabberwocky
68 2: Bar Re: Jabberwocky
69 3: Sergey Poznyakoff Simple MIME
70 4: Sergey Poznyakoff Nested MIME
71 5: Sergey Poznyakoff Empty MIME Parts
72 ])
73
74 FRMTEST([frm -l],[frm-l frm02],
75 [-l],
76 [1],
77 [(Bar) Foo Bar Jabberwocky
78 (Foo Bar) Bar Re: Jabberwocky
79 (Foo Bar) Sergey Poznyakoff Simple MIME
80 (Foo Bar) Sergey Poznyakoff Nested MIME
81 (Foo Bar) Sergey Poznyakoff Empty MIME Parts
82 ])
83
84 FRMTEST([frm -qS],[frm-qS frm03],
85 [-qS],
86 [1],
87 [Folder contains 5 new messages.
88 ])
89
90 FRMTEST([frm -q],[frm-q frm04],
91 [-q],
92 [1],
93 [There are messages in that folder.
94 ])
95
96 FRMTEST([frm +mbox],[frm+mbox frm05],
97 [--set ":mailbox:folder=$top_srcdir/testsuite/spool" +mbox],
98 [1],
99 [Sergey Poznyakoff MBOX
100 ])
101
102 FRMTEST([nonexistent mailbox],[frm06],
103 [-q %nonexistent],
104 [2],
105 [No messages in that folder!
106 ])
107
108 m4_pushdef([FRM_MAILBOX],[bigto.mbox])
109 FRMTEST([frm -l on long headers],[frm07],
110 [-l],
111 [1],
112 [(Ayoung-Chee, Nigel Paul -- Nigel Paul Ayoung-Chee) Patrick Chan New email address, etc.
113 ])
114 m4_popdef([FRM_MAILBOX])
115
1 Makefile
2 Makefile.in
3 *.log
4 *.sum
5 site.exp
6 remote.exp
7 data
1 ## Process this file with GNU Automake to create Makefile.in
2
3 ## Copyright (C) 2002, 2007, 2010 Free Software Foundation, Inc.
4 ##
5 ## GNU Mailutils is free software; you can redistribute it and/or
6 ## modify it under the terms of the GNU General Public License as
7 ## published by the Free Software Foundation; either version 3, or (at
8 ## your option) any later version.
9 ##
10 ## This program is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program; if not, write to the Free Software
17 ## Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA
18 ## 02110-1301 USA
19
20 AUTOMAKE_OPTIONS = dejagnu
21 DEJATOOL = frm
22 RUNTESTFLAGS =
23 CLEANFILES = *.log
24 test_dirs = frm
25
26 dist-hook:
27 here=`cd $(top_builddir)/$(subdir) && pwd`; \
28 srcdir=`cd $(srcdir) && pwd`; \
29 distdir=`cd $(distdir) && pwd`; \
30 for dir in $(test_dirs); \
31 do \
32 cd $$srcdir;\
33 mkdir $$distdir/$$dir;\
34 cd $$dir;\
35 for file in DISTFILES `cat DISTFILES`; do \
36 d=$$srcdir/$$dir; \
37 if test -d $$d/$$file; then \
38 cp -pr $$d/$$file $$distdir/$$dir/$$file; \
39 else \
40 test -f $$distdir/$$dir/$$file \
41 || cp -p $$d/$$file $$distdir/$$dir/$$file || exit; \
42 fi; \
43 done;\
44 done;\
45 cd $$here
46
47 site.exp: Makefile remote.exp
48 @echo 'Making a new site.exp file...'
49 @test ! -f site.bak || rm -f site.bak
50 @echo '## these variables are automatically generated by make ##' > $@-t
51 @echo '# Do not edit here. If you wish to override these values' >> $@-t
52 @echo '# edit the last section' >> $@-t
53 @echo 'set tool $(DEJATOOL)' >> $@-t
54 @echo "set top_srcdir `cd $(top_srcdir); pwd`" >> $@-t
55 @echo "set srcdir `cd $(srcdir); pwd`" >> $@-t
56 @echo 'set objdir' `pwd` >> $@-t
57 @echo 'set host_alias "$(host_alias)"' >> $@-t
58 @echo 'set host_triplet $(host_triplet)' >> $@-t
59 @echo 'set target_alias "$(target_alias)"' >> $@-t
60 @echo 'set target_triplet $(target_triplet)' >> $@-t
61 @echo 'set build_alias "$(build_alias)"' >> $@-t
62 @echo 'set build_triplet $(build_triplet)' >> $@-t
63 @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t
64 @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t
65 @test ! -f site.exp || mv site.exp site.bak
66 @mv $@-t site.exp
67
68 remote.exp:;
69 @echo 'Making a new remote.exp file...'
70 @test ! -f remote.bak || rm -f remote.bak
71 @echo '## These variables are used to set up for the remote testing.' >> $@-t
72 @echo '## Please, read file README in this directory for instructions' >> $@-t
73 @echo '## on how to use this file' >> $@-t
74 @echo "set host_board `hostname`" >> $@-t
75 @echo 'set board_info($$host_board,connect) rlogin' >> $@-t
76 @echo 'set board_info($$host_board,shell_prompt) "\\$$ "' >> $@-t
77 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
78 @echo "set board_info(\$$host_board,srcdir) `cd $(srcdir); pwd`" >> $@-t
79 @echo "set board_info(\$$host_board,objdir) `pwd`" >> $@-t
80 @echo "set board_info(\$$host_board,top_srcdir) `cd $(top_srcdir); pwd`" >> $@-t
81 @echo "set board_info(\$$host_board,top_builddir) `cd $(top_builddir); pwd`" >> $@-t
82 @test ! -f remote.exp || mv remote.exp remote.bak
83 @mv $@-t remote.exp
84
85
86 DISTCLEANFILES=*.exp *.log *.sum
87
88 distclean-local:
89 -rm -rf data
1 test.exp
...\ No newline at end of file ...\ No newline at end of file
1 # -*- tcl -*-
2 # This file is part of Mailutils testsuite.
3 # Copyright (C) 2002, 2007, 2009, 2010 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 # 02110-1301 USA.
19
20 source $top_srcdir/testsuite/lib/mailutils.exp
21
22 mu_init -noflags
23 set env(MAIL) $MU_SPOOL_DIR/mbox1
24 set env(FOLDER) $env(MAIL)
25
26 mu_prepare_spools
27
28 mu_exec -retcode 1 -message "frm" "Foo Bar\tJabberwocky"\
29 "Bar\tRe: Jabberwocky"\
30 "Sergey Poznyakoff\tSimple MIME"\
31 "Sergey Poznyakoff\tNested MIME"\
32 "Sergey Poznyakoff\tEmpty MIME Parts"
33
34 mu_exec -retcode 1 -message "frm -n" -arg -n \
35 " 1:\tFoo Bar\tJabberwocky"\
36 " 2:\tBar\tRe: Jabberwocky"\
37 " 3:\tSergey Poznyakoff\tSimple MIME"\
38 " 4:\tSergey Poznyakoff\tNested MIME"\
39 " 5:\tSergey Poznyakoff\tEmpty MIME Parts"
40
41 mu_exec -retcode 1 -message "frm -l" -arg -l \
42 "(Bar)\tFoo Bar\tJabberwocky"\
43 "(Foo Bar)\tBar\tRe: Jabberwocky"\
44 "(Foo Bar)\tSergey Poznyakoff\tSimple MIME"\
45 "(Foo Bar)\tSergey Poznyakoff\tNested MIME"\
46 "(Foo Bar)\tSergey Poznyakoff\tEmpty MIME Parts"
47
48 mu_exec -retcode 1 -message "frm -qS" -arg -qS \
49 "Folder contains 5 new messages."
50
51 mu_exec -retcode 1 -arg -q -message "frm -q" \
52 "There are messages in that folder."
53
54 mu_exec -retcode 1 -arg "--set mailbox.folder=\"'$MU_SPOOL_DIR'\"" -arg +mbox -message "frm +mbox" \
55 "Sergey Poznyakoff\tMBOX"
56
57 mu_exec -arg -q -arg %nonexistent -retcode 2 -message "frm -q %nonexistent" \
58 "No messages in that folder!"
59
60 set env(MAIL) $MU_SPOOL_DIR/bigto.mbox
61 unset env(FOLDER)
62 mu_exec -retcode 1 -message "frm -l on long headers" -arg -l \
63 "(Ayoung-Chee, Nigel Paul -- Nigel Paul Ayoung-Chee)\tPatrick Chan\tNew email address, etc."
64
65 #end of test.exp
...@@ -68,7 +68,7 @@ M4=m4 ...@@ -68,7 +68,7 @@ M4=m4
68 68
69 AUTOTEST = $(AUTOM4TE) --language=autotest 69 AUTOTEST = $(AUTOM4TE) --language=autotest
70 $(TESTSUITE): package.m4 $(TESTSUITE_AT) 70 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
71 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) testsuite.at -o $@.tmp 71 $(AM_V_GEN)$(AUTOTEST) -I $(srcdir) -I $(top_srcdir)/testsuite testsuite.at -o $@.tmp
72 $(AM_V_at)mv $@.tmp $@ 72 $(AM_V_at)mv $@.tmp $@
73 73
74 atconfig: $(top_builddir)/config.status 74 atconfig: $(top_builddir)/config.status
......
...@@ -15,20 +15,6 @@ ...@@ -15,20 +15,6 @@
15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>. 15 # along with GNU Mailutils. If not, see <http://www.gnu.org/licenses/>.
16 # This file is part of Mailfromd testsuite. 16 # This file is part of Mailfromd testsuite.
17 17
18 AT_SETUP([sieve version]) 18 m4_include([testsuite.inc])
19 19
20 AT_CHECK([sieve --version | sed '1{s/ *[\[.*\]]//;q}' ], 20 MUT_VERSION(frm)
21 [0],
22 [sieve (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
23 ],
24 [],
25 [cat >$[]XFAILFILE <<'_EOT'
26
27 ==============================================================
28 WARNING: Not using the proper version, *all* checks dubious...
29 ==============================================================
30 _EOT
31 ],
32 [rm -f $[]XFAILFILE])
33
34 AT_CLEANUP
......
1 # This file is part of GNU Mailutils. -*- Autotest -*-
2 # Copyright (C) 2007, 2008, 2009, 2010 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 # This program 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 # This file is part of Mailfromd testsuite.
17
18 dnl ------------------------------------------------------------
19 dnl MUT_VERSION(TOOL) -- checks the version output from TOOL
20 dnl
21 m4_define([MUT_VERSION],[
22 AT_SETUP([$1 version])
23
24 AT_CHECK([$1 --version | sed '1{s/ *[\[.*\]]//;q}' ],
25 [0],
26 [$1 (AT_PACKAGE_NAME) AT_PACKAGE_VERSION
27 ],
28 [],
29 [cat >$[]XFAILFILE <<'_EOT'
30
31 ==============================================================
32 WARNING: Not using the proper version, *all* checks dubious...
33 ==============================================================
34 _EOT
35 ],
36 [rm -f $[]XFAILFILE])
37
38 AT_CLEANUP
39 ])
...\ No newline at end of file ...\ No newline at end of file