Bug 946618 - Add native tests for cubeb. r=kinetik

--HG--
extra : rebase_source : 9b2e8e702ce5f8ea4d5416f3b45c91bc4cd94432
This commit is contained in:
Paul Adenot 2014-02-25 14:21:59 +01:00
parent 1140f95c5d
commit ba92d7c5b8
6 changed files with 55 additions and 0 deletions

View File

@ -134,6 +134,7 @@ speex_resampler_reset_mem
speex_resampler_strerror
cubeb_destroy
cubeb_init
cubeb_get_backend_id
cubeb_get_max_channel_count
cubeb_get_min_latency
cubeb_get_preferred_sample_rate

View File

@ -5,4 +5,5 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['include', 'src']
TEST_TOOL_DIRS += ['tests']

View File

@ -4,6 +4,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
LIBRARY_NAME = 'cubeb'
SOURCES += [
'cubeb.c',
]

View File

@ -0,0 +1,26 @@
# -*- Mode: makefile; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- #
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
ifeq ($(OS_ARCH),WINNT)
# On windows, the WASAPI backend needs the resampler we have in
# /media/libspeex_resampler, so we can't get away with just linking cubeb's .o
LIBS = $(call EXPAND_LIBNAME_PATH,gkmedias,$(DEPTH)/layout/media) \
$(NULL)
else
# Otherwise, we can just grab all the compiled .o and compile against that,
# linking the appriopriate libraries.
LIBS = $(call EXPAND_LIBNAME_PATH,cubeb,$(DEPTH)/media/libcubeb/src)
ifeq ($(OS_TARGET),Darwin)
LIBS += -framework AudioUnit -framework CoreAudio
else
ifeq ($(OS_TARGET), OpenBSD)
LIBS += -lsndio
else
LIBS += $(MOZ_ALSA_LIBS) \
$(MOZ_PULSEAUDIO_LIBS)
endif
endif
LIBS += $(NULL)
endif

View File

@ -0,0 +1,19 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
CPP_UNIT_TESTS += [
'test_audio.cpp',
'test_latency.cpp',
'test_sanity.cpp',
'test_tone.cpp'
]
LOCAL_INCLUDES += [
'../include'
]
FAIL_ON_WARNINGS = True

View File

@ -18,6 +18,12 @@ cp $1/src/android/sles_definitions.h src/android
cp $1/LICENSE .
cp $1/README .
cp $1/AUTHORS .
cp $1/test/common.h tests/common.h
cp $1/test/test_audio.c tests/test_audio.cpp
cp $1/test/test_tone.c tests/test_tone.cpp
cp $1/test/test_sanity.c tests/test_sanity.cpp
cp $1/test/test_latency.c tests/test_latency.cpp
if [ -d $1/.git ]; then
rev=$(cd $1 && git rev-parse --verify HEAD)
dirty=$(cd $1 && git diff-index --name-only HEAD)