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 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():
|
2019-08-05 20:34:31 +00:00
|
|
|
args = sys.argv[1:]
|
2019-06-14 23:35:10 +00:00
|
|
|
|
2019-08-05 20:34:31 +00:00
|
|
|
tools_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
repo_dir = os.path.dirname(tools_dir)
|
|
|
|
dart_test_script = os.path.join(repo_dir, 'pkg', 'test_runner', 'bin',
|
|
|
|
'test_runner.dart')
|
|
|
|
command = [utils.CheckedInSdkExecutable(), dart_test_script] + args
|
2016-05-02 12:01:44 +00:00
|
|
|
|
2019-08-05 20:34:31 +00:00
|
|
|
# The testing script potentially needs the android platform tools in PATH so
|
|
|
|
# we do that in ./tools/test.py (a similar logic exists in ./tools/build.py).
|
|
|
|
android_platform_tools = os.path.normpath(
|
|
|
|
os.path.join(tools_dir,
|
|
|
|
'../third_party/android_tools/sdk/platform-tools'))
|
|
|
|
if os.path.isdir(android_platform_tools):
|
|
|
|
os.environ['PATH'] = '%s%s%s' % (os.environ['PATH'], os.pathsep,
|
|
|
|
android_platform_tools)
|
2016-05-02 12:01:44 +00:00
|
|
|
|
2019-08-05 20:34:31 +00:00
|
|
|
with utils.FileDescriptorLimitIncreaser():
|
|
|
|
with utils.CoreDumpArchiver(args):
|
|
|
|
exit_code = subprocess.call(command)
|
2017-01-19 16:25:39 +00:00
|
|
|
|
2019-08-05 20:34:31 +00:00
|
|
|
utils.DiagnoseExitCode(exit_code, command)
|
|
|
|
return exit_code
|
2012-03-23 11:52:43 +00:00
|
|
|
|
2011-10-05 05:34:19 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2019-08-05 20:34:31 +00:00
|
|
|
sys.exit(Main())
|