2
0

test_runner.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/env python
  2. # Copyright 2014 The LibYuv 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. """
  10. Runs tests on Android devices.
  11. This script exists to avoid Libyuv being broken by changes in the Chrome Android
  12. test execution toolchain. It also conveniently sets the CHECKOUT_SOURCE_ROOT
  13. environment variable.
  14. """
  15. import os
  16. import sys
  17. SCRIPT_DIR = os.path.dirname(__file__)
  18. ROOT_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir))
  19. CHROMIUM_BUILD_ANDROID_DIR = os.path.join(ROOT_DIR, 'build', 'android')
  20. sys.path.insert(0, CHROMIUM_BUILD_ANDROID_DIR)
  21. import test_runner # pylint: disable=W0406
  22. def main():
  23. # Override environment variable to make it possible for the scripts to find
  24. # the root directory (our symlinking of the Chromium build toolchain would
  25. # otherwise make them fail to do so).
  26. os.environ['CHECKOUT_SOURCE_ROOT'] = ROOT_DIR
  27. return test_runner.main()
  28. if __name__ == '__main__':
  29. sys.exit(main())