| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 def _ParseException(self, str): | 187 def _ParseException(self, str): |
| 188 # somefile:somelinenumber: someerror[: sometext] | 188 # somefile:somelinenumber: someerror[: sometext] |
| 189 match = re.search('^[^: ]*:[0-9]+: ([^ ]+?)($|: )', str, re.MULTILINE) | 189 match = re.search('^[^: ]*:[0-9]+: ([^ ]+?)($|: )', str, re.MULTILINE) |
| 190 return match.group(1) | 190 return match.group(1) |
| 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 and \ |
| 198 if self._ParseException(output.stdout) != test_record["negative"]: | 198 "type" in test_record["negative"] and \ |
| 199 self._ParseException(output.stdout) != test_record["negative"]["type"]: |
| 199 return True | 200 return True |
| 200 return "FAILED!" in output.stdout | 201 return "FAILED!" in output.stdout |
| 201 | 202 |
| 202 def HasUnexpectedOutput(self, testcase): | 203 def HasUnexpectedOutput(self, testcase): |
| 203 outcome = self.GetOutcome(testcase) | 204 outcome = self.GetOutcome(testcase) |
| 204 if (statusfile.FAIL_SLOPPY in testcase.outcomes and | 205 if (statusfile.FAIL_SLOPPY in testcase.outcomes and |
| 205 "--use-strict" not in testcase.flags): | 206 "--use-strict" not in testcase.flags): |
| 206 return outcome != statusfile.FAIL | 207 return outcome != statusfile.FAIL |
| 207 return not outcome in (testcase.outcomes or [statusfile.PASS]) | 208 return not outcome in (testcase.outcomes or [statusfile.PASS]) |
| 208 | 209 |
| 209 def PrepareSources(self): | 210 def PrepareSources(self): |
| 210 # The archive is created only on swarming. Local checkouts have the | 211 # The archive is created only on swarming. Local checkouts have the |
| 211 # data folder. | 212 # data folder. |
| 212 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): | 213 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): |
| 213 print "Extracting archive..." | 214 print "Extracting archive..." |
| 214 tar = tarfile.open(ARCHIVE) | 215 tar = tarfile.open(ARCHIVE) |
| 215 tar.extractall(path=os.path.dirname(ARCHIVE)) | 216 tar.extractall(path=os.path.dirname(ARCHIVE)) |
| 216 tar.close() | 217 tar.close() |
| 217 | 218 |
| 218 | 219 |
| 219 def GetSuite(name, root): | 220 def GetSuite(name, root): |
| 220 return Test262TestSuite(name, root) | 221 return Test262TestSuite(name, root) |
| OLD | NEW |