4 chdir( 't' ) if -d 't';
5 unshift @INC, '../lib';
9 unlink 'tmon.out', 'err';
12 use Benchmark qw( timediff timestr );
13 use Getopt::Std 'getopts';
19 # -p Name of perl binary
21 @tests = @ARGV ? @ARGV : sort <lib/dprof/*_t lib/dprof/*_v>; # glob-sort, for OS/2
23 $path_sep = $Config{path_sep} || ':';
24 $perl5lib = $opt_I || join( $path_sep, @INC );
25 $perl = $opt_p || $^X;
28 print "tests: @tests\n";
29 print "perl: $perl\n";
30 print "perl5lib: $perl5lib\n";
32 if( $perl =~ m|^\./| ){
33 # turn ./perl into ../perl, because of chdir(t) above.
36 if( ! -f $perl ){ die "Where's Perl?" }
41 local $ENV{PERL5LIB} = $perl5lib;
42 my $opt_d = '-d:DProf';
44 my $t_start = new Benchmark;
45 open( R, "$perl $opt_d $test |" ) || warn "$0: Can't run. $!\n";
48 my $t_total = timediff( new Benchmark, $t_start );
55 print timestr( $t_total, 'nop' ), "\n";
62 system $perl, '-I../lib', '-I./lib/dprof', $test,
63 $opt_v?'-v':'', '-p', $perl;
71 if( $test =~ /_t$/i ){
72 print "# $test" . '.' x (20 - length $test);