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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2
3 import os
4 import platform
5 import string
6 import subprocess
7 import sys
8
9 # Try to guess the host operating system.
10 def GuessOS():
11 id = platform.system()
12 if id == "Linux":
13 return "linux"
14 elif id == "Darwin":
15 return "macos"
16 elif id == "Windows" or id == "Microsoft":
17 # On Windows Vista platform.system() can return "Microsoft" with some
18 # versions of Python, see http://bugs.python.org/issue1082 for details.
19 return "windows"
20 else:
21 return None
22
23 def Main():
24 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
25 tools_dir = os.path.dirname(os.path.realpath(__file__))
26 dart_binary = string.join([tools_dir, 'testing', 'bin', GuessOS(), 'dart'],
27 os.sep)
28 if GuessOS() == "windows":
29 dart_binary = dart_binary + ".exe"
30 dart_test_script = string.join([tools_dir, 'test.dart'], os.sep)
31 command = "%s %s %s" % (dart_binary, dart_test_script, args)
32 return subprocess.call(command, shell=True)
33
34 if __name__ == '__main__':
35 sys.exit(Main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698