Chromium Code Reviews| OLD | NEW |
|---|---|
| (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()) | |
| OLD | NEW |