aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-08-10 10:02:58 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-08-10 10:02:58 +0000
commitf1e49e11293fd417f83b36901bc319e0d7bd390d (patch)
tree74165d3e0ccbe55343eed00d11ba7b726a653424 /tests
parent52140b22af73ac5ae4c6bbbb40217a609614e03f (diff)
downloadmailfromd-f1e49e11293fd417f83b36901bc319e0d7bd390d.tar.gz
mailfromd-f1e49e11293fd417f83b36901bc319e0d7bd390d.tar.bz2
* src/gram.y (on_cond): Fix coredump if target address is not
specified. (vardecl): Signal error if an auto variable is doubly defined. * tests/testsuite.at (EX_OK--EX_CONFIG): New defines (MF_CHECK_TEXT): New macro Add poll04.at and ashadow.at * tests/ashadow.at, tests/poll04.at: New files * doc/mailfromd.texi: Minor fixes git-svn-id: file:///svnroot/mailfromd/trunk@1499 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/ashadow.at33
-rw-r--r--tests/poll04.at40
-rw-r--r--tests/testsuite.at31
4 files changed, 106 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e5221d9e..9976c0c9 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -43,6 +43,7 @@ TESTSUITE_AT = \
accept.at\
ack.at\
arg.at\
+ ashadow.at\
bctx00.at\
bctx01.at\
catch.at\
@@ -75,6 +76,7 @@ TESTSUITE_AT = \
poll01.at\
poll02.at\
poll03.at\
+ poll04.at\
prec.at\
reject.at\
relayed01.at\
diff --git a/tests/ashadow.at b/tests/ashadow.at
new file mode 100644
index 00000000..4027dcf8
--- /dev/null
+++ b/tests/ashadow.at
@@ -0,0 +1,33 @@
+# This file is part of Mailfromd testsuite. -*- Autotest -*-
+# Copyright (C) 2007 Sergey Poznyakoff
+#
+# 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, 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, see <http://www.gnu.org/licenses/>.
+
+AT_SETUP([variable shadowing])
+AT_KEYWORDS([variable variables shadow auto ashadow])
+
+MF_CHECK_TEXT([
+func foo() returns number
+do
+ number i 2
+ number i 2
+done],
+[],
+[EX_CONFIG],
+[],
+[mailfromd: prog:6: Duplicate variable: i
+])
+
+AT_CLEANUP
+
diff --git a/tests/poll04.at b/tests/poll04.at
new file mode 100644
index 00000000..c9cefa46
--- /dev/null
+++ b/tests/poll04.at
@@ -0,0 +1,40 @@
+# This file is part of Mailfromd testsuite. -*- Autotest -*-
+# Copyright (C) 2007 Sergey Poznyakoff
+#
+# 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, 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, see <http://www.gnu.org/licenses/>.
+
+AT_SETUP([on poll without address])
+AT_KEYWORDS([poll poll04])
+
+# Synopsis: `on poll' without target address caused coredump in
+# version 4.1
+# Reported: Jan Rafaj, 2007-08-10
+# References: <Pine.LNX.4.58.0708101024210.11880@cedric.unob.cz>
+
+MF_CHECK_TEXT([
+prog envfrom
+do
+ on poll host "HOST"
+ do
+ when 0: pass
+ done
+done],
+[],
+[EX_CONFIG],
+[],
+[mailfromd: prog:7: recipient address not specified in `on poll' construct
+])
+
+AT_CLEANUP
+
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 6329e6aa..13174ca2 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -17,11 +17,40 @@
# We need a recent Autotest.
m4_version_prereq([2.52g])
+dnl # Standard exit codes (from src/mailfromd.h)
+m4_define([EX_OK], 0) dnl successful termination
+m4_define([EX__BASE], 64) dnl base value for error messages
+m4_define([EX_USAGE], 64) dnl command line usage error
+m4_define([EX_DATAERR], 65) dnl data format error
+m4_define([EX_NOINPUT], 66) dnl cannot open input
+m4_define([EX_NOUSER], 67) dnl addressee unknown
+m4_define([EX_NOHOST], 68) dnl host name unknown
+m4_define([EX_UNAVAILABLE], 69) dnl service unavailable
+m4_define([EX_SOFTWARE], 70) dnl internal software error
+m4_define([EX_OSERR], 71) dnl system error (e.g., can't fork)
+m4_define([EX_OSFILE], 72) dnl critical OS file missing
+m4_define([EX_CANTCREAT], 73) dnl can't create (user) output file
+m4_define([EX_IOERR], 74) dnl input/output error
+m4_define([EX_TEMPFAIL], 75) dnl temp failure; user is invited to retry
+m4_define([EX_PROTOCOL], 76) dnl remote error in protocol
+m4_define([EX_NOPERM], 77) dnl permission denied
+m4_define([EX_CONFIG], 78) dnl configuration error
+
+
m4_define([AT_SKIP_TEST],[exit 77])
m4_define([AT_REQUIRE_DNS],
[host puszcza.gnu.org.ua || AT_SKIP_TEST])
+dnl MF_CHECK_TEXT(TEXT,[ARGS],
+ [STATUS],[STDOUT],[STDERR],[RUN-IF-FAIL], [RUN-IF-PASS])
+m4_define([MF_CHECK_TEXT],[
+dnl Save the program
+AT_DATA([prog],[$1
+])
+AT_CHECK([mailfromd $MFOPTS --test prog $2],m4_shift(m4_shift($@)))
+])
+
m4_define([AT_MTA_TEST_X],[
AT_DATA([script],$1)
AT_CHECK([mtasim $MTAOPTS < script > /dev/null],
@@ -85,6 +114,7 @@ m4_include([poll.at])
m4_include([poll01.at])
m4_include([poll02.at])
m4_include([poll03.at])
+m4_include([poll04.at])
m4_include([prec.at])
@@ -96,6 +126,7 @@ m4_include([relayed01.at])
m4_include([relayed02.at])
m4_include([shadow.at])
+m4_include([ashadow.at])
m4_include([strings.at])
m4_include([switchn1.at])

Return to:

Send suggestions and report system problems to the System administrator.