Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / performance-tests / Synch-Benchmarks / run_tests.pl
blob89a716c2c8a188d0cd88aecbe44a394b105747cb
1 eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
2 & eval 'exec perl -S $0 $argv:q'
3 if 0;
6 $EXE = "synch_driver";
7 $Win32 = 0;
8 if ($^O eq "MSWin32")
10 $Win32 = 1;
13 $debug = 0;
14 $name = "release";
15 $result_dir = "results";
16 $svcconf_dir = "svcconf";
17 $conf_ext = ".conf";
19 @Null_List = ();
21 # This is called "baseline"
22 @Baseline_List = ("base_acquire",
23 "base_tryacquire",
24 "base_acquire_read",
25 "base_tryacquire_read",
26 "base_acquire_write",
27 "base_tryacquire_write");
29 # this is called "perf_thrno"
30 @Perf_Thr_Number_List = ("perf_t1",
31 "perf_t2",
32 "perf_t4",
33 "perf_t8",
34 "perf_t16",
35 "perf_t32",
36 "perf_t64");
38 @Target = @Null_List;
40 while ( $#ARGV >= 0 && $ARGV[0] =~ /^-/ )
42 if ($ARGV[0] eq '-d') # Run debug mode
44 $name = "debug";
46 elsif ($ARGV[0] eq '-p') # Debug perl script
48 $debug = 1;
49 print "debug perl scirpt\n";
51 elsif ($ARGV[0] eq '-D') # Subdir name to put the result
53 shift;
54 $result_dir = $ARGV[0];
56 elsif ($ARGV[0] eq '-S') # Subdir to svc.conf files.
58 shift;
59 $svcconf_dir = $ARGV[0];
61 elsif ($ARGV[0] eq '-N') # Specify test name.
63 shift;
64 if ($ARGV[0] eq "baseline")
66 @Target = @Baseline_List;
68 elsif ($ARGV[0] eq "perf_thrno")
70 @Target = @Perf_Thr_Number_List;
72 else
74 die "Unknown test \"$ARGV[0]\"\n";
77 else
79 warn "$0: unknown option $ARGV[0]\n";
80 die $usage;
82 shift;
85 die "You must specify a test to run\n" if (scalar (@Target) == 0);
87 if ($Win32 != 0)
89 $execname = "$name\\$EXE";
90 $DIR_SEPARATOR = '\\';
92 else
94 $execname = "./$EXE"; # Notice that on UNIX, you much build
95 # Debug/Release program explicitly
96 # before running the script.
97 $DIR_SEPARATOR = '/';
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";
107 else
109 open STDOUT, "> $Redirect_Output";
110 open STDERR, ">&STDOUT";
113 @args = ("$execname",
114 "-f",
115 "$svcconf_dir$DIR_SEPARATOR$Target[$Cntr]$conf_ext");
117 if ($debug != 0)
119 print "Debug mode: Executing -- ";
120 for ($args_c = 0; $args_c < scalar (@args); $args_c ++)
122 print "$args[$args_c] ";
124 print "\n";
126 else
128 system (@args);