You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #!/usr/bin/env python
  2. # Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
  3. #
  4. # Use of this source code is governed by a BSD-style license
  5. # that can be found in the LICENSE file in the root of the source
  6. # tree. An additional intellectual property rights grant can be found
  7. # in the file PATENTS. All contributing project authors may
  8. # be found in the AUTHORS file in the root of the source tree.
  9. import argparse
  10. import logging
  11. import subprocess
  12. import sys
  13. def main():
  14. parser = argparse.ArgumentParser()
  15. parser.add_argument('--isolated-script-test-output')
  16. parser.add_argument('--isolated-script-test-perf-output')
  17. args, unrecognized_args = parser.parse_known_args()
  18. test_command = _ForcePythonInterpreter(unrecognized_args)
  19. if args.isolated_script_test_output:
  20. test_command += ['--isolated_script_test_output',
  21. args.isolated_script_test_output]
  22. if args.isolated_script_test_perf_output:
  23. test_command += ['--isolated_script_test_perf_output',
  24. args.isolated_script_test_perf_output]
  25. logging.info('Running %r', test_command)
  26. return subprocess.call(test_command)
  27. def _ForcePythonInterpreter(cmd):
  28. """Returns the fixed command line to call the right python executable."""
  29. out = cmd[:]
  30. if out[0] == 'python':
  31. out[0] = sys.executable
  32. elif out[0].endswith('.py'):
  33. out.insert(0, sys.executable)
  34. return out
  35. if __name__ == '__main__':
  36. # pylint: disable=W0101
  37. logging.basicConfig(level=logging.INFO)
  38. sys.exit(main())