(sieve_test): Pass --verbose switch to sieve. Added -retcode option.
Showing
1 changed file
with
11 additions
and
5 deletions
... | @@ -30,17 +30,19 @@ proc sieve_test {args} { | ... | @@ -30,17 +30,19 @@ proc sieve_test {args} { |
30 | global top_builddir | 30 | global top_builddir |
31 | 31 | ||
32 | set default "" | 32 | set default "" |
33 | set sw [list "-M sendmail:$top_builddir/examples/mta" \ | 33 | set sw [list "--verbose" \ |
34 | "-M sendmail:$top_builddir/examples/mta" \ | ||
34 | "--email foobar@nonexistent.net"] | 35 | "--email foobar@nonexistent.net"] |
35 | set reuse_spool 0 | 36 | set reuse_spool 0 |
37 | set retcode 0 | ||
36 | for {set i 0} {$i < [llength $args]} {incr i} { | 38 | for {set i 0} {$i < [llength $args]} {incr i} { |
37 | set a [lindex $args $i] | 39 | set a [lindex $args $i] |
38 | if {"$a" == "-default"} { | 40 | if {"$a" == "-default"} { |
39 | set default [lindex $args [expr $i + 1]] | ||
40 | incr i | 41 | incr i |
42 | set default [lindex $args $i] | ||
41 | } elseif {"$a" == "-message"} { | 43 | } elseif {"$a" == "-message"} { |
42 | set message [lindex $args [expr $i + 1]] | ||
43 | incr i | 44 | incr i |
45 | set message [lindex $args $i] | ||
44 | } elseif {"$a" == "-pattern"} { | 46 | } elseif {"$a" == "-pattern"} { |
45 | incr i | 47 | incr i |
46 | set pattern [lrange $args $i end] | 48 | set pattern [lrange $args $i end] |
... | @@ -48,6 +50,9 @@ proc sieve_test {args} { | ... | @@ -48,6 +50,9 @@ proc sieve_test {args} { |
48 | } elseif {"$a" == "-reuse-spool"} { | 50 | } elseif {"$a" == "-reuse-spool"} { |
49 | set reuse_spool 1 | 51 | set reuse_spool 1 |
50 | break | 52 | break |
53 | } elseif {"$a" == "-retcode"} { | ||
54 | incr i | ||
55 | set retcode [lindex $args $i] | ||
51 | } else { | 56 | } else { |
52 | set sw [concat $sw [lindex $args $i]] | 57 | set sw [concat $sw [lindex $args $i]] |
53 | } | 58 | } |
... | @@ -71,9 +76,10 @@ proc sieve_test {args} { | ... | @@ -71,9 +76,10 @@ proc sieve_test {args} { |
71 | 76 | ||
72 | if [info exists pattern] { | 77 | if [info exists pattern] { |
73 | mu_exec -default $default -message $message -arg-list $sw \ | 78 | mu_exec -default $default -message $message -arg-list $sw \ |
74 | -pattern $pattern | 79 | -pattern $pattern -retcode $retcode |
75 | } else { | 80 | } else { |
76 | mu_exec -default $default -message $message -arg-list $sw | 81 | mu_exec -default $default -message $message -arg-list $sw \ |
82 | -retcode $retcode | ||
77 | } | 83 | } |
78 | #FIXME: examine the output mailbox | 84 | #FIXME: examine the output mailbox |
79 | } | 85 | } | ... | ... |
-
Please register or sign in to post a comment