blob: 3772005ba36bc7b0618f5e0527db771f0833e4c9 [file] [log] [blame]
kjellander@webrtc.orgc3e097c2014-12-03 09:57:08 +00001#!/usr/bin/env python
2# Copyright (c) 2014 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
10"""
11Runs tests on Android devices.
12
13This script exists to avoid WebRTC being broken by changes in the Chrome Android
kjellander@webrtc.org7ba9f272014-12-09 06:46:13 +000014test execution toolchain. It also conveniently sets the CHECKOUT_SOURCE_ROOT
15environment variable.
kjellander@webrtc.orgc3e097c2014-12-03 09:57:08 +000016"""
17
18import os
19import sys
20
kjellander@webrtc.org7ba9f272014-12-09 06:46:13 +000021SCRIPT_DIR = os.path.dirname(__file__)
22SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir,
23 os.pardir))
24CHROMIUM_BUILD_ANDROID_DIR = os.path.join(SRC_DIR, 'build', 'android')
kjellander@webrtc.orgc3e097c2014-12-03 09:57:08 +000025sys.path.insert(0, CHROMIUM_BUILD_ANDROID_DIR)
26
27
Henrik Kjellander57e5fd22015-05-25 12:55:39 +020028import test_runner # pylint: disable=W0406
Henrik Kjellandereecbab72015-09-16 19:19:04 +020029from pylib.gtest import gtest_test_instance
kjellander@webrtc.orgc3e097c2014-12-03 09:57:08 +000030
31def main():
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000032 # Set our own paths to the .isolate files.
Henrik Kjellandereecbab72015-09-16 19:19:04 +020033 # pylint: disable=protected-access
34 gtest_test_instance._DEFAULT_ISOLATE_FILE_PATHS.update({
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000035 'audio_decoder_unittests':
Henrik Kjellanderd6d27e72015-09-25 22:19:11 +020036 'webrtc/modules/audio_decoder_unittests.isolate',
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000037 'common_audio_unittests':
38 'webrtc/common_audio/common_audio_unittests.isolate',
39 'common_video_unittests':
40 'webrtc/common_video/common_video_unittests.isolate',
perkj8a2c31d2016-01-19 06:20:00 -080041 'peerconnection_unittests':
42 'talk/peerconnection_unittests.isolate',
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000043 'modules_tests': 'webrtc/modules/modules_tests.isolate',
44 'modules_unittests': 'webrtc/modules/modules_unittests.isolate',
kjellander@webrtc.org7572d852015-03-04 08:47:39 +000045 'rtc_unittests': 'webrtc/rtc_unittests.isolate',
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000046 'system_wrappers_unittests':
andresp@webrtc.org86e1e482015-01-14 09:30:52 +000047 'webrtc/system_wrappers/system_wrappers_unittests.isolate',
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000048 'test_support_unittests': 'webrtc/test/test_support_unittests.isolate',
49 'tools_unittests': 'webrtc/tools/tools_unittests.isolate',
50 'video_capture_tests':
51 'webrtc/modules/video_capture/video_capture_tests.isolate',
52 'video_engine_tests': 'webrtc/video_engine_tests.isolate',
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000053 'voice_engine_unittests':
54 'webrtc/voice_engine/voice_engine_unittests.isolate',
Peter Boström4f4f7562015-10-29 15:29:04 +010055 'webrtc_nonparallel_tests': 'webrtc/webrtc_nonparallel_tests.isolate',
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000056 'webrtc_perf_tests': 'webrtc/webrtc_perf_tests.isolate',
Henrik Kjellandereecbab72015-09-16 19:19:04 +020057 })
kjellander@webrtc.org626c09f2014-12-11 11:59:46 +000058 # Override environment variable to make it possible for the scripts to find
59 # the root directory (our symlinking of the Chromium build toolchain would
60 # otherwise make them fail to do so).
kjellander@webrtc.org7ba9f272014-12-09 06:46:13 +000061 os.environ['CHECKOUT_SOURCE_ROOT'] = SRC_DIR
kjellander@webrtc.orgc3e097c2014-12-03 09:57:08 +000062 return test_runner.main()
63
64if __name__ == '__main__':
65 sys.exit(main())