summaryrefslogtreecommitdiffstats
path: root/SunSpider/sunspider
diff options
context:
space:
mode:
Diffstat (limited to 'SunSpider/sunspider')
-rwxr-xr-xSunSpider/sunspider34
1 files changed, 18 insertions, 16 deletions
diff --git a/SunSpider/sunspider b/SunSpider/sunspider
index 20614b1..97a86f1 100755
--- a/SunSpider/sunspider
+++ b/SunSpider/sunspider
@@ -38,7 +38,8 @@ my $runShark20 = 0;
my $runSharkCache = 0;
my $ubench = 0;
my $v8suite = 0;
-my $parseonly = 0;
+my $suite = "";
+my $parseOnly = 0;
my $jsShellPath;
my $jsShellArgs = "";
my $setBaseline = 0;
@@ -57,9 +58,10 @@ Usage: $programName --shell=[path] [options]
--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
- --parse-only Use the parse-only benchmark suite
+ --suite Select a specific benchmark suite. The default is sunspider-0.9.1
+ --ubench Use microbenchmark suite instead of regular tests. Same as --suite=ubench
+ --v8-suite Use the V8 benchmark suite. Same as --suite=v8-v4
+ --parse-only Use the parse-only benchmark suite. Same as --suite=parse-only
EOF
GetOptions('runs=i' => \$testRuns,
@@ -69,16 +71,20 @@ GetOptions('runs=i' => \$testRuns,
'shark' => \$runShark,
'shark20' => \$runShark20,
'shark-cache' => \$runSharkCache,
+ 'suite=s' => \$suite,
'ubench' => \$ubench,
'v8-suite' => \$v8suite,
- 'parse-only' => \$parseonly,
+ 'parse-only' => \$parseOnly,
'tests=s' => \$testsPattern,
'help' => \$showHelp);
-my $resultDirectory = "sunspider-results";
-$resultDirectory = "ubench-results" if ($ubench);
-$resultDirectory = "v8-results" if ($v8suite);
-$resultDirectory = "parse-only-results" if ($parseonly);
+
+$suite = "ubench" if ($ubench);
+$suite = "v8-v4" if ($v8suite);
+$suite = "parse-only" if ($parseOnly);
+$suite = "sunspider-0.9.1" if (!$suite);
+
+my $resultDirectory = "${suite}-results";
$runShark = 1 if $runSharkCache;
$runShark = 20 if $runShark20;
@@ -123,12 +129,7 @@ my %uniqueCategories = ();
sub loadTestsList()
{
- my $testlist = "LIST";
- $testlist = "LIST-UBENCH" if ($ubench);
- $testlist = "LIST-V8" if ($v8suite);
- $testlist = "LIST-PARSE-ONLY" if ($parseonly);
-
- open TESTLIST, "<", "tests/${testlist}" or die "Can't find ./tests/${testlist}";
+ open TESTLIST, "<", "tests/${suite}/LIST" or die "Can't find ./tests/${suite}/LIST";
while (<TESTLIST>) {
chomp;
next unless !$testsPattern || /$testsPattern/;
@@ -150,7 +151,8 @@ my $resultsFile = "$resultDirectory/sunspider-results-$timeString.js";
sub writePrefixFile()
{
- my $prefix = "var tests = [ " . join(", ", map { '"' . $_ . '"' } @tests) . " ];\n";
+ my $prefix = "var suiteName = " . '"' . $suite . '"' . ";\n";
+ $prefix .= "var tests = [ " . join(", ", map { '"' . $_ . '"' } @tests) . " ];\n";
$prefix .= "var categories = [ " . join(", ", map { '"' . $_ . '"' } @categories) . " ];\n";
mkdir "$resultDirectory";