Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
mailutils
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
dbaa8d04
...
dbaa8d04d78c77c8ee07765e8f30a2ac74a86e2e
authored
2002-11-18 17:11:12 +0000
by
Sergey Poznyakoff
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
(sieve_test): Pass --email and --mailer options to sieve.
(sieve_driver_test): New procedure.
1 parent
6e4589c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
1 deletions
sieve/testsuite/lib/sieve.exp
sieve/testsuite/lib/sieve.exp
View file @
dbaa8d0
...
...
@@ -27,9 +27,11 @@ set env(MAIL) $MU_SPOOL_DIR/sieve.mbox
# [ARGS...
]
[
-pattern PATTERN...
]
proc
sieve_test
{
args
}
{
global sieve_source_dir
global top_builddir
set default
""
set sw
[
list
"-M none"
]
set sw
[
list
"-M sendmail:
$top
_builddir/examples/mta"
\
"--email foobar@nonexistent.net"
]
set reuse_spool 0
for
{
set
i 0
}
{
$i
<
[
llength
$args
]}
{
incr
i
}
{
set a
[
lindex
$args
$i
]
...
...
@@ -76,3 +78,53 @@ proc sieve_test {args} {
#FIXME: examine the output mailbox
}
proc
sieve_driver_test
{
name mailer diag
}
{
global srcdir
set chan
[
open
"
${srcdir}
/
$name
"
r
]
set state 0
set command
""
for
{
gets
$chan
line
}
{
!
[
eof
$chan
]}
{
gets
$chan
line
}
{
verbose
"LINE
$line
"
1
switch -regexp --
"
$line
"
{
"^#.*"
{
}
"^TEST END"
{
verbose
"ARGS
$args
"
1
verbose
"PATTERN
$pattern
"
1
verbose
"OUTPUT
$output
"
1
eval sieve_test
$args
-pattern
$pattern
eval mu_test_file
"
$diag
"
$output
set state 0
}
"^TEST"
{
regexp
"^TEST (.*)"
$line
dummy args
set pattern
[
list
]
set output
[
list
]
set state 1
}
"^PATTERN BEGIN"
{
set state 2
}
"^PATTERN END"
{
set state 1
}
"^FILE BEGIN"
{
set state 3
}
"^FILE END"
{
set state 1
}
"^STOP"
{
break
}
default
{
if
{
$state
== 2
}
{
lappend pattern
$line
}
else
if
{
$state
== 3
}
{
lappend output
$line
}
}
}
}
close
$chan
}
...
...
Please
register
or
sign in
to post a comment