Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: tests/stub-generator/testcfg.py

Issue 8361035: Don't use the old generated files. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/stub-generator/src/MintMakerFullyIsolatedTest-generatedTest.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 class DartStubTestConfiguration(test_configuration.StandardTestConfiguration): 81 class DartStubTestConfiguration(test_configuration.StandardTestConfiguration):
82 def __init__(self, context, root): 82 def __init__(self, context, root):
83 super(DartStubTestConfiguration, self).__init__(context, root) 83 super(DartStubTestConfiguration, self).__init__(context, root)
84 84
85 def ListTests(self, current_path, path, mode, arch): 85 def ListTests(self, current_path, path, mode, arch):
86 dartc = self.context.GetDartC(mode, 'dartc') 86 dartc = self.context.GetDartC(mode, 'dartc')
87 self.context.generate = os.access(dartc[0], os.X_OK) 87 self.context.generate = os.access(dartc[0], os.X_OK)
88 tests = [] 88 tests = []
89 for root, dirs, files in os.walk(join(self.root, 'src')): 89 for root, dirs, files in os.walk(join(self.root, 'src')):
90 # Skip remnants from the subdirectory that used to be used for
91 # generated code.
92 if root.endswith('generated'):
93 continue
90 for f in [x for x in files if self.IsTest(x)]: 94 for f in [x for x in files if self.IsTest(x)]:
91 # If we can generate code, do not use the checked-in generated 95 # If we can generate code, do not use the checked-in generated
92 # code. Conversely, if we cannot, then only use the 96 # code. Conversely, if we cannot, then only use the
93 # checked-in generated code. 97 # checked-in generated code.
94 if self.context.generate == f.endswith('-generatedTest.dart'): 98 if self.context.generate == f.endswith('-generatedTest.dart'):
95 continue 99 continue
96 test_path = current_path + [ f[:-5] ] # Remove .dart suffix. 100 test_path = current_path + [ f[:-5] ] # Remove .dart suffix.
97 if not self.Contains(path, test_path): 101 if not self.Contains(path, test_path):
98 continue 102 continue
99 tests.append(DartStubTestCase(self.context, 103 tests.append(DartStubTestCase(self.context,
100 test_path, 104 test_path,
101 join(root, f), 105 join(root, f),
102 mode, 106 mode,
103 arch)) 107 arch))
104 return tests 108 return tests
105 109
106 110
107 def GetConfiguration(context, root): 111 def GetConfiguration(context, root):
108 return DartStubTestConfiguration(context, root) 112 return DartStubTestConfiguration(context, root)
OLDNEW
« no previous file with comments | « tests/stub-generator/src/MintMakerFullyIsolatedTest-generatedTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698