Files
ModemManager/src/tests/Makefile.am
T
Aleksander Morgado 03fce4775e kerneldevice,generic: input pattern to string match is not regex
The input pattern given to the string_match() method is not a regex
pattern and we cannot use it as that, because all the special
characters (e.g. '.') would not be treated correctly.

Also, the prefix matching with the wildcard at the end of the string
needs to be converted to a proper regex wildcard, i.e. '.*'.

This logic also adds support for suffix matching, with a wildcard at
the beginning of the string, e.g. as the ones used for the wwan kernel
device name matching rules (i.e. '*MBIM').

Unit tests are added to cover all cases, most of these tests were
failing without the fixes implemented here.
2021-11-09 10:50:26 +01:00

69 lines
1.5 KiB
Makefile

include $(top_srcdir)/gtester.make
################################################################################
# common
################################################################################
AM_CFLAGS = \
$(WARN_CFLAGS) \
$(MM_CFLAGS) \
$(CODE_COVERAGE_CFLAGS) \
-I$(top_srcdir) \
-I$(top_srcdir)/include \
-I$(top_builddir)/include \
-I$(top_srcdir)/libqcdm/src \
-I$(top_srcdir)/libmm-glib \
-I${top_builddir}/libmm-glib/generated \
-I${top_srcdir}/src/ \
-I${top_builddir}/src/ \
-I${top_srcdir}/src/kerneldevice \
-DTESTUDEVRULESDIR=\"${top_srcdir}/src/\" \
$(NULL)
LDADD = \
$(top_builddir)/src/libhelpers.la \
$(top_builddir)/src/libport.la \
$(top_builddir)/src/libkerneldevice.la \
$(NULL)
AM_LDFLAGS = \
$(WARN_LDFLAGS) \
$(MM_LIBS) \
$(CODE_COVERAGE_LDFLAGS) \
-lutil \
$(NULL)
if WITH_QMI
AM_CFLAGS += $(QMI_CFLAGS)
AM_LDFLAGS += $(QMI_LIBS)
endif
if WITH_MBIM
AM_CFLAGS += $(MBIM_CFLAGS)
AM_LDFLAGS += $(MBIM_LIBS)
endif
################################################################################
# tests
# note: we abuse AM_LDFLAGS to include the libraries being tested
################################################################################
noinst_PROGRAMS = \
test-modem-helpers \
test-charsets \
test-qcdm-serial-port \
test-at-serial-port \
test-sms-part-3gpp \
test-sms-part-cdma \
test-udev-rules \
test-error-helpers \
test-kernel-device-helpers \
$(NULL)
if WITH_QMI
noinst_PROGRAMS += test-modem-helpers-qmi
endif
TEST_PROGS += $(noinst_PROGRAMS)