diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-08-19 08:49:15 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-08-19 08:49:15 +0300 |
commit | cd3a5a6d98e23e20e5fad3b5da108c4a11a9032d (patch) | |
tree | 14983118500051ea440b232db692ae8f5bb4de73 | |
parent | d2eb03a3b9db683418cc0bd084915468e4968854 (diff) | |
download | mailutils-cd3a5a6d98e23e20e5fad3b5da108c4a11a9032d.tar.gz mailutils-cd3a5a6d98e23e20e5fad3b5da108c4a11a9032d.tar.bz2 |
libmailutils/tests: Use MU_CHECK for simple tests
* testsuite/testsuite.inc (MU_CHECK): Remove superfluous quoting.
* libmailutils/tests/modmesg.at: New file.
* libmailutils/tests/streams.at: New file.
* libmailutils/tests/strin.at: Minor change.
* libmailutils/tests/modmesg02.at: Remove.
* libmailutils/tests/streamshift.at: Remove.
* libmailutils/tests/strtoc.at: Remove.
* libmailutils/tests/t0-stream.at: Remove.
* libmailutils/tests/t1-stream.at: Remove.
* libmailutils/tests/getdelim.at: Remove.
* libmailutils/tests/modmesg00.at: Remove.
* libmailutils/tests/modmesg01.at: Remove.
* libmailutils/tests/modmesg03.at: Remove.
* libmailutils/tests/testsuite.at: Update.
* libmailutils/tests/Makefile.am: Update.
-rw-r--r-- | libmailutils/tests/Makefile.am | 11 | ||||
-rw-r--r-- | libmailutils/tests/getdelim.at | 12 | ||||
-rw-r--r-- | libmailutils/tests/modmesg.at (renamed from libmailutils/tests/modmesg02.at) | 47 | ||||
-rw-r--r-- | libmailutils/tests/modmesg00.at | 29 | ||||
-rw-r--r-- | libmailutils/tests/modmesg01.at | 31 | ||||
-rw-r--r-- | libmailutils/tests/modmesg03.at | 31 | ||||
-rw-r--r-- | libmailutils/tests/streams.at (renamed from libmailutils/tests/streamshift.at) | 34 | ||||
-rw-r--r-- | libmailutils/tests/strin.at | 11 | ||||
-rw-r--r-- | libmailutils/tests/strtoc.at | 19 | ||||
-rw-r--r-- | libmailutils/tests/t0-stream.at | 20 | ||||
-rw-r--r-- | libmailutils/tests/t1-stream.at | 20 | ||||
-rw-r--r-- | libmailutils/tests/testsuite.at | 18 | ||||
-rw-r--r-- | testsuite/testsuite.inc | 2 |
13 files changed, 76 insertions, 209 deletions
diff --git a/libmailutils/tests/Makefile.am b/libmailutils/tests/Makefile.am index b29e24cd7..e5065f73c 100644 --- a/libmailutils/tests/Makefile.am +++ b/libmailutils/tests/Makefile.am @@ -107,29 +107,25 @@ TESTSUITE_AT += \ fsaftomod.at\ fsfolder00.at\ fsfolder01.at\ fsfolder02.at\ fsfolder03.at\ fsfolder04.at\ - getdelim.at\ hdrcpy.at\ hdrflt.at\ htmlent.at\ globtest.at\ imapio.at\ inline-comment.at\ linecon.at\ list.at\ linetrack.at\ logstr.at\ mailcap.at\ mimehdr.at\ - modmesg00.at\ - modmesg01.at\ - modmesg02.at\ - modmesg03.at\ + modmesg.at\ modtofsaf.at\ msgset.at\ parseopt00.at\ parseopt01.at\ parseopt02.at\ parseopt03.at\ @@ -173,19 +169,16 @@ TESTSUITE_AT += \ parseopt_help12.at\ prop.at\ readmesg.at\ recenv.at\ scantime.at\ strftime.at\ - streamshift.at\ + streams.at\ strerr.at\ strin.at\ strout.at\ - strtoc.at\ - t0-stream.at\ - t1-stream.at\ url.at\ url-comp.at\ xml.at\ wicket.at\ wordwrap00.at\ wordwrap01.at\ diff --git a/libmailutils/tests/getdelim.at b/libmailutils/tests/getdelim.at deleted file mode 100644 index 493412e64..000000000 --- a/libmailutils/tests/getdelim.at +++ /dev/null @@ -1,12 +0,0 @@ -AT_SETUP([getdelim]) -AT_CHECK([stream-getdelim], -[0], -[0: No buffering -1: Linear buffering -2: Linear buffering (small buffer) -3: Full buffering (big buffer) -4: Full buffering (moderate buffer) -5: Full buffering (small buffer) -]) -AT_CLEANUP - diff --git a/libmailutils/tests/modmesg02.at b/libmailutils/tests/modmesg.at index a4813fa11..f868205b9 100644 --- a/libmailutils/tests/modmesg02.at +++ b/libmailutils/tests/modmesg.at @@ -11,28 +11,61 @@ # 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([modify body]) -AT_KEYWORDS([modmesg02]) +MU_CHECK([unmodified message], + [modmesg00], + [modmesg], + [0], +[From: root + +This is a test message. +oo +]) + +MU_CHECK([add headers], + [modmesg01], + [modmesg -a To:gray@localhost -a Subject:test], + [0], +[From: root +To: gray@localhost +Subject: test + +This is a test message. +oo +]) -AT_CHECK([modmesg -t "word\n"], -[0], +MU_CHECK([modify body], + [modmesg02], + [modmesg -t "word\n"], + [0], [From: root This is a test message. oo word ]) -AT_CHECK([modmesg -l 0 -t "That"], -[0], +MU_CHECK([modify body 2], + [modmesg03], + [modmesg -l 0 -t "That"], + [0], [From: root That is a test message. oo ]) -AT_CLEANUP +MU_CHECK([modify headers and body], + [modmesg03], + [modmesg -a To:gray@localhost -a Subject:test -l 0 -t "That"], + [0], +[From: root +To: gray@localhost +Subject: test + +That is a test message. +oo +]) diff --git a/libmailutils/tests/modmesg00.at b/libmailutils/tests/modmesg00.at deleted file mode 100644 index 60758e5ad..000000000 --- a/libmailutils/tests/modmesg00.at +++ /dev/null @@ -1,29 +0,0 @@ -# This file is part of GNU Mailutils. -*- Autotest -*- -# Copyright (C) 2011-2020 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([unmodified message]) -AT_KEYWORDS([modmesg00]) - -AT_CHECK([modmesg], -[0], -[From: root - -This is a test message. -oo -]) - -AT_CLEANUP - diff --git a/libmailutils/tests/modmesg01.at b/libmailutils/tests/modmesg01.at deleted file mode 100644 index 3b93bf947..000000000 --- a/libmailutils/tests/modmesg01.at +++ /dev/null @@ -1,31 +0,0 @@ -# This file is part of GNU Mailutils. -*- Autotest -*- -# Copyright (C) 2011-2020 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([add headers]) -AT_KEYWORDS([modmesg01]) - -AT_CHECK([modmesg -a To:gray@localhost -a Subject:test], -[0], -[From: root -To: gray@localhost -Subject: test - -This is a test message. -oo -]) - -AT_CLEANUP - diff --git a/libmailutils/tests/modmesg03.at b/libmailutils/tests/modmesg03.at deleted file mode 100644 index cf637147f..000000000 --- a/libmailutils/tests/modmesg03.at +++ /dev/null @@ -1,31 +0,0 @@ -# This file is part of GNU Mailutils. -*- Autotest -*- -# Copyright (C) 2011-2020 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([modify headers and body]) -AT_KEYWORDS([modmesg02]) - -AT_CHECK([modmesg -a To:gray@localhost -a Subject:test -l 0 -t "That"], -[0], -[From: root -To: gray@localhost -Subject: test - -That is a test message. -oo -]) - -AT_CLEANUP - diff --git a/libmailutils/tests/streamshift.at b/libmailutils/tests/streams.at index 9977f6554..37bbb58b5 100644 --- a/libmailutils/tests/streamshift.at +++ b/libmailutils/tests/streams.at @@ -11,17 +11,33 @@ # 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([temporary stream shift up]) -AT_CHECK([ -t-streamshift 10 2050 -]) -AT_CLEANUP +MU_CHECK([intermixed rw: full buffering], + [stream], + [t0-stream]) + +MU_CHECK([intermixed rw: line buffering], + [stream], + [t1-stream]) + +MU_CHECK([temporary stream shift up], + [stream], + [t-streamshift 10 2050]) + +MU_CHECK([temporary stream shift down], + [stream], + [t-streamshift 2050 10]) -AT_SETUP([temporary stream shift down]) -AT_CHECK([ -t-streamshift 2050 10 +MU_CHECK([getdelim], + [stream], + [stream-getdelim], + [0], +[0: No buffering +1: Linear buffering +2: Linear buffering (small buffer) +3: Full buffering (big buffer) +4: Full buffering (moderate buffer) +5: Full buffering (small buffer) ]) -AT_CLEANUP
\ No newline at end of file diff --git a/libmailutils/tests/strin.at b/libmailutils/tests/strin.at index 152be009f..a94ac477b 100644 --- a/libmailutils/tests/strin.at +++ b/libmailutils/tests/strin.at @@ -14,24 +14,19 @@ # 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([strin]) AT_KEYWORDS([stdstream]) -AT_DATA([input], +AT_DATA([expout], [Omnis enim res, quae dando non deficit, dum habetur et non datur, nondum habetur, quomodo habenda est. ]) -AT_CHECK([ -strin < input -], +AT_CHECK([strin < expout], [0], -[Omnis enim res, quae dando non deficit, -dum habetur et non datur, nondum habetur, -quomodo habenda est. -]) +[expout]) AT_CLEANUP diff --git a/libmailutils/tests/strtoc.at b/libmailutils/tests/strtoc.at deleted file mode 100644 index 02e256ffa..000000000 --- a/libmailutils/tests/strtoc.at +++ /dev/null @@ -1,19 +0,0 @@ -# This file is part of GNU Mailutils. -*- Autotest -*- -# Copyright (C) 2016-2020 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([mu_str_to_c]) -AT_CHECK([strtoc]) -AT_CLEANUP diff --git a/libmailutils/tests/t0-stream.at b/libmailutils/tests/t0-stream.at deleted file mode 100644 index 1a991dc66..000000000 --- a/libmailutils/tests/t0-stream.at +++ /dev/null @@ -1,20 +0,0 @@ -# This file is part of GNU Mailutils. -*- Autotest -*- -# Copyright (C) 2020 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([intermixed rw: full buffering]) -AT_KEYWORDS([stream]) -AT_CHECK([t0-stream]) -AT_CLEANUP
\ No newline at end of file diff --git a/libmailutils/tests/t1-stream.at b/libmailutils/tests/t1-stream.at deleted file mode 100644 index a930921e1..000000000 --- a/libmailutils/tests/t1-stream.at +++ /dev/null @@ -1,20 +0,0 @@ -# This file is part of GNU Mailutils. -*- Autotest -*- -# Copyright (C) 2020 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([intermixed rw: line buffering]) -AT_KEYWORDS([stream]) -AT_CHECK([t1-stream]) -AT_CLEANUP diff --git a/libmailutils/tests/testsuite.at b/libmailutils/tests/testsuite.at index d1c6bf358..6888f39e6 100644 --- a/libmailutils/tests/testsuite.at +++ b/libmailutils/tests/testsuite.at @@ -96,22 +96,16 @@ MU_FILTER_TEST_NIBBLE([$1],[$2],[$3],[write],[$4],[$5],[$6],[$7]) ]) #### AT_INIT AT_BANNER([Basic streams]) -m4_include([t0-stream.at]) -m4_include([t1-stream.at]) -m4_include([streamshift.at]) -m4_include([getdelim.at]) - -AT_BANNER([Stream implementations]) -MU_CHECK([temp_stream],[stream],[temp_stream]) +m4_include([streams.at]) AT_BANNER([Conversions]) -m4_include([strtoc.at]) +MU_CHECK([mu_str_to_c],[conv],[strtoc]) AT_BANNER([Word wrapper]) m4_include([wordwrap00.at]) m4_include([wordwrap01.at]) m4_include([wordwrap02.at]) m4_include([wordwrap03.at]) @@ -182,13 +176,14 @@ m4_include([parseopt_help12.at]) AT_BANNER([Standard streams]) m4_include([strin.at]) m4_include([strout.at]) m4_include([strerr.at]) -AT_BANNER([Streams]) +AT_BANNER([Stream implementations]) +MU_CHECK([temp_stream],[stream],[temp_stream]) m4_include([logstr.at]) m4_include([xscript.at]) m4_include([list.at]) m4_include([address.at]) @@ -241,16 +236,13 @@ m4_include([debugspec.at]) AT_BANNER([IMAP IO]) m4_include([imapio.at]) m4_include([readmesg.at]) AT_BANNER(Message modification) -m4_include([modmesg00.at]) -m4_include([modmesg01.at]) -m4_include([modmesg02.at]) -m4_include([modmesg03.at]) +m4_include([modmesg.at]) m4_include([scantime.at]) m4_include([strftime.at]) m4_include([fsaf.at]) m4_include([fsaftomod.at]) diff --git a/testsuite/testsuite.inc b/testsuite/testsuite.inc index 956c894c3..0e4bdb844 100644 --- a/testsuite/testsuite.inc +++ b/testsuite/testsuite.inc @@ -24,13 +24,13 @@ dnl ------------------------------------------------------------ dnl MU_CHECK(NAME, [KW], COMMAND, [STATUS = `0'], dnl [STDOUT], [STDERR], dnl [RUN-IF-FAIL], [RUN-IF-PASS]) dnl ------------------------------------------------------------ m4_define([MU_CHECK],[AT_SETUP([$1]) AT_KEYWORDS([$2]) -AT_CHECK([m4_shift2($@)]) +AT_CHECK(m4_shift2($@)) AT_CLEANUP ]) dnl ------------------------------------------------------------ dnl MUT_DEFAULT_OPTIONS -- produce default command line options dnl ------------------------------------------------------------ |