OLD | NEW |
---|---|
1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 for dirname, dirs, files in os.walk(current_root): | 74 for dirname, dirs, files in os.walk(current_root): |
75 for dotted in [x for x in dirs if x.startswith(".")]: | 75 for dotted in [x for x in dirs if x.startswith(".")]: |
76 dirs.remove(dotted) | 76 dirs.remove(dotted) |
77 for excluded in EXCLUDED: | 77 for excluded in EXCLUDED: |
78 if excluded in dirs: | 78 if excluded in dirs: |
79 dirs.remove(excluded) | 79 dirs.remove(excluded) |
80 dirs.sort() | 80 dirs.sort() |
81 files.sort() | 81 files.sort() |
82 for filename in files: | 82 for filename in files: |
83 if filename.endswith(".js") and not filename in FRAMEWORK: | 83 if filename.endswith(".js") and not filename in FRAMEWORK: |
84 testname = os.path.join(dirname[len(self.testroot) + 1:], | 84 fullpath = os.path.join(dirname, filename) |
85 filename[:-3]) | 85 relpath = fullpath[len(self.testroot) + 1 : -3] |
86 testname = relpath.replace(os.path.sep, "/") | |
86 case = testcase.TestCase(self, testname) | 87 case = testcase.TestCase(self, testname) |
87 tests.append(case) | 88 tests.append(case) |
88 return tests | 89 return tests |
89 | 90 |
90 def GetFlagsForTestCase(self, testcase, context): | 91 def GetFlagsForTestCase(self, testcase, context): |
91 result = [] | 92 result = [] |
92 result += context.mode_flags | 93 result += context.mode_flags |
93 result += ["--expose-gc"] | 94 result += ["--expose-gc"] |
94 result += [os.path.join(self.root, "mozilla-shell-emulation.js")] | 95 result += [os.path.join(self.root, "mozilla-shell-emulation.js")] |
95 testfilename = testcase.path + ".js" | 96 testfilename = testcase.path + ".js" |
96 testfilepath = testfilename.split(os.path.sep) | 97 testfilepath = testfilename.split("/") |
97 for i in xrange(len(testfilepath)): | 98 for i in xrange(len(testfilepath)): |
98 script = os.path.join(self.testroot, | 99 script = os.path.join(self.testroot, |
99 reduce(os.path.join, testfilepath[:i], ""), | 100 reduce(os.path.join, testfilepath[:i], ""), |
Michael Achenbach
2015/09/17 12:49:19
Fly-by code spottin:
reduce(os.path.join, testfile
| |
100 "shell.js") | 101 "shell.js") |
101 if os.path.exists(script): | 102 if os.path.exists(script): |
102 result.append(script) | 103 result.append(script) |
103 result.append(os.path.join(self.testroot, testfilename)) | 104 result.append(os.path.join(self.testroot, testfilename)) |
104 return testcase.flags + result | 105 return testcase.flags + result |
105 | 106 |
106 def GetSourceForTest(self, testcase): | 107 def GetSourceForTest(self, testcase): |
107 filename = os.path.join(self.testroot, testcase.path + ".js") | 108 filename = os.path.join(self.testroot, testcase.path + ".js") |
108 with open(filename) as f: | 109 with open(filename) as f: |
109 return f.read() | 110 return f.read() |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 shutil.rmtree("mozilla") | 158 shutil.rmtree("mozilla") |
158 with tarfile.open(archive_file, "w:gz") as tar: | 159 with tarfile.open(archive_file, "w:gz") as tar: |
159 tar.add("data") | 160 tar.add("data") |
160 with open(versionfile, "w") as f: | 161 with open(versionfile, "w") as f: |
161 f.write(MOZILLA_VERSION) | 162 f.write(MOZILLA_VERSION) |
162 os.chdir(old_cwd) | 163 os.chdir(old_cwd) |
163 | 164 |
164 | 165 |
165 def GetSuite(name, root): | 166 def GetSuite(name, root): |
166 return MozillaTestSuite(name, root) | 167 return MozillaTestSuite(name, root) |
OLD | NEW |