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

Side by Side Diff: tools/testing/drt-trampoline.py

Issue 9320037: Support passing DartVM flags via DART_FLAGS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 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 | « tools/testing/dart/test_suite.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
(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 # For now we have to use this trampoline to turn --dart-flags command line
6 # switch into env variable DART_FLAGS. Eventually, DumpRenderTree should
7 # support --dart-flags and this hack may go away.
8 #
9 # Expected invocation: python drt-trampoline.py <path to DRT> <DRT command line>
10
11 import os
12 import subprocess
13 import sys
14
15 DART_FLAGS_PREFIX = '--dart-flags='
16
17 def main(argv):
18 drt_path = argv[1]
19 command_line = argv[2:]
20
21 cmd = [drt_path]
22
23 env = None
24 for arg in command_line:
25 if arg.startswith(DART_FLAGS_PREFIX):
26 env = dict(os.environ.items())
27 env['DART_FLAGS'] = arg[len(DART_FLAGS_PREFIX):]
28 else:
29 cmd.append(arg)
30
31 p = subprocess.Popen(cmd, env=env)
32 p.wait()
33 if p.returncode != 0:
34 raise Exception('Failed to run command. return code=%s' % p.returncode)
35
36
37 if __name__ == '__main__':
38 try:
39 sys.exit(main(sys.argv))
40 except StandardError as e:
41 print 'Fail: ' + str(e)
42 sys.exit(1)
OLDNEW
« no previous file with comments | « tools/testing/dart/test_suite.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698