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

Unified Diff: tools/utils.py

Issue 8226016: Add the ability to run tests with several sets of VM flags (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Removed code in comments 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 side-by-side diff with in-line comments
Download patch
« tools/testing/test_configuration.py ('K') | « tools/testing/test_configuration.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/utils.py
diff --git a/tools/utils.py b/tools/utils.py
index 0917aa4f43a30a688dbdf9688e6aa9f177965a62..dde9ae8ada1634dfaddc9c03f108c423034b2d00 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -144,22 +144,35 @@ def GetBuildRoot(target_os, mode=None, arch=None):
return BUILD_ROOT[target_os]
+def RewritePathSeparator(path, workspace):
+ # Paths in test files are always specified using '/'
+ # as the path separator. Replace with the actual
+ # path separator before use.
+ if ('/' in path):
+ split_path = path.split('/')
+ path = os.sep.join(split_path)
+ path = os.path.join(workspace, path)
+ if not os.path.exists(path):
+ raise Exception(path)
+ return path
+
+
def ParseTestOptions(pattern, source, workspace):
match = pattern.search(source)
- # Options should be a single line in the test case no splits.
if match:
- def rewrite(path, workspace):
- # Paths in test files are always specified using '/'
- # as the path separator. Replace with the actual
- # path separator before use.
- if ('/' in path):
- split_path = path.split('/')
- path = os.sep.join(split_path)
- path = os.path.join(workspace, path)
- if not os.path.exists(path):
- raise Exception(path)
- return path
- return [rewrite(o, workspace) for o in match.group(1).split(' ')]
+ return [RewritePathSeparator(o, workspace) for o in match.group(1).split(' ')]
+ else:
+ return None
+
+
+def ParseTestOptionsMultiple(pattern, source, workspace):
+ matches = pattern.findall(source)
+ if matches:
+ result = []
+ for match in matches:
+ result.append(
+ [RewritePathSeparator(o, workspace) for o in match.split(' ')]);
+ return result
else:
return None
« tools/testing/test_configuration.py ('K') | « tools/testing/test_configuration.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698