summaryrefslogtreecommitdiffstats
path: root/vnet/Makefile.am
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2016-04-07 10:04:34 +0200
committerGerrit Code Review <gerrit@fd.io>2016-04-12 11:47:39 +0000
commit254b036dff8ac1ffc663788766de999a2837dc7e (patch)
tree8bb19e5a1d3503cc4c13803c99cd43dc52a8cb22 /vnet/Makefile.am
parent42f2006975c5a0ea58c835df4461213072f8813f (diff)
Add unit test infrastructure for LISP protocol
Change-Id: I802700ad832de1dc6f4a1981e8985aa6e926c8ad Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'vnet/Makefile.am')
-rw-r--r--vnet/Makefile.am44
1 files changed, 44 insertions, 0 deletions
diff --git a/vnet/Makefile.am b/vnet/Makefile.am
index 52b5a6d0779..3d9bae7435d 100644
--- a/vnet/Makefile.am
+++ b/vnet/Makefile.am
@@ -19,6 +19,7 @@ libvnet_la_SOURCES =
libvnetplugin_la_SOURCES =
nobase_include_HEADERS =
noinst_PROGRAMS =
+TESTS =
########################################
# Generic stuff
@@ -443,6 +444,34 @@ nobase_include_HEADERS += \
vnet/lisp-cp/lisp_msg_serdes.h \
vnet/lisp-cp/control.h
+
+if ENABLE_TESTS
+LDS = -lvppinfra -l:libvlib.a -l:libdpdk.a -l:libvlibmemory.a \
+ -l:libvlibapi.a -l:libsvm.a -lpthread -ldl -lrt -lm -l:libvlib_unix.a
+
+TESTS += test_cp_serdes test_lisp_types
+
+test_cp_serdes_SOURCES = \
+ test/lisp-cp/test_cp_serdes.c \
+ vnet/lisp-cp/lisp_msg_serdes.c \
+ vnet/lisp-cp/lisp_types.c \
+ vnet/lisp-cp/packets.c \
+ vnet/ip/ip_checksum.c
+
+test_lisp_types_SOURCES = \
+ test/lisp-cp/test_lisp_types.c \
+ vnet/lisp-cp/lisp_types.c
+
+test_cp_serdes_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
+test_lisp_types_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
+
+test_cp_serdes_LDADD = libvnet.la $(LDS)
+test_lisp_types_LDADD = libvnet.la $(LDS)
+
+test_cp_serdes_LDFLAGS = -static
+test_lisp_types_LDFLAGS = -static
+endif
+
########################################
# Tunnel protocol: lisp-gpe
########################################
@@ -457,6 +486,19 @@ nobase_include_HEADERS += \
vnet/lisp-gpe/lisp_gpe_packet.h \
vnet/lisp-gpe/lisp_gpe_error.def
+if ENABLE_TESTS
+TESTS += test_test
+
+test_test_SOURCES = test/lisp-gpe/test.c
+
+test_test_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
+
+test_test_LDADD = $(LIBOBJS)
+
+noinst_PROGRAMS += $(TESTS)
+check_PROGRAMS = $(TESTS)
+endif
+
########################################
# DHCP client
########################################
@@ -685,3 +727,5 @@ pcap2pg_LDFLAGS = -static
pcap2pg_LDADD = libvnet.la -l:libvppinfra.a -lpthread -lm -ldl
noinst_PROGRAMS += pcap2pg
+
+