MB: Add support for isolating scripts + isolate low_bandwidth_audio_test.py.

NOTRY=True

Bug: chromium:755660
Change-Id: I92de99cd1e3dd206f6cd366dbfd1c8c211d37cc7
Reviewed-on: https://webrtc-review.googlesource.com/4420
Commit-Queue: Edward Lemur <ehmaldonado@webrtc.org>
Reviewed-by: Henrik Kjellander <kjellander@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20089}
This commit is contained in:
Edward Lemur 2017-09-28 16:14:37 +02:00 committed by Commit Bot
parent 208b30936f
commit 2011075a58
5 changed files with 72 additions and 12 deletions

2
.gitignore vendored
View File

@ -49,8 +49,10 @@
/tools_webrtc/android/profiling/flamegraph /tools_webrtc/android/profiling/flamegraph
/tools_webrtc/android/profiling/simpleperf /tools_webrtc/android/profiling/simpleperf
/tools_webrtc/audio_quality/linux/pesq /tools_webrtc/audio_quality/linux/pesq
/tools_webrtc/audio_quality/linux/PolqaOem64
/tools_webrtc/audio_quality/mac/pesq /tools_webrtc/audio_quality/mac/pesq
/tools_webrtc/audio_quality/win/*.exe /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/ffmpeg
/tools_webrtc/video_quality_toolchain/linux/zxing /tools_webrtc/video_quality_toolchain/linux/zxing
/tools_webrtc/video_quality_toolchain/mac/ffmpeg /tools_webrtc/video_quality_toolchain/mac/ffmpeg

View File

@ -154,10 +154,28 @@ if (rtc_include_tests) {
} }
data = [ data = [
"../resources/voice_engine/audio_dtx16.wav",
"../resources/voice_engine/audio_tiny16.wav", "../resources/voice_engine/audio_tiny16.wav",
"../resources/voice_engine/audio_tiny48.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) { if (!build_with_chromium && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163) # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)

View File

@ -62,6 +62,14 @@
"--quick", "--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": { "modules_tests": {
"label": "//modules:modules_tests", "label": "//modules:modules_tests",
"type": "console_test_launcher", "type": "console_test_launcher",

View File

@ -833,19 +833,14 @@ class MetaBuildWrapper(object):
runtime_deps_targets = ['browser_tests.exe.runtime_deps'] runtime_deps_targets = ['browser_tests.exe.runtime_deps']
else: else:
runtime_deps_targets = ['browser_tests.runtime_deps'] runtime_deps_targets = ['browser_tests.runtime_deps']
elif (isolate_map[target]['type'] == 'script' or elif isolate_map[target]['type'] == 'script':
isolate_map[target].get('label_type') == 'group'): label = isolate_map[target]['label'].split(':')[1]
# 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']
runtime_deps_targets = [ runtime_deps_targets = [
'obj/%s.stamp.runtime_deps' % label.replace(':', '/')] '%s.runtime_deps' % label]
if self.platform == 'win32': if self.platform == 'win32':
runtime_deps_targets += [ target + '.exe.runtime_deps' ] runtime_deps_targets += [ label + '.exe.runtime_deps' ]
else: else:
runtime_deps_targets += [ target + '.runtime_deps' ] runtime_deps_targets += [ label + '.runtime_deps' ]
elif self.platform == 'win32': elif self.platform == 'win32':
runtime_deps_targets = [target + '.exe.runtime_deps'] runtime_deps_targets = [target + '.exe.runtime_deps']
else: else:
@ -1047,7 +1042,7 @@ class MetaBuildWrapper(object):
output_path=None) output_path=None)
if test_type not in ('console_test_launcher', 'windowed_test_launcher', if test_type not in ('console_test_launcher', 'windowed_test_launcher',
'non_parallel_console_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).' self.WriteFailureAndRaise('No command line for %s found (test type %s).'
% (target, test_type), output_path=None) % (target, test_type), output_path=None)
@ -1063,6 +1058,8 @@ class MetaBuildWrapper(object):
if test_type != 'junit_test': if test_type != 'junit_test':
cmdline += ['--target-devices-file', '${SWARMING_BOT_FILE}'] cmdline += ['--target-devices-file', '${SWARMING_BOT_FILE}']
elif test_type == "script":
cmdline = ['../../' + self.ToSrcRelPath(isolate_map[target]['script'])]
else: else:
extra_files = ['../../testing/test_env.py'] extra_files = ['../../testing/test_env.py']

View File

@ -467,6 +467,41 @@ class UnitTest(unittest.TestCase):
'--tsan=0', '--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): def test_gn_gen_non_parallel_console_test_launcher(self):
test_files = { test_files = {
'/tmp/swarming_targets': 'base_unittests\n', '/tmp/swarming_targets': 'base_unittests\n',