diff --git a/test/harness/helper.js b/test/harness/helper.js index cb7e9fddfae065a7b237a28d60a18628f4ebea37..a37be4d3f13555f86fc6c72961bce4d00d6e183f 100644 --- a/test/harness/helper.js +++ b/test/harness/helper.js @@ -235,7 +235,7 @@ function Presenter() { /* Append a result to the run page's result log. */ function logResult(test) { altStyle = (altStyle !== ' ') ? ' ' : 'alternate'; - var appendStr = '<tbody><tr class=\"' + altStyle + '\"><td width=\"20%\">' + test.id + '</td><td>' + test.description + '</td><td align="right"><span class=\"Fail\">' + test.result + '</span></td></tr></tbody>'; + var appendStr = '<tbody><tr class=\"' + altStyle + '\"><td width=\"20%\">' + "<a class='showSource' href='#" + test.id + "'>" + test.id + "</a>" + '</td><td>' + test.description + '</td><td align="right"><span class=\"Fail\">' + test.result + '</span></td></tr></tbody>'; logger.append(appendStr); logger.parent().attr("scrollTop", logger.parent().attr("scrollHeight")); } @@ -314,7 +314,7 @@ function Presenter() { logger = $("#tableLogger"); progressBar = $('#progressbar'); activityBar = $('#nextActivity'); - + $('a.showSource', logger).live("click", openSourceWindow); $('#ancGenXMLReport').click(createXMLReportWindow); } } diff --git a/test/harness/sth.js b/test/harness/sth.js index aa42bd23d9b9476464df2b295bf847ac2c537345..f598370d603f521a5b6524e99383a982948b06f4 100644 --- a/test/harness/sth.js +++ b/test/harness/sth.js @@ -194,8 +194,7 @@ function BrowserRunner() { * * onTestsExhausted(): Called when there are no more tests to run. */ function TestLoader() { - var TEST_LIST_PATH = "resources/scripts/testcases/testcaseslist.json", - testGroups = [], + var testGroups = [], testGroupIndex = 0, currentTestIndex = 0, loader = this; diff --git a/tools/TestCaseHTMLPackager/TestCasePackager.py b/tools/TestCaseHTMLPackager/TestCasePackager.py index ed0dd86e6947d40e63a2c502573f164d9397ebac..6beb678c5032892d177d68270e9227802436b5d8 100644 --- a/tools/TestCaseHTMLPackager/TestCasePackager.py +++ b/tools/TestCaseHTMLPackager/TestCasePackager.py @@ -1,3 +1,23 @@ +# Copyright (c) 2009 Microsoft Corporation +# +# Redistribution and use in source and binary forms, with or without modification, are permitted provided +# that the following conditions are met: +# * Redistributions of source code must retain the above copyright notice, this list of conditions and +# the following disclaimer. +# * 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. +# * Neither the name of Microsoft nor the names of its contributors may be used to +# endorse or promote products derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER 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. + #--Imports--------------------------------------------------------------------- import argparse import os @@ -9,46 +29,15 @@ import shutil import re import json -#--Globals--------------------------------------------------------------------- -MAX_CASES_PER_JSON = 1000 - -#Directories under "test\suite\" containing ES5 test chapter directories -#with *.js tests underneath them -TEST_CONTRIB_DIRS = ["sputnik_converted", "ietestcenter"] - -#Global scope source files found directly under "test\suite\". -GLOBAL_SCOPE_FILES = ["SputnikGlobalScope.js"] +from TestCasePackagerConfig import * +#--Globals--------------------------------------------------------------------- __parser = argparse.ArgumentParser(description='Tool used to generate the test262 website') __parser.add_argument('version', action='store', help='Version of the test suite.') ARGS = __parser.parse_args() -#Path to the root of the Hg repository (relative to this file's location) -TEST262_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..") -TEST262_ROOT = os.path.abspath(TEST262_ROOT) - -#Directory full of test cases we want to port to the website's test harness runner -TEST262_CASES_DIR = os.path.join(TEST262_ROOT, "test", "suite") - -#Directory containing test harness files to be ported over to the website. Note that -#only *.js files will be migrated from this dir. -TEST262_HARNESS_DIR = os.path.join(TEST262_ROOT, "test", "harness") - -#Directory full of website test cases (ported over from TEST262_CASES_DIR) -TEST262_WEB_CASES_DIR = os.path.join(TEST262_ROOT, "website", "resources", "scripts", "testcases") - -#Directory containing the website's test harness (ported over from TEST262_HARNESS_DIR) -TEST262_WEB_HARNESS_DIR = os.path.join(TEST262_ROOT, "website", "resources", "scripts", "global") - -#Path to the ported test case files on the actual website as opposed to the Hg layout -WEBSITE_CASES_PATH = "resources/scripts/testcases/" - -#The name of a file which contains a list of tests which should be disabled in test262. -#These tests are either invalid as-per ES5 or have issues with the test262 web harness. -EXCLUDED_FILENAME = os.path.join(TEST262_ROOT, "test", "config", "excludelist.xml") - if not os.path.exists(EXCLUDED_FILENAME): print "Cannot generate (JSON) test262 tests without a file, %s, showing which tests have been disabled!" % EXCLUDED_FILENAME sys.exit(1) @@ -56,8 +45,6 @@ EXCLUDE_LIST = xml.dom.minidom.parse(EXCLUDED_FILENAME) EXCLUDE_LIST = EXCLUDE_LIST.getElementsByTagName("test") EXCLUDE_LIST = [x.getAttribute("id") for x in EXCLUDE_LIST] - - #a list of all ES5 test chapter directories TEST_SUITE_SECTIONS = [] diff --git a/tools/TestCaseHTMLPackager/TestCasePackagerConfig.py b/tools/TestCaseHTMLPackager/TestCasePackagerConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..e5019aa2ff8b9bb441c473becd14c2a537e08828 --- /dev/null +++ b/tools/TestCaseHTMLPackager/TestCasePackagerConfig.py @@ -0,0 +1,67 @@ +# Copyright (c) 2009 Microsoft Corporation +# +# Redistribution and use in source and binary forms, with or without modification, are permitted provided +# that the following conditions are met: +# * Redistributions of source code must retain the above copyright notice, this list of conditions and +# the following disclaimer. +# * 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. +# * Neither the name of Microsoft nor the names of its contributors may be used to +# endorse or promote products derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 THE COPYRIGHT OWNER 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. + +#--Imports--------------------------------------------------------------------- +import os + +#--Globals--------------------------------------------------------------------- +MAX_CASES_PER_JSON = 1000 + +#Directories under "test\suite\" containing ES5 test chapter directories +#with *.js tests underneath them +TEST_CONTRIB_DIRS = ["sputnik_converted", "ietestcenter"] + +#Global scope source files found directly under "test\suite\". +GLOBAL_SCOPE_FILES = ["SputnikGlobalScope.js"] + +#Path to the root of the Hg repository (relative to this file's location) +TEST262_ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..") +TEST262_ROOT = os.path.abspath(TEST262_ROOT) + +#Directory full of test cases we want to port to the website's test harness runner +TEST262_CASES_DIR = os.path.join(TEST262_ROOT, "test", "suite") + +#Directory containing test harness files to be ported over to the website. Note that +#only *.js files will be migrated from this dir. +TEST262_HARNESS_DIR = os.path.join(TEST262_ROOT, "test", "harness") + +#Directory full of website test cases (ported over from TEST262_CASES_DIR) +TEST262_WEB_CASES_DIR = os.path.join(TEST262_ROOT, "website", "resources", "scripts", "testcases") + +#Directory containing the website's test harness (ported over from TEST262_HARNESS_DIR) +TEST262_WEB_HARNESS_DIR = os.path.join(TEST262_ROOT, "website", "resources", "scripts", "global") + +#Path to the ported test case files on the actual website as opposed to the Hg layout +WEBSITE_CASES_PATH = "resources/scripts/testcases/" + +#The name of a file which contains a list of tests which should be disabled in test262. +#These tests are either invalid as-per ES5 or have issues with the test262 web harness. +EXCLUDED_FILENAME = os.path.join(TEST262_ROOT, "test", "config", "excludelist.xml") + + + +#--Sanity checks--------------------------------------------------------------# + + +#--Helpers--------------------------------------------------------------------# + + +#------------------------------------------------------------------------------ + diff --git a/website/default.html b/website/default.html index 91467c3ec9e3db465242e0ac1acb537b241d1135..d694ce61f0888384c61bf692c0afdc73bdb7bfec 100644 --- a/website/default.html +++ b/website/default.html @@ -4,6 +4,10 @@ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <script type="text/javascript" src="resources/scripts/global/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="resources/scripts/global/sections.js"></script> +<script type="text/javascript"> + //Globals + var TEST_LIST_PATH = "resources/scripts/testcases/testcaseslist.json"; +</script> <script type="text/javascript" src="resources/scripts/global/sth.js"></script> <script type="text/javascript" src="resources/scripts/global/sta.js"></script> <script type="text/javascript" src="resources/scripts/global/jqueryprogressbar.js"></script> @@ -62,7 +66,7 @@ <!-- This is the Main Content Container --> <div class="content-home"> <p class="headers">What is test262?</p> - <p class="content">test262 is a test suite that may be used to check how closely a JavaScript implementation follows the ECMAScript 5th Edition Specification. The test suite contains thousands of individual tests, each of which tests some specific requirements of the ECMAScript specification.</p> + <p class="content">test262 is a test suite intended to check agreement between JavaScript implementations and the ECMA-262 Specification (currently 5th Edition). The test suite contains thousands of individual tests, each of which tests some specific requirements of the ECMAScript specification.</p> <p class="headers">What is ECMAScript?</p> <p class="content">"ECMAScript" is the name under which the language more commonly known as "JavaScript" is standardized. Development of the ECMAScript standard is the responsibility of <a href='javascript:void(window.open("http://www.ecma-international.org/memento/TC39.htm"));'>Technical Committee 39 (TC39)</a> of <a href='javascript:void(window.open("http://www.ecma-international.org/"));'>Ecma International</a>. The ECMAScript standard is officially known as ECMA-262. ECMAScript 5 (or just ES5) is short hand for the "ECMA-262, 5th Edition ECMAScript Language Specification" the official name of the current edition of the standard. ECMAScript 5 was approved as an official Ecma standard by the Ecma General Assembly on December 3, 2009. <a href='javascript:void(window.open("http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf"));'>The ECMAScript 5 Specification (PDF)</a> is available from the Ecma International web site.</p> <p class="headers">Who creates and maintains test262?</p> diff --git a/website/resources/scripts/global/helper.js b/website/resources/scripts/global/helper.js index cb7e9fddfae065a7b237a28d60a18628f4ebea37..a37be4d3f13555f86fc6c72961bce4d00d6e183f 100644 --- a/website/resources/scripts/global/helper.js +++ b/website/resources/scripts/global/helper.js @@ -235,7 +235,7 @@ function Presenter() { /* Append a result to the run page's result log. */ function logResult(test) { altStyle = (altStyle !== ' ') ? ' ' : 'alternate'; - var appendStr = '<tbody><tr class=\"' + altStyle + '\"><td width=\"20%\">' + test.id + '</td><td>' + test.description + '</td><td align="right"><span class=\"Fail\">' + test.result + '</span></td></tr></tbody>'; + var appendStr = '<tbody><tr class=\"' + altStyle + '\"><td width=\"20%\">' + "<a class='showSource' href='#" + test.id + "'>" + test.id + "</a>" + '</td><td>' + test.description + '</td><td align="right"><span class=\"Fail\">' + test.result + '</span></td></tr></tbody>'; logger.append(appendStr); logger.parent().attr("scrollTop", logger.parent().attr("scrollHeight")); } @@ -314,7 +314,7 @@ function Presenter() { logger = $("#tableLogger"); progressBar = $('#progressbar'); activityBar = $('#nextActivity'); - + $('a.showSource', logger).live("click", openSourceWindow); $('#ancGenXMLReport').click(createXMLReportWindow); } } diff --git a/website/resources/scripts/global/sth.js b/website/resources/scripts/global/sth.js index aa42bd23d9b9476464df2b295bf847ac2c537345..f598370d603f521a5b6524e99383a982948b06f4 100644 --- a/website/resources/scripts/global/sth.js +++ b/website/resources/scripts/global/sth.js @@ -194,8 +194,7 @@ function BrowserRunner() { * * onTestsExhausted(): Called when there are no more tests to run. */ function TestLoader() { - var TEST_LIST_PATH = "resources/scripts/testcases/testcaseslist.json", - testGroups = [], + var testGroups = [], testGroupIndex = 0, currentTestIndex = 0, loader = this; diff --git a/website/resources/scripts/testcases/testcaseslist.json b/website/resources/scripts/testcases/testcaseslist.json index 9631e82f903b3ef01732dc4a70458b13e645112a..ac450a44699bf2569af5f8ddc1ac87d508d719aa 100644 --- a/website/resources/scripts/testcases/testcaseslist.json +++ b/website/resources/scripts/testcases/testcaseslist.json @@ -1 +1 @@ -{"date":"2011-05-25","numTests":10865,"testSuite":["resources/scripts/testcases/07_Lexical_Conventions.json","resources/scripts/testcases/08_Types.json","resources/scripts/testcases/09_Type_Conversion.json","resources/scripts/testcases/10_Execution_Contexts.json","resources/scripts/testcases/11.10_Binary_Bitwise_Operators.json","resources/scripts/testcases/11.11_Binary_Logical_Operators.json","resources/scripts/testcases/11.12_Conditional_Operator.json","resources/scripts/testcases/11.13_Assignment_Operators.json","resources/scripts/testcases/11.14_Comma_Operator.json","resources/scripts/testcases/11.1_Primary_Expressions.json","resources/scripts/testcases/11.2_Left_Hand_Side_Expressions.json","resources/scripts/testcases/11.3_PostfixExpressions.json","resources/scripts/testcases/11.4_Unary_Operators.json","resources/scripts/testcases/11.5_Multiplicative_Operators.json","resources/scripts/testcases/11.6_Additive_Operators.json","resources/scripts/testcases/11.7_Bitwise_Shift_Operators.json","resources/scripts/testcases/11.8_Relational_Operators.json","resources/scripts/testcases/11.9_Equality_Operators.json","resources/scripts/testcases/12_Statement.json","resources/scripts/testcases/13_Function_Definition.json","resources/scripts/testcases/14_Program.json","resources/scripts/testcases/15.10_RegExp_Objects.json","resources/scripts/testcases/15.11_Error_Objects.json","resources/scripts/testcases/15.1_The_Global_Object.json","resources/scripts/testcases/15.2_Object_Objects.json","resources/scripts/testcases/15.3_Function_Objects.json","resources/scripts/testcases/15.4_Array_Objects.json","resources/scripts/testcases/15.5_String_Objects.json","resources/scripts/testcases/15.6_Boolean_Objects.json","resources/scripts/testcases/15.7_Number_Objects.json","resources/scripts/testcases/15.8_The_Math_Object.json","resources/scripts/testcases/15.9_Date_Objects.json","resources/scripts/testcases/chapter07.json","resources/scripts/testcases/chapter08.json","resources/scripts/testcases/chapter10.json","resources/scripts/testcases/chapter11.json","resources/scripts/testcases/chapter12.json","resources/scripts/testcases/chapter13.json","resources/scripts/testcases/chapter14.json","resources/scripts/testcases/15.1.json","resources/scripts/testcases/15.10.json","resources/scripts/testcases/15.11.json","resources/scripts/testcases/15.12.json","resources/scripts/testcases/15.2.3.1.json","resources/scripts/testcases/15.2.3.10.json","resources/scripts/testcases/15.2.3.11.json","resources/scripts/testcases/15.2.3.12.json","resources/scripts/testcases/15.2.3.13.json","resources/scripts/testcases/15.2.3.14.json","resources/scripts/testcases/15.2.3.2.json","resources/scripts/testcases/15.2.3.3.json","resources/scripts/testcases/15.2.3.4.json","resources/scripts/testcases/15.2.3.5.json","resources/scripts/testcases/15.2.3.6.json","resources/scripts/testcases/15.2.3.7.json","resources/scripts/testcases/15.2.3.8.json","resources/scripts/testcases/15.2.3.9.json","resources/scripts/testcases/15.2.4.json","resources/scripts/testcases/15.3.json","resources/scripts/testcases/15.4.3.json","resources/scripts/testcases/15.4.4.10.json","resources/scripts/testcases/15.4.4.12.json","resources/scripts/testcases/15.4.4.14.json","resources/scripts/testcases/15.4.4.15.json","resources/scripts/testcases/15.4.4.16.json","resources/scripts/testcases/15.4.4.17.json","resources/scripts/testcases/15.4.4.18.json","resources/scripts/testcases/15.4.4.19.json","resources/scripts/testcases/15.4.4.20.json","resources/scripts/testcases/15.4.4.21.json","resources/scripts/testcases/15.4.4.22.json","resources/scripts/testcases/15.4.4.4.json","resources/scripts/testcases/15.4.5.json","resources/scripts/testcases/15.5.json","resources/scripts/testcases/15.7.json","resources/scripts/testcases/15.9.json"],"version":"0.7.3"} \ No newline at end of file +{"date":"2011-06-09","numTests":10865,"testSuite":["resources/scripts/testcases/07_Lexical_Conventions.json","resources/scripts/testcases/08_Types.json","resources/scripts/testcases/09_Type_Conversion.json","resources/scripts/testcases/10_Execution_Contexts.json","resources/scripts/testcases/11.10_Binary_Bitwise_Operators.json","resources/scripts/testcases/11.11_Binary_Logical_Operators.json","resources/scripts/testcases/11.12_Conditional_Operator.json","resources/scripts/testcases/11.13_Assignment_Operators.json","resources/scripts/testcases/11.14_Comma_Operator.json","resources/scripts/testcases/11.1_Primary_Expressions.json","resources/scripts/testcases/11.2_Left_Hand_Side_Expressions.json","resources/scripts/testcases/11.3_PostfixExpressions.json","resources/scripts/testcases/11.4_Unary_Operators.json","resources/scripts/testcases/11.5_Multiplicative_Operators.json","resources/scripts/testcases/11.6_Additive_Operators.json","resources/scripts/testcases/11.7_Bitwise_Shift_Operators.json","resources/scripts/testcases/11.8_Relational_Operators.json","resources/scripts/testcases/11.9_Equality_Operators.json","resources/scripts/testcases/12_Statement.json","resources/scripts/testcases/13_Function_Definition.json","resources/scripts/testcases/14_Program.json","resources/scripts/testcases/15.10_RegExp_Objects.json","resources/scripts/testcases/15.11_Error_Objects.json","resources/scripts/testcases/15.1_The_Global_Object.json","resources/scripts/testcases/15.2_Object_Objects.json","resources/scripts/testcases/15.3_Function_Objects.json","resources/scripts/testcases/15.4_Array_Objects.json","resources/scripts/testcases/15.5_String_Objects.json","resources/scripts/testcases/15.6_Boolean_Objects.json","resources/scripts/testcases/15.7_Number_Objects.json","resources/scripts/testcases/15.8_The_Math_Object.json","resources/scripts/testcases/15.9_Date_Objects.json","resources/scripts/testcases/chapter07.json","resources/scripts/testcases/chapter08.json","resources/scripts/testcases/chapter10.json","resources/scripts/testcases/chapter11.json","resources/scripts/testcases/chapter12.json","resources/scripts/testcases/chapter13.json","resources/scripts/testcases/chapter14.json","resources/scripts/testcases/15.1.json","resources/scripts/testcases/15.10.json","resources/scripts/testcases/15.11.json","resources/scripts/testcases/15.12.json","resources/scripts/testcases/15.2.3.1.json","resources/scripts/testcases/15.2.3.10.json","resources/scripts/testcases/15.2.3.11.json","resources/scripts/testcases/15.2.3.12.json","resources/scripts/testcases/15.2.3.13.json","resources/scripts/testcases/15.2.3.14.json","resources/scripts/testcases/15.2.3.2.json","resources/scripts/testcases/15.2.3.3.json","resources/scripts/testcases/15.2.3.4.json","resources/scripts/testcases/15.2.3.5.json","resources/scripts/testcases/15.2.3.6.json","resources/scripts/testcases/15.2.3.7.json","resources/scripts/testcases/15.2.3.8.json","resources/scripts/testcases/15.2.3.9.json","resources/scripts/testcases/15.2.4.json","resources/scripts/testcases/15.3.json","resources/scripts/testcases/15.4.3.json","resources/scripts/testcases/15.4.4.10.json","resources/scripts/testcases/15.4.4.12.json","resources/scripts/testcases/15.4.4.14.json","resources/scripts/testcases/15.4.4.15.json","resources/scripts/testcases/15.4.4.16.json","resources/scripts/testcases/15.4.4.17.json","resources/scripts/testcases/15.4.4.18.json","resources/scripts/testcases/15.4.4.19.json","resources/scripts/testcases/15.4.4.20.json","resources/scripts/testcases/15.4.4.21.json","resources/scripts/testcases/15.4.4.22.json","resources/scripts/testcases/15.4.4.4.json","resources/scripts/testcases/15.4.5.json","resources/scripts/testcases/15.5.json","resources/scripts/testcases/15.7.json","resources/scripts/testcases/15.9.json"],"version":"0.7.3"} \ No newline at end of file