summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-02-11 20:59:16 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2018-02-12 01:32:43 +0700
commit35c45f2dc57b7327195622299fc9708bd953dc2e (patch)
tree7e774300edda478474ae932937f4984d4eb1faed
parenta70b22376c49e8dcc122361c6618d2665062c377 (diff)
tests: enable / disable codec tests conditionally
As the libosmogapk actually relies on external libraries for audio coding, we should enable / disable particular codec tests depending on the build configuration. Closes: OS#2926 Change-Id: Ie4711294c43ff88b17431615883abf96d1ae02a6
-rw-r--r--configure.ac12
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/atlocal.in3
-rw-r--r--tests/testsuite.at22
4 files changed, 35 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index 180e380..8eef951 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ AC_CONFIG_FILES([
include/Makefile
include/gsmhr/Makefile
libosmogapk.pc
+ tests/atlocal
tests/Makefile
])
@@ -29,9 +30,9 @@ AC_ARG_ENABLE(gsmhr,
[--disable-gsmhr],
[Disable support for GSM HR codec using reference code]
)],
- [enable_gsmhr=0], [enable_gsmhr=1])
-AM_CONDITIONAL(ENABLE_GSMHR, test "x$enable_gsmhr" = "x1")
-if test "x$enable_gsmhr" = "x1"; then
+ [enable_gsmhr=$enableval], [enable_gsmhr="yes"])
+AM_CONDITIONAL(ENABLE_GSMHR, test "x$enable_gsmhr" = "xyes")
+if test "x$enable_gsmhr" = "xyes"; then
AM_PATH_PYTHON([2.4])
AC_DEFINE(HAVE_LIBGSMHR, 1, [Define to 1 if libgsmhr is available])
fi
@@ -84,6 +85,11 @@ if test "$found_libgsm" = yes; then
fi
AC_SUBST(LIBGSM_LIBS)
+# Conditional codec tests
+AC_SUBST(ENABLE_AMR_EFR_TESTS, [$found_opencore_amrnb])
+AC_SUBST(ENABLE_HR_TESTS, [$enable_gsmhr])
+AC_SUBST(ENABLE_FR_TESTS, [$found_libgsm])
+
# Checks for header files.
AC_CHECK_HEADERS([stdint.h stdlib.h string.h unistd.h])
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cda5c2d..f838fa4 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -72,7 +72,7 @@ EXTRA_DIST += \
ref-files/* \
$(NULL)
-DISTCLEANFILES = atconfig
+DISTCLEANFILES = atconfig atlocal
TESTSUITE = $(srcdir)/testsuite
check-local: atconfig $(TESTSUITE)
diff --git a/tests/atlocal.in b/tests/atlocal.in
new file mode 100644
index 0000000..437897e
--- /dev/null
+++ b/tests/atlocal.in
@@ -0,0 +1,3 @@
+enable_amr_efr_tests='@ENABLE_AMR_EFR_TESTS@'
+enable_hr_tests='@ENABLE_HR_TESTS@'
+enable_fr_tests='@ENABLE_FR_TESTS@'
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 7367bc5..9855f5b 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -25,6 +25,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/amr_efr])
AT_KEYWORDS([amr_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.amr-efr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -35,6 +36,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/gsm])
AT_KEYWORDS([gsm])
+AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.gsm > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -45,6 +47,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/racal_hr])
AT_KEYWORDS([racal_hr])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.racal-hr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -55,6 +58,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/racal_fr])
AT_KEYWORDS([racal_fr])
+AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.racal-fr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -65,6 +69,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/racal_efr])
AT_KEYWORDS([racal_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.racal-efr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -75,6 +80,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/ti_hr])
AT_KEYWORDS([ti_hr])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.ti-hr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -85,6 +91,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/ti_fr])
AT_KEYWORDS([ti_fr])
+AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.ti-fr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -95,6 +102,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/ti_efr])
AT_KEYWORDS([ti_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.ti-efr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -105,6 +113,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/rtp_efr])
AT_KEYWORDS([rtp_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-efr > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -115,6 +124,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/rtp_hr_etsi])
AT_KEYWORDS([rtp_hr_etsi])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-hr-etsi > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -125,6 +135,7 @@ AT_CLEANUP
AT_SETUP([conv/enc/rtp_hr_ietf])
AT_KEYWORDS([rtp_hr_ietf])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-hr-ietf > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -135,6 +146,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/amr_efr])
AT_KEYWORDS([amr_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.amr-efr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -145,6 +157,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/gsm])
AT_KEYWORDS([gsm])
+AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.gsm.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -155,6 +168,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/racal_hr])
AT_KEYWORDS([racal_hr])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.racal-hr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -165,6 +179,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/racal_fr])
AT_KEYWORDS([racal_fr])
+AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.racal-fr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -175,6 +190,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/racal_efr])
AT_KEYWORDS([racal_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.racal-efr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -185,6 +201,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/ti_hr])
AT_KEYWORDS([ti_hr])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.ti-hr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -195,6 +212,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/ti_fr])
AT_KEYWORDS([ti_fr])
+AT_CHECK([test "x$enable_fr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.ti-fr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -205,6 +223,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/ti_efr])
AT_KEYWORDS([ti_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.ti-efr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -215,6 +234,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/rtp_efr])
AT_KEYWORDS([rtp_efr])
+AT_CHECK([test "x$enable_amr_efr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-efr.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -225,6 +245,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/rtp_hr_etsi])
AT_KEYWORDS([rtp_hr_etsi])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-hr-etsi.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \
@@ -235,6 +256,7 @@ AT_CLEANUP
AT_SETUP([conv/dec/rtp_hr_ietf])
AT_KEYWORDS([rtp_hr_ietf])
+AT_CHECK([test "x$enable_hr_tests" = xyes || exit 77])
cat $abs_srcdir/ref-files/hhgttg_part1_5.s16.rtp-hr-ietf.s16 > expout
AT_CHECK([
$abs_top_builddir/src/osmo-gapk \