OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
5 | 5 |
6 import os | 6 import os |
7 from os.path import join, exists | 7 from os.path import join, exists |
8 import re | 8 import re |
9 | 9 |
10 import test | 10 import test |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 'org.junit.runner.JUnitCore'] + self.classnames | 59 'org.junit.runner.JUnitCore'] + self.classnames |
60 | 60 |
61 def GetName(self): | 61 def GetName(self): |
62 return self.path[-1] | 62 return self.path[-1] |
63 | 63 |
64 | 64 |
65 class JUnitTestConfiguration(test.TestConfiguration): | 65 class JUnitTestConfiguration(test.TestConfiguration): |
66 def __init__(self, context, root): | 66 def __init__(self, context, root): |
67 super(JUnitTestConfiguration, self).__init__(context, root) | 67 super(JUnitTestConfiguration, self).__init__(context, root) |
68 | 68 |
69 def ListTests(self, current_path, path, mode, arch): | 69 def ListTests(self, current_path, path, mode, arch, component): |
70 test_path = current_path + ['junit_tests'] | 70 test_path = current_path + ['junit_tests'] |
71 if not self.Contains(path, test_path): | 71 if not self.Contains(path, test_path): |
72 return [] | 72 return [] |
73 classes = [] | 73 classes = [] |
74 javatests_path = join(join(join(self.root, '..'), '..'), 'javatests') | 74 javatests_path = join(join(join(self.root, '..'), '..'), 'javatests') |
75 javatests_path = os.path.normpath(javatests_path) | 75 javatests_path = os.path.normpath(javatests_path) |
76 for root, dirs, files in os.walk(javatests_path): | 76 for root, dirs, files in os.walk(javatests_path): |
77 if root.endswith('com/google/dart/compiler/vm'): | 77 if root.endswith('com/google/dart/compiler/vm'): |
78 continue | 78 continue |
79 for f in [x for x in files if self.IsTest(x)]: | 79 for f in [x for x in files if self.IsTest(x)]: |
(...skipping 10 matching lines...) Expand all Loading... |
90 return name.endswith('Tests.java') | 90 return name.endswith('Tests.java') |
91 | 91 |
92 def GetTestStatus(self, sections, defs): | 92 def GetTestStatus(self, sections, defs): |
93 status = join(self.root, 'dartc.status') | 93 status = join(self.root, 'dartc.status') |
94 if exists(status): | 94 if exists(status): |
95 test.ReadConfigurationInto(status, sections, defs) | 95 test.ReadConfigurationInto(status, sections, defs) |
96 | 96 |
97 | 97 |
98 def GetConfiguration(context, root): | 98 def GetConfiguration(context, root): |
99 return JUnitTestConfiguration(context, root) | 99 return JUnitTestConfiguration(context, root) |
OLD | NEW |