1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
15 $result_dir = "results";
16 $svcconf_dir = "svcconf";
21 # This is called "baseline"
22 @Baseline_List = ("base_acquire",
25 "base_tryacquire_read",
27 "base_tryacquire_write");
29 # this is called "perf_thrno"
30 @Perf_Thr_Number_List = ("perf_t1",
40 while ( $#ARGV >= 0 && $ARGV[0] =~ /^-/ )
42 if ($ARGV[0] eq '-d') # Run debug mode
46 elsif ($ARGV[0] eq '-p') # Debug perl script
49 print "debug perl scirpt\n";
51 elsif ($ARGV[0] eq '-D') # Subdir name to put the result
54 $result_dir = $ARGV[0];
56 elsif ($ARGV[0] eq '-S') # Subdir to svc.conf files.
59 $svcconf_dir = $ARGV[0];
61 elsif ($ARGV[0] eq '-N') # Specify test name.
64 if ($ARGV[0] eq "baseline")
66 @Target = @Baseline_List;
68 elsif ($ARGV[0] eq "perf_thrno")
70 @Target = @Perf_Thr_Number_List;
74 die "Unknown test \"$ARGV[0]\"\n";
79 warn "$0: unknown option $ARGV[0]\n";
85 die "You must specify a test to run\n" if (scalar (@Target) == 0);
89 $execname = "$name\\$EXE";
90 $DIR_SEPARATOR = '\\';
94 $execname = "./$EXE"; # Notice that on UNIX, you much build
95 # Debug/Release program explicitly
96 # before running the script.
100 for ($Cntr = 0; $Cntr < scalar (@Target); $Cntr++)
102 $Redirect_Output = "$result_dir$DIR_SEPARATOR$Target[$Cntr].$name";
103 if ($debug != 0) # Only redirect output in actual run
105 print "Redirecting output to $Redirect_Output\n";
109 open STDOUT
, "> $Redirect_Output";
110 open STDERR
, ">&STDOUT";
113 @args = ("$execname",
115 "$svcconf_dir$DIR_SEPARATOR$Target[$Cntr]$conf_ext");
119 print "Debug mode: Executing -- ";
120 for ($args_c = 0; $args_c < scalar (@args); $args_c ++)
122 print "$args[$args_c] ";