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 10 matching lines...) Expand all Loading... |
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 | 28 |
29 import imp | 29 import imp |
30 import os | 30 import os |
| 31 import re |
31 import sys | 32 import sys |
32 import tarfile | 33 import tarfile |
33 | 34 |
34 | 35 |
35 from testrunner.local import statusfile | 36 from testrunner.local import statusfile |
36 from testrunner.local import testsuite | 37 from testrunner.local import testsuite |
37 from testrunner.local import utils | 38 from testrunner.local import utils |
38 from testrunner.objects import testcase | 39 from testrunner.objects import testcase |
39 | 40 |
40 DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data") | 41 DATA = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data") |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 else: | 178 else: |
178 includes = [] | 179 includes = [] |
179 return includes | 180 return includes |
180 | 181 |
181 def GetSourceForTest(self, testcase): | 182 def GetSourceForTest(self, testcase): |
182 filename = os.path.join(self.testroot, testcase.path + ".js") | 183 filename = os.path.join(self.testroot, testcase.path + ".js") |
183 with open(filename) as f: | 184 with open(filename) as f: |
184 return f.read() | 185 return f.read() |
185 | 186 |
186 def _ParseException(self, str): | 187 def _ParseException(self, str): |
187 for line in str.split("\n")[::-1]: | 188 # somefile:somelinenumber: someerror[: sometext] |
188 if line and not line[0].isspace() and ":" in line: | 189 match = re.search('^[^: ]*:[0-9]+: ([^ ]+?)($|: )', str, re.MULTILINE) |
189 return line.split(":")[0] | 190 return match.group(1) |
190 | |
191 | 191 |
192 def IsFailureOutput(self, testcase): | 192 def IsFailureOutput(self, testcase): |
193 output = testcase.output | 193 output = testcase.output |
194 test_record = self.GetTestRecord(testcase) | 194 test_record = self.GetTestRecord(testcase) |
195 if output.exit_code != 0: | 195 if output.exit_code != 0: |
196 return True | 196 return True |
197 if "negative" in test_record: | 197 if "negative" in test_record: |
198 if self._ParseException(output.stdout) != test_record["negative"]: | 198 if self._ParseException(output.stdout) != test_record["negative"]: |
199 return True | 199 return True |
200 return "FAILED!" in output.stdout | 200 return "FAILED!" in output.stdout |
(...skipping 10 matching lines...) Expand all Loading... |
211 # data folder. | 211 # data folder. |
212 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): | 212 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): |
213 print "Extracting archive..." | 213 print "Extracting archive..." |
214 tar = tarfile.open(ARCHIVE) | 214 tar = tarfile.open(ARCHIVE) |
215 tar.extractall(path=os.path.dirname(ARCHIVE)) | 215 tar.extractall(path=os.path.dirname(ARCHIVE)) |
216 tar.close() | 216 tar.close() |
217 | 217 |
218 | 218 |
219 def GetSuite(name, root): | 219 def GetSuite(name, root): |
220 return Test262TestSuite(name, root) | 220 return Test262TestSuite(name, root) |
OLD | NEW |