Changeset 2037

Show
Ignore:
Timestamp:
02/29/08 08:35:30 (3 months ago)
Author:
joshr
Message:

fixed case when we don't run tests. Added comments.
Added cleanups.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Swishetest/trunk/t/050-C020-largeindex.t

    r2005 r2037  
    88# change 'tests => 1' to 'tests => last_test_to_print'; 
    99 
    10 use Test::More qw(no_plan); # tests => 7; 
     10use Test::More; # qw(no_plan); # tests => 7; 
    1111use Swishetest; 
     12use Data::Dumper; 
    1213 
    1314BEGIN {  
    1415    unless ($ENV{TEST_HUGE_INDEX}) { 
     16        plan tests => 1;  
     17        ok( 1, "no test" ); 
    1518        print STDERR "$0: not running huge index test, set TEST_HUGE_INDEX=1 to enable\n"; 
    1619        exit(0); 
    1720    } 
     21    plan tests => 3; 
    1822    use File::Path qw(mkpath); 
    1923    mkpath( ["blib/index"], 0, 0755); 
    2024    my $base = "T050-$$";  # test 050 
    21     warn "base is $base\n"; 
    22     my (%out) = BuildIndex::build_index_from_external_program(  
    23         #"./make_collection -min_words=1000    -max_words=1000    -num_files=100", # this makes 920K of data, 2.33MB index, 476k propfile 
    24         #"./make_collection -min_words=10000   -max_words=10000   -num_files=1000", # this makes 38M index, 40MB prop  
    25         #"./make_collection -min_words=100000  -max_words=100000  -num_files=1000", # this makes 325MB index, 392MB props 
    26          "./make_collection -min_words=100000  -max_words=100000  -num_files=10000", # this makes ~3.1gb+2.5gb or so 
    27         "blib/index/$base.index", 
    28         "",                     # default config 
    29         "-e" # economy option  
    30     ); 
     25    #my $base = "T050-28400";  # test 050 
     26    unless (-e "blib/index/$base.index" ) { 
     27        warn "base is $base\n"; 
     28        my (%out) = BuildIndex::build_index_from_external_program(  
    3129 
    32     # the real test here is if you get an error indexing above :) 
     30            #"./make_collection -min_words=1000    -max_words=1000    -num_files=100",  
     31            #      # this makes 920K of data, 2.33MB index, 476k propfile 
     32             
     33            #"./make_collection -min_words=10000   -max_words=10000   -num_files=1000",  
     34            #       # this makes 38M index, 40MB prop  
     35             
     36            #"./make_collection -min_words=100000  -max_words=100000  -num_files=1000",  
     37            #       # this makes 325MB index, 392MB props 
     38             
     39            "./make_collection -min_words=100000  -max_words=100000  -num_files=10000",  
     40             # this makes: 3.84G    blib/index/T050-28400.index.prop 
     41             #             3.16G    blib/index/T050-28400.index 
     42              
     43            "blib/index/$base.index", 
     44            "",                     # default config 
     45            "-e" # economy option  
     46        ); 
     47 
     48        # the first real test here is if you get an error indexing above :) 
     49         
     50        #print Dumper( \%out ); 
    3351     
    34     cmp_ok( scalar(keys(%out)), '>',          2, "Indexing output" );  
     52        cmp_ok( scalar(keys(%out)), '>',          2, "Indexing output" );  
     53    } 
    3554 
    3655    #cmp_ok( $out{unique},     '==',    252983, 'unique words indexed' ); 
     
    4160 
    4261    DoSearch::open_index( "blib/index/$base.index" ); 
     62    ok( 1, "index opened" ); 
    4363    my @rows = DoSearch::do_search( "blib/index/$base.index", "swishe OR test"); 
    4464    DoSearch::close_index( "blib/index/$base.index" );