]> git.donarmstrong.com Git - debbugs.git/blobdiff - t/08_pkgreport.t
abstract out create config in tests
[debbugs.git] / t / 08_pkgreport.t
index f834c759284bce5650f135a7a60e75a3372c48d5..97f331fbc168abfd028ce58a9b75963040a4ac36 100644 (file)
@@ -25,21 +25,12 @@ use DebbugsTest qw(:all);
 
 my %config;
 eval {
-     %config = create_debbugs_configuration(debug => exists $ENV{DEBUG}?$ENV{DEBUG}:0);
+     %config = create_debbugs_configuration();
 };
 if ($@) {
      BAIL_OUT($@);
 }
 
-# Output some debugging information if there's an error
-END{
-     if ($ENV{DEBUG}) {
-         foreach my $key (keys %config) {
-              diag("$key: $config{$key}\n");
-         }
-     }
-}
-
 # create a bug
 send_message(to=>'submit@bugs.something',
             headers => [To   => 'submit@bugs.something',
@@ -60,7 +51,8 @@ EOF
 my $pkgreport_cgi_handler = sub {
      # I do not understand why this is necessary.
      $ENV{DEBBUGS_CONFIG_FILE} = "$config{config_dir}/debbugs_config";
-     my $content = qx(perl -I. -I./cgi -T cgi/pkgreport.cgi);
+     # We cd here because pkgreport uses require ./common.pl
+     my $content = qx(cd cgi; perl -I.. -T pkgreport.cgi);
      # Strip off the Content-Type: stuff
      $content =~ s/^\s*Content-Type:[^\n]+\n*//si;
      print $content;