summaryrefslogtreecommitdiffstats
path: root/SunSpider/sunspider
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2008-12-17 18:05:15 -0800
commit1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353 (patch)
tree4457a7306ea5acb43fe05bfe0973b1f7faf97ba2 /SunSpider/sunspider
parent9364f22aed35e1a1e9d07c121510f80be3ab0502 (diff)
downloadexternal_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.zip
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.gz
external_webkit-1cbdecfa9fc428ac2d8aca0fa91c9580b3d57353.tar.bz2
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'SunSpider/sunspider')
-rwxr-xr-xSunSpider/sunspider18
1 files changed, 16 insertions, 2 deletions
diff --git a/SunSpider/sunspider b/SunSpider/sunspider
index da8634f..84375f3 100755
--- a/SunSpider/sunspider
+++ b/SunSpider/sunspider
@@ -30,12 +30,16 @@ use File::Basename;
use File::Spec;
use Cwd;
use POSIX qw(strftime);
+use Time::HiRes qw(gettimeofday tv_interval);
my $showHelp = 0;
my $runShark = 0;
my $runShark20 = 0;
my $runSharkCache = 0;
+my $ubench = 0;
+my $v8suite = 0;
my $jsShellPath;
+my $jsShellArgs = "";
my $setBaseline = 0;
my $testsPattern;
my $testRuns = 10;
@@ -46,19 +50,25 @@ Usage: $programName --shell=[path] [options]
--help Show this help message
--set-baseline Set baseline for future comparisons
--shell Path to JavaScript shell
+ --args Arguments to pass to JavaScript shell
--runs Number of times to run tests (default: $testRuns)
--tests Only run tests matching provided pattern
--shark Sample execution time with the Mac OS X "Shark" performance testing tool (implies --runs=1)
--shark20 Like --shark, but with a 20 microsecond sampling interval
--shark-cache Like --shark, but performs a L2 cache-miss sample instead of time sample
+ --ubench Use microbenchmark suite instead of regular tests (to check for core execution regressions)
+ --v8-suite Use the V8 benchmark suite
EOF
GetOptions('runs=i' => \$testRuns,
'set-baseline' => \$setBaseline,
'shell=s' => \$jsShellPath,
+ 'args=s' => \$jsShellArgs,
'shark' => \$runShark,
'shark20' => \$runShark20,
'shark-cache' => \$runSharkCache,
+ 'ubench' => \$ubench,
+ 'v8-suite' => \$v8suite,
'tests=s' => \$testsPattern,
'help' => \$showHelp);
@@ -105,7 +115,11 @@ my %uniqueCategories = ();
sub loadTestsList()
{
- open TESTLIST, "<", "tests/LIST" or die "Can't find ./tests/LIST";
+ my $testlist = "LIST";
+ $testlist = "LIST-UBENCH" if ($ubench);
+ $testlist = "LIST-V8" if ($v8suite);
+
+ open TESTLIST, "<", "tests/${testlist}" or die "Can't find ./tests/${testlist}";
while (<TESTLIST>) {
chomp;
next unless !$testsPattern || /$testsPattern/;
@@ -137,7 +151,7 @@ sub writePrefixFile()
sub runTestsOnce($)
{
my ($useShark) = @_;
- my $shellArgs = "-f $prefixFile -f resources/sunspider-standalone-driver.js 2> /dev/null";
+ my $shellArgs = $jsShellArgs . " -f $prefixFile -f resources/sunspider-standalone-driver.js 2> /dev/null";
my $output;
if ($useShark) {
my $intervalArg = $useShark == 20 ? "-I 20u" : "";