| OLD | NEW |
| 1 # Copyright 2009 the V8 project authors. All rights reserved. | 1 # Copyright 2009 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 out = output.stdout | 50 out = output.stdout |
| 51 return "SputnikError" in out | 51 return "SputnikError" in out |
| 52 | 52 |
| 53 def BeforeRun(self): | 53 def BeforeRun(self): |
| 54 self.tmpfile = sputnik.TempFile(suffix='.js', prefix='sputnik-', text=True) | 54 self.tmpfile = sputnik.TempFile(suffix='.js', prefix='sputnik-', text=True) |
| 55 self.tmpfile.Write(self.GetSource()) | 55 self.tmpfile.Write(self.GetSource()) |
| 56 self.tmpfile.Close() | 56 self.tmpfile.Close() |
| 57 | 57 |
| 58 def AfterRun(self, result): | 58 def AfterRun(self, result): |
| 59 # Dispose the temporary file if everything looks okay. | 59 # Dispose the temporary file if everything looks okay. |
| 60 if not result.HasPreciousOutput(): self.tmpfile.Dispose() | 60 if result is None or not result.HasPreciousOutput(): self.tmpfile.Dispose() |
| 61 self.tmpfile = None | 61 self.tmpfile = None |
| 62 | 62 |
| 63 def GetCommand(self): | 63 def GetCommand(self): |
| 64 result = self.context.GetVmCommand(self, self.mode) | 64 result = self.context.GetVmCommand(self, self.mode) |
| 65 result.append(self.tmpfile.name) | 65 result.append(self.tmpfile.name) |
| 66 return result | 66 return result |
| 67 | 67 |
| 68 def GetLabel(self): | 68 def GetLabel(self): |
| 69 return "%s sputnik %s" % (self.mode, self.GetName()) | 69 return "%s sputnik %s" % (self.mode, self.GetName()) |
| 70 | 70 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 return ['sample', 'sample=shell'] | 104 return ['sample', 'sample=shell'] |
| 105 | 105 |
| 106 def GetTestStatus(self, sections, defs): | 106 def GetTestStatus(self, sections, defs): |
| 107 status_file = join(self.root, 'sputnik.status') | 107 status_file = join(self.root, 'sputnik.status') |
| 108 if exists(status_file): | 108 if exists(status_file): |
| 109 test.ReadConfigurationInto(status_file, sections, defs) | 109 test.ReadConfigurationInto(status_file, sections, defs) |
| 110 | 110 |
| 111 | 111 |
| 112 def GetConfiguration(context, root): | 112 def GetConfiguration(context, root): |
| 113 return SputnikTestConfiguration(context, root) | 113 return SputnikTestConfiguration(context, root) |
| OLD | NEW |