Changeset 2052
- Timestamp:
- 03/09/08 03:22:11 (2 months ago)
- Files:
-
- Swishetest/trunk/t/025-valgrind.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Swishetest/trunk/t/025-valgrind.t
r2044 r2052 6 6 ######################### 7 7 8 # change 'tests => 1' to 'tests => last_test_to_print'; 9 10 use Test::More tests => 3; 8 use Test::More; 9 use File::Path qw(mkpath); 11 10 use Swishetest; 12 11 13 BEGIN { 14 use File::Path qw(mkpath); 12 ############################################ 13 main(); 14 15 ############################################ 16 sub main { 15 17 mkpath( ["blib/index"], 0, 0755); 16 18 … … 19 21 data/C020-words-txt/words-osx-10_3.txt ); 20 22 23 my $valgrind = mywhich( "valgrind" ); 24 unless( $valgrind ) { 25 plan tests => 1; 26 ok( 1, "skipping, valgrind not found" ); 27 exit(0); 28 } 29 plan tests => scalar( @docs ); 21 30 for my $doc (@docs) { 22 31 #my $valgrind_options = "--show-below-main=yes --leak-check=full --show-reachable=yes -v"; … … 26 35 ok(1, "valgrind indexing $doc" ); 27 36 } 37 }; 28 38 29 }; 39 ############################################ 40 sub mywhich { # so we don't have to use File::Which 41 my $exe = shift; 42 my @dirs = split( /:/, $ENV{PATH} || "" ); 43 for my $dir (@dirs) { 44 if (-x "$dir/$exe") { 45 return "$dir/$exe"; 46 } 47 } 48 return; # not found 49 }
