| 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 import atexit | |
| 6 | |
| 7 from testing import test_configuration | |
| 8 | |
| 9 class FrogTestConfiguration(test_configuration.StandardTestConfiguration): | |
| 10 def __init__(self, context, root): | |
| 11 super(FrogTestConfiguration, self).__init__(context, root) | |
| 12 | |
| 13 def ListExistingTests(self, current_path, path, mode, arch, component, | |
| 14 testsuite): | |
| 15 tests = [] | |
| 16 test_dir = os.path.join(self.root, os.pardir, os.pardir, | |
| 17 os.pardir, 'tests', testsuite, 'src') | |
| 18 for root, unused_dirs, files in os.walk(test_dir): | |
| 19 for f in [x for x in files if self.IsTest(x)]: | |
| 20 if f.endswith('.dart'): | |
| 21 test_path = current_path + [testsuite, f[:-5]] # Remove .dart suffix. | |
| 22 if not self.Contains(path, test_path): | |
| 23 continue | |
| 24 tests.extend(self.CreateTestCases(test_path, path, | |
| 25 os.path.join(root, f), | |
| 26 mode, arch, component)) | |
| 27 return tests | |
| 28 | |
| 29 def ListTests(self, current_path, path, mode, arch, component): | |
| 30 tests = self.ListExistingTests(current_path, path, mode, arch, component, | |
| 31 'language') | |
| 32 tests.extend( | |
| 33 self.ListExistingTests(current_path, path, mode, arch, component, | |
| 34 'corelib')) | |
| 35 atexit.register(lambda: self._Cleanup(tests)) | |
| 36 libdir_option = '--libdir=%s' % os.path.abspath( | |
| 37 os.path.join(self.root, os.pardir, os.pardir, 'lib')) | |
| 38 for test in tests: | |
| 39 test.run_arch.vm_options.append(libdir_option) | |
| 40 if self.context.keep_temporary_files: | |
| 41 test.run_arch.vm_options.append('--keep_files') | |
| 42 return tests | |
| 43 | |
| 44 def GetConfiguration(context, root): | |
| 45 return FrogTestConfiguration(context, root) | |
| OLD | NEW |