diff --git a/webrtc/audio/BUILD.gn b/webrtc/audio/BUILD.gn index acd8dfa7e8..a6a22e652c 100644 --- a/webrtc/audio/BUILD.gn +++ b/webrtc/audio/BUILD.gn @@ -7,6 +7,10 @@ # be found in the AUTHORS file in the root of the source tree. import("../webrtc.gni") +if (is_android) { + import("//build/config/android/config.gni") + import("//build/config/android/rules.gni") +} rtc_static_library("audio") { sources = [ @@ -79,4 +83,20 @@ if (rtc_include_tests) { suppressed_configs += [ "//build/config/clang:find_bad_constructs" ] } } + + if (rtc_enable_protobuf) { + rtc_executable("low_bandwidth_audio_test") { + testonly = true + + sources = [ + "test/low_bandwidth_audio_test.cc", + ] + + deps = [] + + if (is_android) { + deps += [ "//testing/android/native_test:native_test_support" ] + } + } + } } diff --git a/webrtc/audio/test/low_bandwidth_audio_test.cc b/webrtc/audio/test/low_bandwidth_audio_test.cc new file mode 100644 index 0000000000..c78e8897a8 --- /dev/null +++ b/webrtc/audio/test/low_bandwidth_audio_test.cc @@ -0,0 +1,16 @@ +/* + * Copyright 2017 The WebRTC Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +// This is a placeholder for the work oprypin@ is doing on a low-bandwidth +// audio test executable. + +int main() { + return 0; +} diff --git a/webrtc/audio/test/low_bandwidth_audio_test.py b/webrtc/audio/test/low_bandwidth_audio_test.py new file mode 100755 index 0000000000..aaba9d2398 --- /dev/null +++ b/webrtc/audio/test/low_bandwidth_audio_test.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +""" +This script is the wrapper that runs the low-bandwidth audio test. + +After running the test, post-process steps for calculating audio quality of the +output files will be performed. +""" + +import argparse +import logging +import os +import subprocess +import sys + + +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +SRC_DIR = os.path.normpath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir, + os.pardir)) + + +def _RunCommand(argv, cwd=SRC_DIR, **kwargs): + logging.info('Running %r', argv) + subprocess.check_call(argv, cwd=cwd, **kwargs) + + +def _ParseArgs(): + parser = argparse.ArgumentParser(description='Run low-bandwidth audio tests.') + parser.add_argument('build_dir', + help='Path to the build directory (e.g. out/Release).') + args = parser.parse_args() + return args + + +def main(): + # pylint: disable=W0101 + logging.basicConfig(level=logging.INFO) + + args = _ParseArgs() + + test_executable = os.path.join(args.build_dir, 'low_bandwidth_audio_test') + if sys.platform == 'win32': + test_executable += '.exe' + + _RunCommand([test_executable]) + + +if __name__ == '__main__': + sys.exit(main())