OLD | NEW |
1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 # for details. All rights reserved. Use of this source code is governed by a | 2 # for details. All rights reserved. Use of this source code is governed by a |
3 # BSD-style license that can be found in the LICENSE file. | 3 # BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import re | 6 import re |
7 import shutil | 7 import shutil |
8 import sys | 8 import sys |
9 import tempfile | 9 import tempfile |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 def GetStubs(self): | 32 def GetStubs(self): |
33 source = self.GetSource() | 33 source = self.GetSource() |
34 stub_classes = utils.ParseTestOptions(test.ISOLATE_STUB_PATTERN, source, | 34 stub_classes = utils.ParseTestOptions(test.ISOLATE_STUB_PATTERN, source, |
35 self.context.workspace) | 35 self.context.workspace) |
36 if stub_classes is None: | 36 if stub_classes is None: |
37 return (None, None, None) | 37 return (None, None, None) |
38 (interface, _, classes) = stub_classes[0].partition(':') | 38 (interface, _, classes) = stub_classes[0].partition(':') |
39 (interface, _, implementation) = interface.partition('+') | 39 (interface, _, implementation) = interface.partition('+') |
40 return (interface, classes, implementation) | 40 return (interface, classes, implementation) |
41 | 41 |
| 42 def IsFailureOutput(self, output): |
| 43 return output.exit_code != 0 or not '##DONE##' in output.stdout |
| 44 |
42 def BeforeRun(self): | 45 def BeforeRun(self): |
43 if not self.context.generate: | 46 if not self.context.generate: |
44 return | 47 return |
45 (interface, classes, _) = self.GetStubs() | 48 (interface, classes, _) = self.GetStubs() |
46 if interface is None: | 49 if interface is None: |
47 return | 50 return |
48 d = join(self.GetPath(), 'generated') | 51 d = join(self.GetPath(), 'generated') |
49 if not isdir(d): | 52 if not isdir(d): |
50 os.mkdir(d) | 53 os.mkdir(d) |
51 tmpdir = tempfile.mkdtemp() | 54 tmpdir = tempfile.mkdtemp() |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 test_path, | 129 test_path, |
127 join(root, f), | 130 join(root, f), |
128 mode, | 131 mode, |
129 arch, | 132 arch, |
130 component)) | 133 component)) |
131 return tests | 134 return tests |
132 | 135 |
133 | 136 |
134 def GetConfiguration(context, root): | 137 def GetConfiguration(context, root): |
135 return DartStubTestConfiguration(context, root) | 138 return DartStubTestConfiguration(context, root) |
OLD | NEW |