summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am13
-rw-r--r--tests/libsercomstub.c3
-rw-r--r--tests/sercomm/sercomm_test.c4
3 files changed, 12 insertions, 8 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e199ccce..5dd8e22b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,6 +3,11 @@ AM_CFLAGS = -Wall $(TALLOC_CFLAGS)
AM_LDFLAGS =
LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS)
+if ENABLE_SERCOM_STUB
+noinst_LIBRARIES = libsercomstub.a
+LDADD += $(top_builddir)/tests/libsercomstub.a
+endif
+
check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \
smscb/smscb_test bits/bitrev_test a5/a5_test \
conv/conv_test auth/milenage_test lapd/lapd_test \
@@ -55,10 +60,10 @@ stats_stats_test_SOURCES = stats/stats_test.c
stats_stats_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
a5_a5_test_SOURCES = a5/a5_test.c
-a5_a5_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la
+a5_a5_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c
-kasumi_kasumi_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la
+kasumi_kasumi_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
comp128_comp128_test_SOURCES = comp128/comp128_test.c
comp128_comp128_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la
@@ -84,10 +89,10 @@ bits_bitcomp_test_SOURCES = bits/bitcomp_test.c
bits_bitfield_test_SOURCES = bits/bitfield_test.c
conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c
-conv_conv_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la
+conv_conv_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c
-conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la
+conv_conv_gsm0503_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la
conv_conv_gsm0503_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/conv
gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c
diff --git a/tests/libsercomstub.c b/tests/libsercomstub.c
new file mode 100644
index 00000000..99662d02
--- /dev/null
+++ b/tests/libsercomstub.c
@@ -0,0 +1,3 @@
+/* Stubs for embedded build */
+void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {}
+void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {}
diff --git a/tests/sercomm/sercomm_test.c b/tests/sercomm/sercomm_test.c
index 4a40f627..058c9eb4 100644
--- a/tests/sercomm/sercomm_test.c
+++ b/tests/sercomm/sercomm_test.c
@@ -27,10 +27,6 @@
struct osmo_sercomm_inst g_osi;
-/* Locking details are not checked by this test anyway */
-void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {}
-void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {}
-
static const uint8_t valid_dlci3[] = { 0x7E, 3, 0x03, 'f', 'o', 'o', 0x7E };
static const uint8_t valid_dlci23[] = { 0x7E, 23, 0x03, '2', '3', 0x7E };
static const uint8_t valid_dlci23esc[] = { 0x7E, 23, 0x03, 0x7D, '2' ^ (1 << 5), '3', 0x7E };