]> git.donarmstrong.com Git - debbugs.git/blobdiff - t/lib/DebbugsTest.pm
support attachments in test scripts
[debbugs.git] / t / lib / DebbugsTest.pm
index f203668c7c1af29385c9c6a7e51bfffa0a57d0ca..253f1d7acbe61f9d5dedae7cd549299f5560dcf0 100644 (file)
@@ -88,10 +88,12 @@ END
                            "$spool_dir/nextnumber" => qq(1\n),
                            "$config_dir/Maintainers" => qq(foo Blah Bleargh <foo\@baz.com>\nbar Bar Bleargh <bar\@baz.com>\n),
                            "$config_dir/Maintainers.override" => qq(),
+                           "$config_dir/Source_maintainers" => qq(foo Blah Bleargh <foo\@baz.com>\nbar Bar Bleargh <bar\@baz.com>\n),
                            "$config_dir/indices/sources" => <<END,
 foo main foo
 END
                            "$config_dir/pseudo-packages.description" => '',
+                           "$config_dir/pseudo-packages.maintainers" => '',
                           );
      while (my ($file,$contents) = each %files_to_create) {
          system('mkdir','-p',dirname($file));
@@ -143,6 +145,9 @@ sub send_message{
                                                     },
                                          body    => {type => SCALAR,
                                                     },
+                                         attachments => {type => ARRAYREF,
+                                                         default => [],
+                                                        },
                                          run_processall =>{type => BOOLEAN,
                                                            default => 1,
                                                           },
@@ -156,7 +161,9 @@ sub send_message{
      my $pid = open3($wfd,$rfd,$rfd,'scripts/receive')
          or die "Unable to start receive: $!";
      print {$wfd} create_mime_message($param{headers},
-                                        $param{body}) or die "Unable to to print to receive";
+                                     $param{body},
+                                     $param{attachments}) or
+                                         die "Unable to to print to receive";
      close($wfd) or die "Unable to close receive";
      my $err = $? >> 8;
      my $childpid = waitpid($pid,0);