Changeset 2133

Show
Ignore:
Timestamp:
04/28/08 22:41:12 (5 months ago)
Author:
mpaschal
Message:

Improve driver tester a little
Make autoflush setting self-explanatory
Use skip_all instead of a SKIP block around the whole file

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/release-36/t/driver-tests.pl

    r1490 r2133  
    1010use warnings; 
    1111use Data::Dumper; 
    12  
    13 $| = 1; 
     12use English qw( -no_match_vars ); 
     13 
     14$OUTPUT_AUTOFLUSH = 1; 
    1415 
    1516# Run this script as a symlink, in the form of 99-driver.t, ie: 
     
    2425} 
    2526 
    26 use Test::More tests => 233; 
    27 use lib 't/lib', 'extlib', 'lib', '../lib', '../extlib'; 
     27use constant TESTS => 232; 
     28 
     29use Test::More; 
     30use lib 't/lib'; 
    2831use MT::Test qw(:testdb); 
    2932 
     
    4144package main; 
    4245 
    43 print "Please configure for this test by creating $ENV{MT_CONFIG} with your database, username, and password\n" 
    44     unless -r $ENV{MT_CONFIG}; 
    45 SKIP: { 
    46     skip("$ENV{MT_CONFIG} configuration not found", 227) 
    47         unless ok(-r $ENV{MT_CONFIG}, "$ENV{MT_CONFIG} configuration"); 
     46if (-r $ENV{MT_CONFIG}) { 
     47    plan tests => TESTS(); 
     48
     49else { 
     50    print "Please configure for this test by creating $ENV{MT_CONFIG} with your database, username, and password\n"; 
     51    plan skip_all => "$ENV{MT_CONFIG} configuration not found"; 
     52
    4853 
    4954my(@foo, @bar); 
     
    712717    skip(1, '$tmp[1] undefined') unless $tmp[1]; 
    713718    ok($tmp[1] && ($tmp[1]->name eq 'this'), 'name'); 
    714 } 
    715  
    716719} 
    717720 
     
    743746$newdata->save; 
    744747 
    745 my $count = Foo->count( [{status => 10}, -or => {name => 'Apple'}] ); 
     748$count = Foo->count( [{status => 10}, -or => {name => 'Apple'}] ); 
    746749# ==> select count(*) from mt_foo where foo_status = 10 or foo_name = 'Apple' 
    747750is($count, 3, '-or count');