summaryrefslogtreecommitdiffstats
path: root/tests/unit/Makefile.am
blob: bd748b7b295ae6e261dbdb29c0d68b90661d3562 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)

if HAVE_CMOCKA
TESTS = $(check_PROGRAMS)

check_PROGRAMS = \
    test_strncpy \
    test_strtcpy \
    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_strncpy_SOURCES = \
    ../../lib/strncpy.c \
    test_strncpy.c \
    $(NULL)
test_strncpy_CFLAGS = \
    $(AM_FLAGS) \
    $(NULL)
test_strncpy_LDFLAGS = \
    $(NULL)
test_strncpy_LDADD = \
    $(CMOCKA_LIBS) \
    $(NULL)

test_strtcpy_SOURCES = \
    ../../lib/strtcpy.c \
    test_strtcpy.c \
    $(NULL)
test_strtcpy_CFLAGS = \
    $(AM_FLAGS) \
    $(NULL)
test_strtcpy_LDFLAGS = \
    $(NULL)
test_strtcpy_LDADD = \
    $(CMOCKA_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