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

Unified Diff: tools/test_wrapper.py

Issue 9086008: Add python wrapper for test.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 12 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
Index: tools/test_wrapper.py
diff --git a/tools/test_wrapper.py b/tools/test_wrapper.py
new file mode 100755
index 0000000000000000000000000000000000000000..e5da6c033e818a0fd6ed7fbc2ff3bd886eaf222e
--- /dev/null
+++ b/tools/test_wrapper.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+import os
+import platform
+import string
+import subprocess
+import sys
+
+# Try to guess the host operating system.
+def GuessOS():
+ id = platform.system()
+ if id == "Linux":
+ return "linux"
+ elif id == "Darwin":
+ return "macos"
+ elif id == "Windows" or id == "Microsoft":
+ # On Windows Vista platform.system() can return "Microsoft" with some
+ # versions of Python, see http://bugs.python.org/issue1082 for details.
+ return "windows"
+ else:
+ return None
+
+def Main():
+ args = string.join(sys.argv[1:])
Bill Hesse 2012/01/04 15:11:08 This shouldn't be a problem here, but in test.dart
+ tools_dir = os.path.dirname(os.path.realpath(__file__))
+ dart_binary = string.join([tools_dir, 'testing', 'bin', GuessOS(), 'dart'],
+ os.sep)
+ if GuessOS() == "windows":
+ dart_binary = dart_binary + ".exe"
+ dart_test_script = string.join([tools_dir, 'test.dart'], os.sep)
+ command = "%s %s %s" % (dart_binary, dart_test_script, args)
+ return subprocess.call(command, shell=True)
+
+if __name__ == '__main__':
+ sys.exit(Main())

Powered by Google App Engine
This is Rietveld 408576698