Changeset 949


Ignore:
Timestamp:
12/24/25 13:17:17 (4 hours ago)
Author:
Kris Deugau
Message:

/branches/cname-collision

Merge test framework fixes

Location:
branches/cname-collision/t
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/cname-collision/t/DNSTest.pm

    r946 r949  
    3636our $dnsdb;
    3737our $dbh;
     38our $debug;
    3839
    3940sub new {
     
    5657  BAIL_OUT("# DB looks like it may not be a test DB, found $dcount > 10 domains!\n")
    5758        if $dcount > 10;
    58   ok( $dcount, '<=', 10, "domain count ($dcount): looks like a test DB" );
     59  cmp_ok( $dcount, '<=', 10, "domain count ($dcount): looks like a test DB" );
    5960
    6061  my ($rcount) = $dbh->selectrow_array("SELECT count(*) FROM records");
    6162  BAIL_OUT("# DB looks like it may not be a test DB, found $rcount > 30 records!\n")
    6263        if $rcount > 50;
    63   ok( $rcount, '<=', 50, "record ($rcount): looks like a test DB" );
     64  cmp_ok( $rcount, '<=', 50, "record ($rcount): looks like a test DB" );
    6465
    6566  # drop all tables etc
    6667  $ENV{PGPASSWORD} = $dnsdb->{dbpass};
    67   diag qx( psql -h $dnsdb->{dbhost} -U $dnsdb->{dbuser} $dnsdb->{dbname} < t/dropall.sql );
     68# neither diag or note seem to suppress output from qx
     69  my $dropdata = qx( psql -h $dnsdb->{dbhost} -U $dnsdb->{dbuser} $dnsdb->{dbname} 2>&1 < t/dropall.sql );
     70  diag( $dropdata ) if $debug;
    6871  # load some standard test data
    69   diag qx( psql -h $dnsdb->{dbhost} -U $dnsdb->{dbuser} $dnsdb->{dbname} < t/dns-unitbase.sql );
    70 
    71 }
     72  my $reload = qx( psql -h $dnsdb->{dbhost} -U $dnsdb->{dbuser} $dnsdb->{dbname} 2>&1 < t/dns-unitbase.sql );
     73  diag( $reload ) if $debug;
     74  undef $ENV{PGPASSWORD};
     75} # new()
    7276
    7377sub DESTROY {
Note: See TracChangeset for help on using the changeset viewer.