aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Fugate <dfugate@microsoft.com>2011-06-02 15:41:54 -0700
committerDavid Fugate <dfugate@microsoft.com>2011-06-02 15:41:54 -0700
commitc04a994e00e4d26844d67766f4c430a71cc5b649 (patch)
tree22f58fa26a73e55cc25091fb928c8d29e295d3ea /tools
parente3da78c0093e965909664b3eb953e3bcd03be570 (diff)
Added missing license header to TestCasePackager.py. Also, split
this module in two such that the configuration of the test case packaging tool is separate from the implementation.
Diffstat (limited to 'tools')
-rw-r--r--tools/TestCaseHTMLPackager/TestCasePackager.py57
-rw-r--r--tools/TestCaseHTMLPackager/TestCasePackagerConfig.py67
2 files changed, 89 insertions, 35 deletions
diff --git a/tools/TestCaseHTMLPackager/TestCasePackager.py b/tools/TestCaseHTMLPackager/TestCasePackager.py
index ed0dd86e6..6beb678c5 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 000000000..e5019aa2f
--- /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--------------------------------------------------------------------#
+
+
+#------------------------------------------------------------------------------
+