aboutsummaryrefslogtreecommitdiffstats
path: root/vnet/Makefile.am
diff options
context:
space:
mode:
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
+
+