summaryrefslogtreecommitdiff
path: root/relay/tests/Makefile.am
blob: 1c9f816226f85afe8b9ff3e768ef5771c993287d (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
SUBDIRS = .

AM_CPPFLAGS = $(ATF_CFLAGS) -DUNIT_TEST -I$(top_srcdir)/includes
AM_CPPFLAGS += -DLOCALSTATEDIR='"."'

EXTRA_DIST = Atffile

# for autotools debugging only
info:
	@echo "ATF_CFLAGS=$(ATF_CFLAGS)"
	@echo "ATF_LDFLAGS=$(ATF_LDFLAGS)"
	@echo "ATF_LIBS=$(ATF_LIBS)"

DHCPSRC = ../dhcrelay.c

DHCPLIBS = $(top_builddir)/common/libdhcp.a \
	  $(top_builddir)/omapip/libomapi.a \
	  $(top_builddir)/dst/libdst.a

ATF_TESTS =
if HAVE_ATF

ATF_TESTS += relay_unittests 

relay_unittests_SOURCES = $(DHCPSRC) 
relay_unittests_SOURCES += relay_unittests.c

relay_unittests_LDADD = $(ATF_LDFLAGS)
relay_unittests_LDADD += $(DHCPLIBS)

check: $(ATF_TESTS)
	@if test $(top_srcdir) != ${top_builddir}; then \
		cp $(top_srcdir)/relay/tests/Atffile Atffile; \
	fi
	sh ${top_builddir}/tests/unittest.sh

distclean-local:
	@if test $(top_srcdir) != ${top_builddir}; then \
		rm -f Atffile;
	fi

endif

check_PROGRAMS = $(ATF_TESTS)