Files
shadow/tests/unit/Makefile.am
T
Alejandro Colomar 6879f46327 tests/unit/test_strlcpy.c: Test strlcpy_() and STRLCPY()
This test fails now, due to a bug: the return type of strlcpy_() is
size_t, but it should be ssize_t.  The next commit will pass the test,
by fixing the bug.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-11-22 12:55:26 +01:00

66 lines
1.1 KiB
Makefile

AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)
if HAVE_CMOCKA
TESTS = $(check_PROGRAMS)
check_PROGRAMS = \
test_strlcpy \
test_xasprintf
if ENABLE_LOGIND
check_PROGRAMS += \
test_logind
endif # ENABLE_LOGIND
check_PROGRAMS += \
$(NULL)
test_logind_SOURCES = \
../../lib/logind.c \
test_logind.c \
$(NULL)
test_logind_CFLAGS = \
$(AM_CFLAGS) \
-lsystemd \
$(NULL)
test_logind_LDFLAGS = \
-Wl,-wrap,prefix_getpwnam \
-Wl,-wrap,sd_uid_get_sessions \
$(NULL)
test_logind_LDADD = \
$(CMOCKA_LIBS) \
$(LIBSYSTEMD) \
$(NULL)
test_strlcpy_SOURCES = \
../../lib/strlcpy.c \
test_strlcpy.c \
$(NULL)
test_strlcpy_CFLAGS = \
$(AM_FLAGS) \
$(LIBBSD_CFLAGS) \
$(NULL)
test_strlcpy_LDFLAGS = \
$(NULL)
test_strlcpy_LDADD = \
$(CMOCKA_LIBS) \
$(LIBBSD_LIBS) \
$(NULL)
test_xasprintf_SOURCES = \
../../lib/sprintf.c \
test_xasprintf.c \
$(NULL)
test_xasprintf_CFLAGS = \
$(AM_FLAGS) \
$(NULL)
test_xasprintf_LDFLAGS = \
-Wl,-wrap,vasprintf \
-Wl,-wrap,exit \
$(NULL)
test_xasprintf_LDADD = \
$(CMOCKA_LIBS) \
$(NULL)
endif # HAVE_CMOCKA