| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 import tarfile | 32 import tarfile |
| 33 import urllib | 33 import urllib |
| 34 | 34 |
| 35 from testrunner.local import testsuite | 35 from testrunner.local import testsuite |
| 36 from testrunner.objects import testcase | 36 from testrunner.objects import testcase |
| 37 | 37 |
| 38 | 38 |
| 39 TEST_262_ARCHIVE_REVISION = "99aac3bc1cad" # This is the r365 revision. | 39 TEST_262_ARCHIVE_REVISION = "99aac3bc1cad" # This is the r365 revision. |
| 40 TEST_262_ARCHIVE_MD5 = "aadbd720ce9bdb4f8f3de066f4d7eea1" | 40 TEST_262_ARCHIVE_MD5 = "aadbd720ce9bdb4f8f3de066f4d7eea1" |
| 41 TEST_262_URL = "http://hg.ecmascript.org/tests/test262/archive/%s.tar.bz2" | 41 TEST_262_URL = "http://hg.ecmascript.org/tests/test262/archive/%s.tar.bz2" |
| 42 TEST_262_HARNESS = ["sta.js", "testBuiltInObject.js"] | 42 TEST_262_HARNESS = ["sta.js", "testBuiltInObject.js", "testIntl.js"] |
| 43 TEST_262_SKIP = ["intl402"] | |
| 44 | 43 |
| 45 | 44 |
| 46 class Test262TestSuite(testsuite.TestSuite): | 45 class Test262TestSuite(testsuite.TestSuite): |
| 47 | 46 |
| 48 def __init__(self, name, root): | 47 def __init__(self, name, root): |
| 49 super(Test262TestSuite, self).__init__(name, root) | 48 super(Test262TestSuite, self).__init__(name, root) |
| 50 self.testroot = os.path.join(root, "data", "test", "suite") | 49 self.testroot = os.path.join(root, "data", "test", "suite") |
| 51 self.harness = [os.path.join(self.root, "data", "test", "harness", f) | 50 self.harness = [os.path.join(self.root, "data", "test", "harness", f) |
| 52 for f in TEST_262_HARNESS] | 51 for f in TEST_262_HARNESS] |
| 53 self.harness += [os.path.join(self.root, "harness-adapt.js")] | 52 self.harness += [os.path.join(self.root, "harness-adapt.js")] |
| 54 | 53 |
| 55 def CommonTestName(self, testcase): | 54 def CommonTestName(self, testcase): |
| 56 return testcase.path.split(os.path.sep)[-1] | 55 return testcase.path.split(os.path.sep)[-1] |
| 57 | 56 |
| 58 def ListTests(self, context): | 57 def ListTests(self, context): |
| 59 tests = [] | 58 tests = [] |
| 60 for dirname, dirs, files in os.walk(self.testroot): | 59 for dirname, dirs, files in os.walk(self.testroot): |
| 61 for dotted in [x for x in dirs if x.startswith(".")]: | 60 for dotted in [x for x in dirs if x.startswith(".")]: |
| 62 dirs.remove(dotted) | 61 dirs.remove(dotted) |
| 63 for skipped in [x for x in dirs if x in TEST_262_SKIP]: | |
| 64 dirs.remove(skipped) | |
| 65 dirs.sort() | 62 dirs.sort() |
| 66 files.sort() | 63 files.sort() |
| 67 for filename in files: | 64 for filename in files: |
| 68 if filename.endswith(".js"): | 65 if filename.endswith(".js"): |
| 69 testname = os.path.join(dirname[len(self.testroot) + 1:], | 66 testname = os.path.join(dirname[len(self.testroot) + 1:], |
| 70 filename[:-3]) | 67 filename[:-3]) |
| 71 case = testcase.TestCase(self, testname) | 68 case = testcase.TestCase(self, testname) |
| 72 tests.append(case) | 69 tests.append(case) |
| 73 return tests | 70 return tests |
| 74 | 71 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 # Magic incantation to allow longer path names on Windows. | 111 # Magic incantation to allow longer path names on Windows. |
| 115 archive.extractall(u"\\\\?\\%s" % self.root) | 112 archive.extractall(u"\\\\?\\%s" % self.root) |
| 116 else: | 113 else: |
| 117 archive.extractall(self.root) | 114 archive.extractall(self.root) |
| 118 os.rename(os.path.join(self.root, "test262-%s" % revision), | 115 os.rename(os.path.join(self.root, "test262-%s" % revision), |
| 119 directory_name) | 116 directory_name) |
| 120 | 117 |
| 121 | 118 |
| 122 def GetSuite(name, root): | 119 def GetSuite(name, root): |
| 123 return Test262TestSuite(name, root) | 120 return Test262TestSuite(name, root) |
| OLD | NEW |