| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 # | 3 # |
| 4 # Use of this source code is governed by a BSD-style license | 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 | 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 | 6 # tree. An additional intellectual property rights grant can be found |
| 7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
| 8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
| 9 | 9 |
| 10 """ | 10 """ |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 temp_dir = tempfile.mkdtemp() | 66 temp_dir = tempfile.mkdtemp() |
| 67 else: | 67 else: |
| 68 if not os.path.exists(temp_dir): | 68 if not os.path.exists(temp_dir): |
| 69 os.makedirs(temp_dir) | 69 os.makedirs(temp_dir) |
| 70 | 70 |
| 71 if not build_dir_x86: | 71 if not build_dir_x86: |
| 72 build_dir_x86 = os.path.join(temp_dir, 'LocalBuild') | 72 build_dir_x86 = os.path.join(temp_dir, 'LocalBuild') |
| 73 _RunCommand(['gn', 'gen', build_dir_x86]) | 73 _RunCommand(['gn', 'gen', build_dir_x86]) |
| 74 _RunCommand(['ninja', '-C', build_dir_x86, 'frame_analyzer']) | 74 _RunCommand(['ninja', '-C', build_dir_x86, 'frame_analyzer']) |
| 75 | 75 |
| 76 toolchain_dir = os.path.join(SRC_DIR, 'tools-webrtc', | 76 tools_dir = os.path.join(SRC_DIR, 'tools-webrtc') |
| 77 'video_quality_toolchain') | 77 toolchain_dir = os.path.join(tools_dir, 'video_quality_toolchain') |
| 78 | 78 |
| 79 # Download ffmpeg and zxing. | 79 # Download ffmpeg and zxing. |
| 80 download_script = os.path.join(toolchain_dir, 'download.py') | 80 download_script = os.path.join(tools_dir, 'download_tools.py') |
| 81 _RunCommand([sys.executable, download_script]) | 81 _RunCommand([sys.executable, download_script, toolchain_dir]) |
| 82 | 82 |
| 83 # Run the Espresso code. | 83 # Run the Espresso code. |
| 84 test_script = os.path.join(build_dir_android, | 84 test_script = os.path.join(build_dir_android, |
| 85 'bin', 'run_AppRTCMobileTestStubbedVideoIO') | 85 'bin', 'run_AppRTCMobileTestStubbedVideoIO') |
| 86 _RunCommand([sys.executable, test_script]) | 86 _RunCommand([sys.executable, test_script]) |
| 87 | 87 |
| 88 # Pull the output video. | 88 # Pull the output video. |
| 89 test_video = os.path.join(temp_dir, 'test_video.y4m') | 89 test_video = os.path.join(temp_dir, 'test_video.y4m') |
| 90 _RunCommand(['adb', 'pull', '/sdcard/output.y4m', test_video]) | 90 _RunCommand(['adb', 'pull', '/sdcard/output.y4m', test_video]) |
| 91 | 91 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 '--stats_file_ref', stats_file_ref, | 128 '--stats_file_ref', stats_file_ref, |
| 129 '--stats_file_test', stats_file_test, '--frame_analyzer', frame_analyzer, | 129 '--stats_file_test', stats_file_test, '--frame_analyzer', frame_analyzer, |
| 130 '--ffmpeg_path', ffmpeg_path, '--zxing_path', zxing_path]) | 130 '--ffmpeg_path', ffmpeg_path, '--zxing_path', zxing_path]) |
| 131 | 131 |
| 132 shutil.rmtree(temp_dir) | 132 shutil.rmtree(temp_dir) |
| 133 | 133 |
| 134 | 134 |
| 135 if __name__ == '__main__': | 135 if __name__ == '__main__': |
| 136 sys.exit(main()) | 136 sys.exit(main()) |
| 137 | 137 |
| OLD | NEW |