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

Unified 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, 11 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
« no previous file with comments | « tools/testing/dart/test_suite.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/testing/drt-trampoline.py
diff --git a/tools/testing/drt-trampoline.py b/tools/testing/drt-trampoline.py
new file mode 100644
index 0000000000000000000000000000000000000000..fec2ab21d375c2acc24b11dc9cb26718f30e13c2
--- /dev/null
+++ b/tools/testing/drt-trampoline.py
@@ -0,0 +1,42 @@
+# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+#
+# For now we have to use this trampoline to turn --dart-flags command line
+# switch into env variable DART_FLAGS. Eventually, DumpRenderTree should
+# support --dart-flags and this hack may go away.
+#
+# Expected invocation: python drt-trampoline.py <path to DRT> <DRT command line>
+
+import os
+import subprocess
+import sys
+
+DART_FLAGS_PREFIX = '--dart-flags='
+
+def main(argv):
+ drt_path = argv[1]
+ command_line = argv[2:]
+
+ cmd = [drt_path]
+
+ env = None
+ for arg in command_line:
+ if arg.startswith(DART_FLAGS_PREFIX):
+ env = dict(os.environ.items())
+ env['DART_FLAGS'] = arg[len(DART_FLAGS_PREFIX):]
+ else:
+ cmd.append(arg)
+
+ p = subprocess.Popen(cmd, env=env)
+ p.wait()
+ if p.returncode != 0:
+ raise Exception('Failed to run command. return code=%s' % p.returncode)
+
+
+if __name__ == '__main__':
+ try:
+ sys.exit(main(sys.argv))
+ except StandardError as e:
+ print 'Fail: ' + str(e)
+ sys.exit(1)
« 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