OLD | NEW |
| (Empty) |
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 | |
3 # BSD-style license that can be found in the LICENSE file. | |
4 | |
5 from testing import test_configuration | |
6 import os.path | |
7 | |
8 FROG_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) | |
9 AWAITC_LOCATION = os.path.join(FROG_DIR, 'await', 'awaitc.dart') | |
10 | |
11 class AwaitConfiguration(test_configuration.StandardTestConfiguration): | |
12 """ | |
13 Defines a configuration that runs an await-aware frog compiler on | |
14 each test case. | |
15 """ | |
16 # TODO(sigmund): This configuration should eventually be removed when we have | |
17 # a generic way to run preprocessors in the test infrastructure. | |
18 def __init__(self, context, root, fatal_static_type_errors=False): | |
19 super(AwaitConfiguration, self).__init__(context, root) | |
20 self.fatal_static_type_errors = fatal_static_type_errors | |
21 | |
22 def ListTests(self, current_path, path, mode, arch, component): | |
23 """Uses the default listing of test cases, but modifies the architecture to | |
24 use the await-aware frog compiler.""" | |
25 tests = super(AwaitConfiguration, self).ListTests( | |
26 current_path, path, mode, arch, component) | |
27 for test in tests: | |
28 test.run_arch.vm_options.append(AWAITC_LOCATION) | |
29 return tests | |
30 | |
31 def GetConfiguration(context, root): | |
32 return AwaitConfiguration(context, root) | |
OLD | NEW |