2011-10-05 05:34:19 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
import os
|
2012-02-03 13:32:59 +00:00
|
|
|
import platform
|
|
|
|
import string
|
|
|
|
import subprocess
|
2011-10-05 05:34:19 +00:00
|
|
|
import sys
|
|
|
|
|
2012-03-23 11:52:43 +00:00
|
|
|
import utils
|
|
|
|
|
2011-10-05 05:34:19 +00:00
|
|
|
|
|
|
|
def Main():
|
2012-02-03 13:32:59 +00:00
|
|
|
args = sys.argv[1:]
|
|
|
|
tools_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
current_directory = os.path.abspath('');
|
|
|
|
client = os.path.abspath(os.path.join(tools_dir, '..'));
|
|
|
|
if current_directory == os.path.join(client, 'runtime'):
|
|
|
|
dart_script_name = 'test-runtime.dart'
|
2011-10-11 22:44:53 +00:00
|
|
|
else:
|
2012-02-03 13:32:59 +00:00
|
|
|
dart_script_name = 'test.dart'
|
|
|
|
dart_test_script = string.join([tools_dir, dart_script_name], os.sep)
|
2012-10-11 13:07:16 +00:00
|
|
|
command = [utils.DartBinary(), dart_test_script] + args
|
2012-03-23 11:52:43 +00:00
|
|
|
exit_code = subprocess.call(command)
|
|
|
|
utils.DiagnoseExitCode(exit_code, command)
|
|
|
|
return exit_code
|
|
|
|
|
2011-10-05 05:34:19 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2012-01-09 10:47:03 +00:00
|
|
|
sys.exit(Main())
|