kjellander@webrtc.org | c3e097c | 2014-12-03 09:57:08 +0000 | [diff] [blame] | 1 | #!/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 | """ |
| 11 | Runs tests on Android devices. |
| 12 | |
| 13 | This script exists to avoid WebRTC being broken by changes in the Chrome Android |
kjellander@webrtc.org | 7ba9f27 | 2014-12-09 06:46:13 +0000 | [diff] [blame] | 14 | test execution toolchain. It also conveniently sets the CHECKOUT_SOURCE_ROOT |
| 15 | environment variable. |
kjellander@webrtc.org | c3e097c | 2014-12-03 09:57:08 +0000 | [diff] [blame] | 16 | """ |
| 17 | |
| 18 | import os |
| 19 | import sys |
| 20 | |
kjellander@webrtc.org | 7ba9f27 | 2014-12-09 06:46:13 +0000 | [diff] [blame] | 21 | SCRIPT_DIR = os.path.dirname(__file__) |
| 22 | SRC_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir, |
| 23 | os.pardir)) |
| 24 | CHROMIUM_BUILD_ANDROID_DIR = os.path.join(SRC_DIR, 'build', 'android') |
kjellander@webrtc.org | c3e097c | 2014-12-03 09:57:08 +0000 | [diff] [blame] | 25 | sys.path.insert(0, CHROMIUM_BUILD_ANDROID_DIR) |
| 26 | |
| 27 | |
| 28 | import test_runner |
| 29 | from pylib.gtest import gtest_config |
kjellander@webrtc.org | 626c09f | 2014-12-11 11:59:46 +0000 | [diff] [blame] | 30 | from pylib.gtest import setup |
kjellander@webrtc.org | c3e097c | 2014-12-03 09:57:08 +0000 | [diff] [blame] | 31 | |
| 32 | def main(): |
| 33 | # Override the stable test suites with the WebRTC tests. |
| 34 | gtest_config.STABLE_TEST_SUITES = [ |
| 35 | 'audio_decoder_unittests', |
| 36 | 'common_audio_unittests', |
| 37 | 'common_video_unittests', |
| 38 | 'modules_tests', |
| 39 | 'modules_unittests', |
kjellander@webrtc.org | 7572d85 | 2015-03-04 08:47:39 +0000 | [diff] [blame^] | 40 | 'rtc_unittests', |
kjellander@webrtc.org | c3e097c | 2014-12-03 09:57:08 +0000 | [diff] [blame] | 41 | 'system_wrappers_unittests', |
| 42 | 'test_support_unittests', |
| 43 | 'tools_unittests', |
| 44 | 'video_capture_tests', |
| 45 | 'video_engine_tests', |
| 46 | 'video_engine_core_unittests', |
| 47 | 'voice_engine_unittests', |
| 48 | 'webrtc_perf_tests', |
| 49 | ] |
kjellander@webrtc.org | 626c09f | 2014-12-11 11:59:46 +0000 | [diff] [blame] | 50 | gtest_config.EXPERIMENTAL_TEST_SUITES = [] |
| 51 | |
| 52 | # Set our own paths to the .isolate files. |
| 53 | setup.ISOLATE_FILE_PATHS = { |
| 54 | 'audio_decoder_unittests': |
| 55 | 'webrtc/modules/audio_coding/neteq/audio_decoder_unittests.isolate', |
| 56 | 'common_audio_unittests': |
| 57 | 'webrtc/common_audio/common_audio_unittests.isolate', |
| 58 | 'common_video_unittests': |
| 59 | 'webrtc/common_video/common_video_unittests.isolate', |
| 60 | 'modules_tests': 'webrtc/modules/modules_tests.isolate', |
| 61 | 'modules_unittests': 'webrtc/modules/modules_unittests.isolate', |
kjellander@webrtc.org | 7572d85 | 2015-03-04 08:47:39 +0000 | [diff] [blame^] | 62 | 'rtc_unittests': 'webrtc/rtc_unittests.isolate', |
kjellander@webrtc.org | 626c09f | 2014-12-11 11:59:46 +0000 | [diff] [blame] | 63 | 'system_wrappers_unittests': |
andresp@webrtc.org | 86e1e48 | 2015-01-14 09:30:52 +0000 | [diff] [blame] | 64 | 'webrtc/system_wrappers/system_wrappers_unittests.isolate', |
kjellander@webrtc.org | 626c09f | 2014-12-11 11:59:46 +0000 | [diff] [blame] | 65 | 'test_support_unittests': 'webrtc/test/test_support_unittests.isolate', |
| 66 | 'tools_unittests': 'webrtc/tools/tools_unittests.isolate', |
| 67 | 'video_capture_tests': |
| 68 | 'webrtc/modules/video_capture/video_capture_tests.isolate', |
| 69 | 'video_engine_tests': 'webrtc/video_engine_tests.isolate', |
| 70 | 'video_engine_core_unittests': |
| 71 | 'webrtc/video_engine/video_engine_core_unittests.isolate', |
| 72 | 'voice_engine_unittests': |
| 73 | 'webrtc/voice_engine/voice_engine_unittests.isolate', |
| 74 | 'webrtc_perf_tests': 'webrtc/webrtc_perf_tests.isolate', |
| 75 | } |
| 76 | # Override environment variable to make it possible for the scripts to find |
| 77 | # the root directory (our symlinking of the Chromium build toolchain would |
| 78 | # otherwise make them fail to do so). |
kjellander@webrtc.org | 7ba9f27 | 2014-12-09 06:46:13 +0000 | [diff] [blame] | 79 | os.environ['CHECKOUT_SOURCE_ROOT'] = SRC_DIR |
kjellander@webrtc.org | c3e097c | 2014-12-03 09:57:08 +0000 | [diff] [blame] | 80 | return test_runner.main() |
| 81 | |
| 82 | if __name__ == '__main__': |
| 83 | sys.exit(main()) |