Show
Ignore:
Timestamp:
11/20/10 15:00:47 (3 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1290265247 +0000
git-parent:

[49fa660523f5c717d0d82e2d286a989afe83c9c3]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1290265247 +0000
Message:

cleaner error detection

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • test/t/002_db_load.t

    r5715632 r38385c3  
    1 use Test::More tests => 5
     1use Test::More tests => 6
    22use testconfig; 
     3use IPC::Open3; 
     4use IO::File; 
    35 
    46use strict; 
     
    810$conn = pg('reconnoiter','reconnoiter'); 
    911SKIP: { 
    10   skip 'already created user and db', 1 if($conn); 
    11   `psql -h localhost -p $NOIT_TEST_DB_PORT postgres -f ../../sql/reconnoiter_ddl_dump.sql`; 
     12  skip 'already created user and db', 2 if($conn); 
     13  my $cmd = "psql -h localhost -p $NOIT_TEST_DB_PORT postgres " . 
     14                "-f ../../sql/reconnoiter_ddl_dump.sql"; 
     15  my $rdr = IO::File->new(">logs/002_psql.out"); 
     16  my $wtr; 
     17  my $pid = open3($wtr, ">&".$rdr->fileno, \*CHLD_ERR, $cmd); 
     18  $wtr->close(); 
     19  my $bad = ''; 
     20  while(<CHLD_ERR>) { 
     21    $bad .= $_ unless /\b(NOTICE|INFO)\b/; 
     22  } 
     23  close(CHLD_ERR); 
     24  waitpid($pid, 0); 
     25  is($bad, '', 'no errors during schema load'); 
    1226  is($?, 0, 'loaded schema'); 
    1327} 
  • test/t/testconfig.pm

    r49b8645 r38385c3  
    5151  my $user = shift || $ENV{USER}; 
    5252  return DBI->connect( 
    53     "dbi:Pg:host=localhost;port=$NOIT_TEST_DB_PORT;database=$db", $user, '' 
     53    "dbi:Pg:host=localhost;port=$NOIT_TEST_DB_PORT;database=$db", $user, '', 
     54    { 'PrintError' => 0 } 
    5455  ); 
    5556}