+2009-12-12 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ Enable Web-hosted version of SunSpider to handle multiple versions
+ https://bugs.webkit.org/show_bug.cgi?id=32478
+
+ * make-hosted: Now generate the hosted version to be able to run both the
+ 0.9 and the 0.9.1 test suites.
+ * hosted: Modified property svn:ignore.
+ * hosted/sunspider-driver.html: Removed.
+ * hosted/sunspider-results.html: Removed.
+ * hosted/sunspider.html:
+ * hosted/versions.html: Added.
+ * resources/TEMPLATE.html:
+ * resources/driver-TEMPLATE.html: Copied from hosted/sunspider-driver.html.
+ * resources/driver-TEMPLATE.html: Copied from hosted/sunspider-results.html.
+
2009-12-12 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver Hunt.
</dl>
-<p><a href="sunspider-driver.html">Start Now!</a><br>
+<p><b>Current version - sunspider-0.9:</b> <a href="sunspider-0.9/driver.html">Start Now!</a><br>
<small>(When you run the benchmark, be patient - it loops through all of the
test cases five times and can take a minute or longer to complete.)</small></p>
+<a href="versions.html">All versions.</a>
+
</body>
</html>
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+
+<!--
+ Copyright (C) 2007 Apple Inc. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<title>SunSpider JavaScript Benchmark</title>
+<link rel="stylesheet" href="sunspider.css"></link>
+</head>
+
+<body>
+
+<h2><span id="logo">☀</span>SunSpider JavaScript Benchmark</h2>
+
+<p>This is SunSpider, a JavaScript benchmark. This benchmark tests the
+core JavaScript language only, not the DOM or other browser APIs. It
+is designed to compare different versions of the same browser, and
+different browsers to each other. This page lists all versions:</p>
+
+<ul>
+<li><a href="sunspider-0.9/driver.html">Version 0.9</a></li>
+<ul><a href="sunspider-0.9.1/driver.html">Version 0.9.1</a></li>
+
+</body>
+<html>
my $template = do { local $/; <TEMPLATE> };
close TEMPLATE;
+open DRIVER_TEMPLATE, "<resources/driver-TEMPLATE.html";
+my $driverTemplate = do { local $/; <DRIVER_TEMPLATE> };
+close DRIVER_TEMPLATE;
+
+open RESULTS_TEMPLATE, "<resources/results-TEMPLATE.html";
+my $resultsTemplate = do { local $/; <RESULTS_TEMPLATE> };
+close RESULTS_TEMPLATE;
+
my @tests = ();
my @categories = ();
my %uniqueCategories = ();
-open TESTLIST, "<./tests/sunspider-0.9/LIST";
-while (<TESTLIST>) {
- chomp;
- next unless $_;
- push @tests, $_;
- my $category = $_;
- $category =~ s/-.*//;
- if (!$uniqueCategories{$category}) {
- push @categories, $category;
- $uniqueCategories{$category} = $category;
+my @suites = ("sunspider-0.9", "sunspider-0.9.1");
+
+foreach my $suite (@suites) {
+
+ mkdir "hosted/${suite}";
+
+ open TESTLIST, "<./tests/${suite}/LIST";
+ while (<TESTLIST>) {
+ chomp;
+ next unless $_;
+ push @tests, $_;
+ my $category = $_;
+ $category =~ s/-.*//;
+ if (!$uniqueCategories{$category}) {
+ push @categories, $category;
+ $uniqueCategories{$category} = $category;
+ }
}
-}
-close TESTLIST;
+ close TESTLIST;
+
+ for my $test (@tests) {
+ my $name = "${test}";
-for my $test (@tests) {
- my $name = "${test}";
+ open SCRIPT, "<tests/${suite}/${test}.js";
+ my $script = do { local $/; <SCRIPT> };
+ close SCRIPT;
- open SCRIPT, "<tests/sunspider-0.9/${test}.js";
- my $script = do { local $/; <SCRIPT> };
- close SCRIPT;
+ my $output = $template;
+ $output =~ s/\@NAME\@/${name}/g;
+ $output =~ s/\@SCRIPT\@/${script}/g;
+
+ open OUTPUT, ">hosted/${suite}/${test}.html";
+ print OUTPUT $output;
+ close OUTPUT;
+ }
- my $output = $template;
- $output =~ s/\@NAME\@/${name}/g;
- $output =~ s/\@SCRIPT\@/${script}/g;
+ my $output = $driverTemplate;
+ $output =~ s/\@SUITE\@/${suite}/g;
- open OUTPUT, ">hosted/${test}.html";
+ open OUTPUT, ">hosted/${suite}/driver.html";
print OUTPUT $output;
close OUTPUT;
-}
+ $output = $resultsTemplate;
+ $output =~ s/\@SUITE\@/${suite}/g;
+
+ open OUTPUT, ">hosted/${suite}/results.html";
+ print OUTPUT $output;
+ close OUTPUT;
+
+
+ my $prefix = "var tests = [ " . join(", ", map { '"' . $_ . '"' } @tests) . " ];\n";
+ $prefix .= "var categories = [ " . join(", ", map { '"' . $_ . '"' } @categories) . " ];\n";
-my $prefix = "var tests = [ " . join(", ", map { '"' . $_ . '"' } @tests) . " ];\n";
-$prefix .= "var categories = [ " . join(", ", map { '"' . $_ . '"' } @categories) . " ];\n";
+ open PREFIX, ">hosted/${suite}/sunspider-test-prefix.js";
+ print PREFIX $prefix;
+ close PREFIX;
-open PREFIX, ">hosted/sunspider-test-prefix.js";
-print PREFIX $prefix;
-close PREFIX;
+
+}
system("cp resources/sunspider-analyze-results.js hosted");
system("cp resources/sunspider-compare-results.js hosted");
-
print "hosted/sunspider.html is ready to use.\n";
-->
<title>SunSpider @NAME@</title>
-<link rel="stylesheet" href="sunspider.css">
+<link rel="stylesheet" href="../sunspider.css">
</head>
<body>
<h3>@NAME@</h3>
<div id="console">
</div>
-<script src="sunspider-record-result.js"></script>
+<script src="../sunspider-record-result.js"></script>
<script>
var _sunSpiderStartDate = new Date();
-->
<title>SunSpider JavaScript Benchmark (In Progress...)</title>
-<link rel="stylesheet" href="sunspider.css"></link>
+<link rel="stylesheet" href="../sunspider.css"></link>
</head>
<body onload="next()">
<h2><span id="logo">☀</span>SunSpider JavaScript Benchmark <small>(In Progress...)</small></h2>
+<h4>Version: @SUITE@</h4>
<script src="sunspider-test-prefix.js"></script>
<script>
outputString = outputString.substring(0, outputString.length - 1);
outputString += "}";
- location = "sunspider-results.html?" + encodeURI(outputString);
+ location = "results.html?" + encodeURI(outputString);
}
</script>
-->
<title>SunSpider JavaScript Benchmark Results</title>
-<link rel="stylesheet" href="sunspider.css"></link>
+<link rel="stylesheet" href="../sunspider.css"></link>
</head>
<body>
<h2><span id="logo">☀</span>SunSpider JavaScript Benchmark Results</h2>
-<p><a href="sunspider-driver.html">Run Again</a></p>
+<h4>Version: @SUITE@</h4>
+
+<p><a href="driver.html">Run Again</a></p>
<p><input style="width: 90%;" id="selfUrl" type="text" readonly="readonly"></input><br>
<small>(You can bookmark this results URL for later comparison.)</small></p>
</script>
<script src="sunspider-test-prefix.js"></script>
-<script src="sunspider-analyze-results.js"></script>
-<script src="sunspider-compare-results.js"></script>
+<script src="../sunspider-analyze-results.js"></script>
+<script src="../sunspider-compare-results.js"></script>
<script>
var output2 = output;