summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2020-08-19 05:49:15 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2020-08-19 05:49:15 (GMT)
commitcd3a5a6d98e23e20e5fad3b5da108c4a11a9032d (patch) (side-by-side diff)
tree14983118500051ea440b232db692ae8f5bb4de73
parentd2eb03a3b9db683418cc0bd084915468e4968854 (diff)
downloadmailutils-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.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libmailutils/tests/Makefile.am11
-rw-r--r--libmailutils/tests/getdelim.at12
-rw-r--r--libmailutils/tests/modmesg.at71
-rw-r--r--libmailutils/tests/modmesg00.at29
-rw-r--r--libmailutils/tests/modmesg01.at31
-rw-r--r--libmailutils/tests/modmesg02.at38
-rw-r--r--libmailutils/tests/modmesg03.at31
-rw-r--r--libmailutils/tests/streams.at (renamed from libmailutils/tests/streamshift.at)34
-rw-r--r--libmailutils/tests/strin.at11
-rw-r--r--libmailutils/tests/strtoc.at19
-rw-r--r--libmailutils/tests/t0-stream.at20
-rw-r--r--libmailutils/tests/t1-stream.at20
-rw-r--r--libmailutils/tests/testsuite.at18
-rw-r--r--testsuite/testsuite.inc2
14 files changed, 107 insertions, 240 deletions
diff --git a/libmailutils/tests/Makefile.am b/libmailutils/tests/Makefile.am
index b29e24c..e5065f7 100644
--- a/libmailutils/tests/Makefile.am
+++ b/libmailutils/tests/Makefile.am
@@ -110,7 +110,6 @@ TESTSUITE_AT += \
fsfolder02.at\
fsfolder03.at\
fsfolder04.at\
- getdelim.at\
hdrcpy.at\
hdrflt.at\
htmlent.at\
@@ -123,10 +122,7 @@ TESTSUITE_AT += \
logstr.at\
mailcap.at\
mimehdr.at\
- modmesg00.at\
- modmesg01.at\
- modmesg02.at\
- modmesg03.at\
+ modmesg.at\
modtofsaf.at\
msgset.at\
parseopt00.at\
@@ -176,13 +172,10 @@ TESTSUITE_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\
diff --git a/libmailutils/tests/getdelim.at b/libmailutils/tests/getdelim.at
deleted file mode 100644
index 493412e..0000000
--- a/libmailutils/tests/getdelim.at
+++ b/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/modmesg.at b/libmailutils/tests/modmesg.at
new file mode 100644
index 0000000..f868205
--- a/dev/null
+++ b/libmailutils/tests/modmesg.at
@@ -0,0 +1,71 @@
+# 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/>.
+
+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
+])
+
+MU_CHECK([modify body],
+ [modmesg02],
+ [modmesg -t "word\n"],
+ [0],
+[From: root
+
+This is a test message.
+oo
+word
+])
+
+MU_CHECK([modify body 2],
+ [modmesg03],
+ [modmesg -l 0 -t "That"],
+ [0],
+[From: root
+
+That is a test message.
+oo
+])
+
+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 60758e5..0000000
--- a/libmailutils/tests/modmesg00.at
+++ b/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 3b93bf9..0000000
--- a/libmailutils/tests/modmesg01.at
+++ b/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/modmesg02.at b/libmailutils/tests/modmesg02.at
deleted file mode 100644
index a4813fa..0000000
--- a/libmailutils/tests/modmesg02.at
+++ b/dev/null
@@ -1,38 +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 body])
-AT_KEYWORDS([modmesg02])
-
-AT_CHECK([modmesg -t "word\n"],
-[0],
-[From: root
-
-This is a test message.
-oo
-word
-])
-
-AT_CHECK([modmesg -l 0 -t "That"],
-[0],
-[From: root
-
-That is a test message.
-oo
-])
-
-AT_CLEANUP
-
diff --git a/libmailutils/tests/modmesg03.at b/libmailutils/tests/modmesg03.at
deleted file mode 100644
index cf63714..0000000
--- a/libmailutils/tests/modmesg03.at
+++ b/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 9977f65..37bbb58 100644
--- a/libmailutils/tests/streamshift.at
+++ b/libmailutils/tests/streams.at
@@ -14,14 +14,30 @@
# 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 152be00..a94ac47 100644
--- a/libmailutils/tests/strin.at
+++ b/libmailutils/tests/strin.at
@@ -17,20 +17,15 @@
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 02e256f..0000000
--- a/libmailutils/tests/strtoc.at
+++ b/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 1a991dc..0000000
--- a/libmailutils/tests/t0-stream.at
+++ b/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 a930921..0000000
--- a/libmailutils/tests/t1-stream.at
+++ b/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 d1c6bf3..6888f39 100644
--- a/libmailutils/tests/testsuite.at
+++ b/libmailutils/tests/testsuite.at
@@ -99,16 +99,10 @@ 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])
@@ -185,7 +179,8 @@ 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])
@@ -244,10 +239,7 @@ 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])
diff --git a/testsuite/testsuite.inc b/testsuite/testsuite.inc
index 956c894..0e4bdb8 100644
--- a/testsuite/testsuite.inc
+++ b/testsuite/testsuite.inc
@@ -27,7 +27,7 @@ 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
])

Return to:

Send suggestions and report system problems to the System administrator.