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