Changeset 2091

Show
Ignore:
Timestamp:
03/19/08 20:30:21 (2 months ago)
Author:
joshr
Message:

changes to indicate that we're skipping this test, and how to
enable it.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Swishetest/trunk/t/025-valgrind.t

    r2080 r2091  
    2323               ); 
    2424 
    25     unless( $ENV{TEST_VALGRIND} ) { 
    26         plan tests => 1; 
    27         ok( 1, "skipping, TEST_VALGRIND not set" ); 
    28         exit(0); 
    29     } 
    30     my $valgrind = mywhich( "valgrind" ); 
    31     unless( $valgrind ) { 
    32         plan tests => 1; 
    33         ok( 1, "skipping, valgrind not found" ); 
    34         exit(0); 
    35     } 
    36     plan tests => scalar( @docs ); 
    37     for my $doc (@docs) { 
    38         #my $valgrind_options = "--show-below-main=yes --leak-check=full --show-reachable=yes -v"; 
    39         my $valgrind_options = "--show-below-main=yes --leak-check=full --show-reachable=yes";  # -v removed 
    40         my @output = `valgrind $valgrind_options swish-e -c conf/basic-libxml2.conf -i $doc -f 'blib/index/C025.index' -v 1  2>&1`; 
    41         print STDERR @output; 
    42         ok(1, "valgrind indexing $doc" ); 
    43     } 
     25    SKIP: { 
     26 
     27        my $numtests = scalar(@docs); 
     28        if ($ENV{TEST_VALGRIND}) { 
     29            plan tests => $numtests; 
     30        } else { 
     31            plan skip_all => "not running valgrind test, set TEST_VALGRIND=1 to enable"; 
     32        } 
     33         
     34        my $valgrind = mywhich( "valgrind" ); 
     35        unless( $valgrind ) { 
     36            plan tests => 1; 
     37            ok( 1, "skipping, valgrind not found" ); 
     38            exit(0); 
     39        } 
     40        for my $doc (@docs) { 
     41            #my $valgrind_options = "--show-below-main=yes --leak-check=full --show-reachable=yes -v"; 
     42            my $valgrind_options = "--show-below-main=yes --leak-check=full --show-reachable=yes";  # -v removed 
     43            my @output = `valgrind $valgrind_options swish-e -c conf/basic-libxml2.conf -i $doc -f 'blib/index/C025.index' -v 1  2>&1`; 
     44            print STDERR @output; 
     45            ok(1, "valgrind indexing $doc" ); 
     46        } 
     47    }    
    4448}; 
    4549 
     
    5559    return; # not found 
    5660} 
     61 
     62__END__ 
     63 
     64SKIP: { 
     65    skip $why, $how_many unless $have_some_feature;  
     66    ok( foo(),       $test_name ); 
     67    is( foo(42), 23, $test_name ); 
     68}; 
     69 
     70