diff --git a/.gitignore b/.gitignore index ce0a07a980..6631190ba0 100644 --- a/.gitignore +++ b/.gitignore @@ -49,8 +49,10 @@ /tools_webrtc/android/profiling/flamegraph /tools_webrtc/android/profiling/simpleperf /tools_webrtc/audio_quality/linux/pesq +/tools_webrtc/audio_quality/linux/PolqaOem64 /tools_webrtc/audio_quality/mac/pesq /tools_webrtc/audio_quality/win/*.exe +/tools_webrtc/audio_quality/win/*.dll /tools_webrtc/video_quality_toolchain/linux/ffmpeg /tools_webrtc/video_quality_toolchain/linux/zxing /tools_webrtc/video_quality_toolchain/mac/ffmpeg diff --git a/audio/BUILD.gn b/audio/BUILD.gn index 04dec037c1..6917713dfa 100644 --- a/audio/BUILD.gn +++ b/audio/BUILD.gn @@ -154,10 +154,28 @@ if (rtc_include_tests) { } data = [ + "../resources/voice_engine/audio_dtx16.wav", "../resources/voice_engine/audio_tiny16.wav", "../resources/voice_engine/audio_tiny48.wav", - "../resources/voice_engine/audio_dtx16.wav", + "test/low_bandwidth_audio_test.py", ] + if (is_linux) { + data += [ + "../tools_webrtc/audio_quality/linux/PolqaOem64", + "../tools_webrtc/audio_quality/linux/pesq", + ] + } + if (is_win) { + data += [ + "../tools_webrtc/audio_quality/win/PolqaOem64.dll", + "../tools_webrtc/audio_quality/win/PolqaOem64.exe", + "../tools_webrtc/audio_quality/win/pesq.exe", + "../tools_webrtc/audio_quality/win/vcomp120.dll", + ] + } + if (is_mac) { + data += [ "../tools_webrtc/audio_quality/mac/pesq" ] + } if (!build_with_chromium && is_clang) { # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163) diff --git a/tools_webrtc/mb/gn_isolate_map.pyl b/tools_webrtc/mb/gn_isolate_map.pyl index 09314a9d89..33544bc70e 100644 --- a/tools_webrtc/mb/gn_isolate_map.pyl +++ b/tools_webrtc/mb/gn_isolate_map.pyl @@ -62,6 +62,14 @@ "--quick", ], }, + "low_bandwidth_audio_perf_test": { + "label": "//audio:low_bandwidth_audio_test", + "type": "script", + "script": "//audio/test/low_bandwidth_audio_test.py", + "args": [ + ".", "--remove", + ], + }, "modules_tests": { "label": "//modules:modules_tests", "type": "console_test_launcher", diff --git a/tools_webrtc/mb/mb.py b/tools_webrtc/mb/mb.py index 2cd54f2a76..dcf6a57894 100755 --- a/tools_webrtc/mb/mb.py +++ b/tools_webrtc/mb/mb.py @@ -833,19 +833,14 @@ class MetaBuildWrapper(object): runtime_deps_targets = ['browser_tests.exe.runtime_deps'] else: runtime_deps_targets = ['browser_tests.runtime_deps'] - elif (isolate_map[target]['type'] == 'script' or - isolate_map[target].get('label_type') == 'group'): - # For script targets, the build target is usually a group, - # for which gn generates the runtime_deps next to the stamp file - # for the label, which lives under the obj/ directory, but it may - # also be an executable. - label = isolate_map[target]['label'] + elif isolate_map[target]['type'] == 'script': + label = isolate_map[target]['label'].split(':')[1] runtime_deps_targets = [ - 'obj/%s.stamp.runtime_deps' % label.replace(':', '/')] + '%s.runtime_deps' % label] if self.platform == 'win32': - runtime_deps_targets += [ target + '.exe.runtime_deps' ] + runtime_deps_targets += [ label + '.exe.runtime_deps' ] else: - runtime_deps_targets += [ target + '.runtime_deps' ] + runtime_deps_targets += [ label + '.runtime_deps' ] elif self.platform == 'win32': runtime_deps_targets = [target + '.exe.runtime_deps'] else: @@ -1047,7 +1042,7 @@ class MetaBuildWrapper(object): output_path=None) if test_type not in ('console_test_launcher', 'windowed_test_launcher', 'non_parallel_console_test_launcher', - 'additional_compile_target', 'junit_test'): + 'additional_compile_target', 'junit_test', 'script'): self.WriteFailureAndRaise('No command line for %s found (test type %s).' % (target, test_type), output_path=None) @@ -1063,6 +1058,8 @@ class MetaBuildWrapper(object): if test_type != 'junit_test': cmdline += ['--target-devices-file', '${SWARMING_BOT_FILE}'] + elif test_type == "script": + cmdline = ['../../' + self.ToSrcRelPath(isolate_map[target]['script'])] else: extra_files = ['../../testing/test_env.py'] diff --git a/tools_webrtc/mb/mb_unittest.py b/tools_webrtc/mb/mb_unittest.py index 312fee64ce..e24a01b874 100755 --- a/tools_webrtc/mb/mb_unittest.py +++ b/tools_webrtc/mb/mb_unittest.py @@ -467,6 +467,41 @@ class UnitTest(unittest.TestCase): '--tsan=0', ]) + def test_gn_gen_script(self): + test_files = { + '/tmp/swarming_targets': 'base_unittests_script\n', + '/fake_src/testing/buildbot/gn_isolate_map.pyl': ( + "{'base_unittests_script': {" + " 'label': '//base:base_unittests'," + " 'type': 'script'," + " 'script': '//base/base_unittests_script.py'," + "}}\n" + ), + '/fake_src/out/Default/base_unittests.runtime_deps': ( + "base_unittests\n" + "base_unittests_script.py\n" + ), + } + mbw = self.check(['gen', '-c', 'gn_debug_goma', '//out/Default', + '--swarming-targets-file', '/tmp/swarming_targets', + '--isolate-map-file', + '/fake_src/testing/buildbot/gn_isolate_map.pyl'], + files=test_files, ret=0) + + isolate_file = ( + mbw.files['/fake_src/out/Default/base_unittests_script.isolate']) + isolate_file_contents = ast.literal_eval(isolate_file) + files = isolate_file_contents['variables']['files'] + command = isolate_file_contents['variables']['command'] + + self.assertEqual(files, [ + 'base_unittests', + 'base_unittests_script.py', + ]) + self.assertEqual(command, [ + '../../base/base_unittests_script.py', + ]) + def test_gn_gen_non_parallel_console_test_launcher(self): test_files = { '/tmp/swarming_targets': 'base_unittests\n',