summaryrefslogtreecommitdiff
path: root/lib/gibber/tests/Makefile.am
blob: cc137228f6df28688b307f266602ef334c02fda2 (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
CLEANFILES=

include $(top_srcdir)/rules/check.mak

SUPPRESSIONS=valgrind.supp dlopen.supp

# Teach it how to make libgibber.la
$(top_builddir)/lib/gibber/libgibber.la:
	${MAKE} -C $(top_builddir)/lib/gibber libgibber.la

.PHONY: $(top_builddir)/lib/gibber/libgibber.la

TESTS = \
	run-xmpp-connection-test.sh

check_PROGRAMS = \
	test-xmpp-connection    \
	test-r-multicast-transport-io

check_SCRIPTS = run-xmpp-connection-test.sh

EXTRA_DIST = simplemeshtest.py mesh.py $(check_SCRIPTS)

test_xmpp_connection_SOURCES = \
    test-xmpp-connection.c     \
    test-transport.c           \
    test-transport.h

test_xmpp_connection_LDADD = \
    $(top_builddir)/lib/gibber/libgibber.la \
    $(AM_LDFLAGS)

test_xmpp_connection_CFLAGS = \
    $(AM_CFLAGS)

test_r_multicast_transport_io_SOURCES = \
    test-r-multicast-transport-io.c     \
    test-transport.c           \
    test-transport.h

test_r_multicast_transport_io_LDADD = \
    $(top_builddir)/lib/gibber/libgibber.la \
    $(AM_LDFLAGS)

test_r_multicast_transport_io_CFLAGS = \
    $(AM_CFLAGS)


if HAVE_CHECK
check_PROGRAMS += check-main
TESTS += check-main
check_main_SOURCES =                             \
    check-main.c                                 \
    check-helpers.c                              \
    check-helpers.h                              \
    check-gibber.h                               \
    check-gibber-xmpp-node.c                     \
    check-gibber-xmpp-reader.c                   \
    check-gibber-r-multicast-causal-transport.c  \
    check-gibber-resolver.c                      \
    test-resolver.c                              \
    test-resolver.h                              \
    test-transport.c                             \
    test-transport.h                             \
    check-gibber-xmpp-connection.c               \
    check-gibber-r-multicast-packet.c            \
    check-gibber-r-multicast-sender.c            \
    check-gibber-xmpp-stanza.c                   \
    check-gibber-iq-helper.c                     \
    check-gibber-listener.c                      \
    check-gibber-xmpp-connection-listener.c      \
    check-gibber-xmpp-error.c

check_main_LDADD = \
    @CHECK_LIBS@ \
    $(top_builddir)/lib/gibber/libgibber.la \
    $(AM_LDFLAGS)

check_main_CFLAGS = \
    @CHECK_CFLAGS@ \
    $(AM_CFLAGS)

if HAVE_LIBSASL2
  check_main_SOURCES += \
      check-gibber-sasl-auth.c   \
      test-sasl-auth-server.c    \
      test-sasl-auth-server.h

  check_main_LDADD += @LIBSASL2_LIBS@
  check_main_CFLAGS += @LIBSASL2_CFLAGS@
endif

endif

AM_CFLAGS = $(ERROR_CFLAGS) @GLIB_CFLAGS@ @LIBXML2_CFLAGS@ @DBUS_CFLAGS@ \
    -I $(top_srcdir) -I $(top_builddir) \
    -I $(top_srcdir)/lib -I $(top_builddir)/lib

AM_LDFLAGS = @GLIB_LIBS@

# Coding style checks
check_c_sources = \
    $(test_xmpp_connection_SOURCES) \
    $(test_r_multicast_transport_io_SOURCES)

if HAVE_CHECK
    check_c_sources += $(check_main_SOURCES)
endif

include $(top_srcdir)/tools/check-coding-style.mk
check-local: check-coding-style

clean-local:
	-rm -rf outputs
	-rm -f sasl-test.db

SUBDIRS = inputs

$(check_SCRIPTS): always-run
	chmod +x $(srcdir)/$@

.PHONY: always-run