Changeset 2034

Show
Ignore:
Timestamp:
02/28/08 09:45:30 (3 months ago)
Author:
joshr
Message:

try to predict number of tests

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Swishetest/trunk/t/030-C030-medsm-xml.t

    r2001 r2034  
    1818    use MinMax; 
    1919    use File::Path qw(mkpath); 
     20    use List::Util qw(sum);    # sum sums up digits in a list 
    2021    use GetDictionaryWords; 
    21     use Test::More qw(no_plan); 
     22    use Test::More;# qw(no_plan); 
    2223    my $max_words = MinMax::min(1_000_000, ($ENV{MAX_INDEX_FILES} || 1_000_000)); 
    2324    # predict number of tests based on number of files in dictionaries and number of index types 
    24     my @dicts = qw( data/C020-words-txt/words-linux-fc1.txt data/C020-words-txt/words-osx-10_3.txt); 
     25    #my @dicts = qw( data/C020-words-txt/words-linux-fc1.txt data/C020-words-txt/words-osx-10_3.txt); 
     26    my @dicts = qw( data/C020-words-txt/words-osx-10_3.txt data/C020-words-txt/words-linux-fc1.txt ); 
     27    my @dictwordcounts = map { `wc -l $_ | awk '{print \$1}' ` } @dicts; 
     28    chomp(@dictwordcounts); 
     29    my $numdictwords = sum( @dictwordcounts ); 
    2530    my @filetypes = qw(html xml txt); 
    2631    my $numdicts = scalar(@dicts); 
    2732    my $numfiletypes = scalar(@filetypes); 
     33    my $totalnumtests = $numfiletypes * (3 + $numdictwords); 
    2834    # three tests plus one for each word, for each dictionary and filetype. 
    2935    #plan tests => ($numdicts * $numfiletypes * (3 + $max_words )); 
     36    plan tests => $totalnumtests; 
    3037    mkpath( ["blib/index"], 0, 0755); 
    3138    my $base = "C030";