summaryrefslogtreecommitdiffstats
path: root/src/vcl/vcl_test.h
AgeCommit message (Collapse)AuthorFilesLines
2018-10-16vcl: fix bidirectional tests (VPP-1455)Florin Coras1-1/+1
- add epoll dequeued events beyond maxevents to unhandled - filter multiple epoll rx events Change-Id: I618f5f02b19581473de891b3b59bb6a0faad10b5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-10-07vcl: cleanup and fixes for vcl test codeFlorin Coras1-56/+360
- better approximate time when test finishes - move common vcl and sock test code to vcl_test.h - overall refactor of variable names Change-Id: I8e6b43fc017cd05a0ddaa3891767a44fb300c09e Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-20session/svm: add want_tx_event flag to fifoFlorin Coras1-7/+2
Have applications use explicit flag to request events from vpp when it transmits from a full fifo. Change-Id: I687c8f050a066bd5ce739d880eaec1f286038d95 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-12vcl: add apis that expos fifo as bufferFlorin Coras1-5/+37
Change-Id: I4bd9c9f73499711e04b38d53daa5c917a4285bf5 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-09-07vcl: refactor test client to support workersFlorin Coras1-0/+23
Change-Id: I7fcfddc2bc7d9a64f8aa0d57ba5d11d325a15ce1 Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-07-27vcl: use events for epoll/select/read/writeFlorin Coras1-5/+0
Have vcl poll and wait on the event message queues as opposed to constantly polling the session fifos. This also adds event signaling to cut through sessions. On the downside, because we can't wait on multiple condvars, i.e., when we have multiple message queues because of cut-through registrations, we do timed waits. Change-Id: I29ade95dba449659fe46008bb1af502276a7c5fd Signed-off-by: Florin Coras <fcoras@cisco.com>
2018-06-25VCL: Refactor VCL test (part 1)Dave Wallace1-0/+127
Change-Id: I6a326e24ed953b1cef63bd4010a3bedd6c4a7b1c Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
# Copyright (c) 2015 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

lib_LTLIBRARIES += libvppinfra.la

TESTS = 

if ENABLE_TESTS
TESTS  +=  test_bihash_template \
           test_bihash_vec88 \
	   test_cuckoo_bihash \
	   test_cuckoo_template\
	   test_dlist \
	   test_elf \
	   test_elog \
	   test_fifo \
	   test_flowhash_template \
	   test_format \
	   test_fpool \
	   test_hash \
	   test_heap \
	   test_longjmp \
	   test_macros \
	   test_maplog \
	   test_mheap \
	   test_pool_iterate \
	   test_ptclosure \
	   test_random \
	   test_random_isaac \
	   test_serialize \
	   test_slist \
	   test_socket \
	   test_time \
	   test_time_range \
	   test_timing_wheel \
	   test_tw_timer \
	   test_valloc \
	   test_vec \
	   test_zvec
endif

noinst_PROGRAMS = $(TESTS)
check_PROGRAMS	= $(TESTS)

test_bihash_template_SOURCES = vppinfra/test_bihash_template.c
test_bihash_vec88_SOURCES = vppinfra/test_bihash_vec88.c
test_cuckoo_template_SOURCES = vppinfra/test_cuckoo_template.c
test_cuckoo_bihash_SOURCES = vppinfra/test_cuckoo_bihash.c
test_dlist_SOURCES = vppinfra/test_dlist.c
test_elf_SOURCES = vppinfra/test_elf.c
test_elog_SOURCES = vppinfra/test_elog.c
test_fifo_SOURCES = vppinfra/test_fifo.c
test_flowhash_template_SOURCES = vppinfra/test_flowhash_template.c
test_format_SOURCES = vppinfra/test_format.c
test_fpool_SOURCES = vppinfra/test_fpool.c
test_hash_SOURCES = vppinfra/test_hash.c
test_heap_SOURCES = vppinfra/test_heap.c
test_longjmp_SOURCES = vppinfra/test_longjmp.c
test_macros_SOURCES = vppinfra/test_macros.c
test_maplog_SOURCES = vppinfra/test_maplog.c
test_mheap_SOURCES = vppinfra/test_mheap.c
test_pool_iterate_SOURCES = vppinfra/test_pool_iterate.c
test_ptclosure_SOURCES = vppinfra/test_ptclosure.c
test_random_isaac_SOURCES = vppinfra/test_random_isaac.c
test_random_SOURCES = vppinfra/test_random.c
test_serialize_SOURCES = vppinfra/test_serialize.c
test_slist_SOURCES = vppinfra/test_slist.c
test_socket_SOURCES = vppinfra/test_socket.c
test_time_SOURCES = vppinfra/test_time.c
test_time_range_SOURCES = vppinfra/test_time_range.c
test_timing_wheel_SOURCES = vppinfra/test_timing_wheel.c
test_tw_timer_SOURCES = vppinfra/test_tw_timer.c
test_valloc_SOURCES = vppinfra/test_valloc.c
test_vec_SOURCES = vppinfra/test_vec.c
test_zvec_SOURCES = vppinfra/test_zvec.c

# All unit tests use ASSERT for failure
# So we'll need -DDEBUG to enable ASSERTs
test_bihash_template_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_bihash_vec88_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_cuckoo_template_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_cuckoo_bihash_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_dlist_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_elf_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_elog_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_fifo_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_flowhash_template_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
test_format_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_fpool_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_hash_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_heap_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_longjmp_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_macros_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_maplog_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_mheap_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_pool_iterate_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_ptclosure_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_random_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
test_random_isaac_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
test_serialize_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
test_slist_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
test_socket_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_time_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_timing_wheel_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
test_tw_timer_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_valloc_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_vec_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG
test_zvec_CPPFLAGS =	$(AM_CPPFLAGS) -DCLIB_DEBUG

test_bihash_template_LDADD =	libvppinfra.la
test_bihash_vec88_LDADD =	libvppinfra.la
test_cuckoo_template_LDADD =	libvppinfra.la
test_cuckoo_bihash_LDADD =	libvppinfra.la
test_dlist_LDADD =	libvppinfra.la
test_elf_LDADD =	libvppinfra.la
test_elog_LDADD =	libvppinfra.la
test_fifo_LDADD =	libvppinfra.la
test_flowhash_template_LDADD =  libvppinfra.la
test_format_LDADD =	libvppinfra.la
test_fpool_LDADD =	libvppinfra.la
test_hash_LDADD =	libvppinfra.la
test_heap_LDADD =	libvppinfra.la
test_longjmp_LDADD =	libvppinfra.la
test_macros_LDADD =	libvppinfra.la
test_maplog_LDADD =	libvppinfra.la
test_mheap_LDADD =	libvppinfra.la
test_pool_iterate_LDADD =	libvppinfra.la
test_ptclosure_LDADD =	libvppinfra.la
test_random_isaac_LDADD =	libvppinfra.la
test_random_LDADD =	libvppinfra.la
test_serialize_LDADD =	libvppinfra.la
test_slist_LDADD =	libvppinfra.la
test_socket_LDADD =	libvppinfra.la
test_time_LDADD =	libvppinfra.la -lm
test_time_range_LDADD =	libvppinfra.la -lm
test_timing_wheel_LDADD =	libvppinfra.la -lm
test_tw_timer_LDADD =	libvppinfra.la
test_valloc_LDADD =	libvppinfra.la
test_vec_LDADD =	libvppinfra.la
test_zvec_LDADD =	libvppinfra.la

test_bihash_template_LDFLAGS = -static
test_bihash_vec88_LDFLAGS = -static
test_cuckoo_template_LDFLAGS = -static
test_cuckoo_bihash_LDFLAGS = -static -lpthread
test_dlist_LDFLAGS = -static
test_elf_LDFLAGS = -static
test_elog_LDFLAGS = -static
test_fifo_LDFLAGS = -static
test_flowhash_template_LDFLAGS = -static
test_format_LDFLAGS = -static
test_fpool_LDFLAGS = -static
test_hash_LDFLAGS = -static
test_heap_LDFLAGS = -static
test_longjmp_LDFLAGS = -static
test_macros_LDFLAGS = -static
test_maplog_LDFLAGS = -static
test_mheap_LDFLAGS = -static
test_pool_iterate_LDFLAGS = -static
test_ptclosure_LDFLAGS = -static
test_random_isaac_LDFLAGS = -static
test_random_LDFLAGS = -static
test_serialize_LDFLAGS = -static
test_slist_LDFLAGS = -static
test_socket_LDFLAGS = -static
test_time_LDFLAGS = -static
test_time_range_LDFLAGS = -static
test_timing_wheel_LDFLAGS = -static
test_tw_timer_LDFLAGS = -static
test_valloc_LDFLAGS = -static
test_vec_LDFLAGS = -static
test_zvec_LDFLAGS = -static

# noinst_PROGRAMS += test_vhash
# test_vhash_SOURCES = vppinfra/test_vhash.c vppinfra/vhash.c
# test_vhash_CPPFLAGS = $(AM_CPPFLAGS) -DCLIB_DEBUG
# test_vhash_LDADD = libvppinfra.la
# test_vhash_LDFLAGS = -static

nobase_include_HEADERS = \
  vppinfra/asm_mips.h \
  vppinfra/asm_x86.h \
  vppinfra/bihash_8_8.h \
  vppinfra/bihash_vec8_8.h \
  vppinfra/bihash_16_8.h \
  vppinfra/bihash_24_8.h \
  vppinfra/bihash_40_8.h \
  vppinfra/bihash_48_8.h \
  vppinfra/bihash_template.h \
  vppinfra/bihash_template.c \
  vppinfra/bitmap.h \
  vppinfra/bitops.h \
  vppinfra/byte_order.h \
  vppinfra/cache.h \
  vppinfra/config.h \
  vppinfra/clib.h \
  vppinfra/clib_error.h \
  vppinfra/cpu.h \
  vppinfra/crc32.h \
  vppinfra/lb_hash_hash.h \
  vppinfra/dlist.h \
  vppinfra/elf.h \
  vppinfra/elf_clib.h \
  vppinfra/elog.h \
  vppinfra/fheap.h \
  vppinfra/error.h \
  vppinfra/error_bootstrap.h \
  vppinfra/fifo.h \
  vppinfra/file.h \
  vppinfra/flowhash_template.h \
  vppinfra/flowhash_8_8.h \
  vppinfra/flowhash_24_16.h \
  vppinfra/format.h \
  vppinfra/graph.h \
  vppinfra/hash.h \
  vppinfra/heap.h \
  vppinfra/linux/sysfs.h \
  vppinfra/linux/syscall.h \
  vppinfra/lock.h \
  vppinfra/longjmp.h \
  vppinfra/macros.h \
  vppinfra/maplog.h \
  vppinfra/math.h \
  vppinfra/mem.h \
  vppinfra/memcpy_sse3.h \
  vppinfra/memcpy_avx2.h \
  vppinfra/memcpy_avx512.h \
  vppinfra/mhash.h \
  vppinfra/mheap.h \
  vppinfra/os.h \
  vppinfra/pipeline.h \
  vppinfra/pool.h \
  vppinfra/ptclosure.h \
  vppinfra/random.h \
  vppinfra/random_buffer.h \
  vppinfra/random_isaac.h \
  vppinfra/serialize.h \
  vppinfra/slist.h \
  vppinfra/smp.h \
  vppinfra/socket.h \
  vppinfra/sparse_vec.h \
  vppinfra/string.h \
  vppinfra/time.h \
  vppinfra/time_range.h \
  vppinfra/timing_wheel.h \
  vppinfra/timer.h \
  vppinfra/tw_timer_2t_1w_2048sl.h \
  vppinfra/tw_timer_16t_2w_512sl.h \
  vppinfra/tw_timer_16t_1w_2048sl.h \
  vppinfra/tw_timer_4t_3w_256sl.h \
  vppinfra/tw_timer_1t_3w_1024sl_ov.h \
  vppinfra/tw_timer_template.h \
  vppinfra/tw_timer_template.c \
  vppinfra/types.h \
  vppinfra/unix.h \
  vppinfra/valloc.h \
  vppinfra/vec.h \
  vppinfra/vec_bootstrap.h \
  vppinfra/vector.h \
  vppinfra/vector_altivec.h \
  vppinfra/vector_avx2.h \
  vppinfra/vector_avx512.h \
  vppinfra/vector_funcs.h \
  vppinfra/vector_neon.h \
  vppinfra/vector_sse42.h \
  vppinfra/valgrind.h \
  vppinfra/xxhash.h \
  vppinfra/xy.h \
  vppinfra/zvec.h

if ENABLE_DLMALLOC
  nobase_include_HEADERS += \
  vppinfra/dlmalloc.h
else
  nobase_include_HEADERS +=  \
  vppinfra/mheap_bootstrap.h 
endif

CLIB_CORE = \
  vppinfra/asm_x86.c \
  vppinfra/backtrace.c \
  vppinfra/bihash_8_8.h \
  vppinfra/bihash_vec8_8.h \
  vppinfra/bihash_24_8.h \
  vppinfra/bihash_template.h \
  vppinfra/cpu.c \
  vppinfra/elf.c \
  vppinfra/elog.c \
  vppinfra/error.c \
  vppinfra/fifo.c \
  vppinfra/fheap.c \
  vppinfra/flowhash_8_8.h \
  vppinfra/flowhash_24_16.h \
  vppinfra/flowhash_template.h \
  vppinfra/format.c \
  vppinfra/pool.c \
  vppinfra/graph.c \
  vppinfra/hash.c \
  vppinfra/heap.c \
  vppinfra/longjmp.S \
  vppinfra/macros.c \
  vppinfra/mhash.c \
  vppinfra/ptclosure.c \
  vppinfra/random.c \
  vppinfra/random_buffer.c \
  vppinfra/random_isaac.c \
  vppinfra/serialize.c \
  vppinfra/slist.c \
  vppinfra/std-formats.c \
  vppinfra/string.c \
  vppinfra/time.c \
  vppinfra/time_range.c \
  vppinfra/timing_wheel.c \
  vppinfra/tw_timer_template.h \
  vppinfra/tw_timer_2t_1w_2048sl.h \
  vppinfra/tw_timer_2t_1w_2048sl.c \
  vppinfra/tw_timer_16t_2w_512sl.h \
  vppinfra/tw_timer_16t_2w_512sl.c \
  vppinfra/tw_timer_16t_1w_2048sl.h \
  vppinfra/tw_timer_16t_1w_2048sl.c \
  vppinfra/tw_timer_4t_3w_256sl.h \
  vppinfra/tw_timer_4t_3w_256sl.c \
  vppinfra/tw_timer_1t_3w_1024sl_ov.h \
  vppinfra/tw_timer_1t_3w_1024sl_ov.c \
  vppinfra/unformat.c \
  vppinfra/valloc.c \
  vppinfra/vec.c \
  vppinfra/vector.c \
  vppinfra/zvec.c

if ENABLE_DLMALLOC
  CLIB_CORE += \
  vppinfra/mem_dlmalloc.c \
  vppinfra/dlmalloc.c \
  vppinfra/dlmalloc.h
else
  CLIB_CORE += \
  vppinfra/mheap.c \
  vppinfra/mem_mheap.c 
endif

# Core plus Unix additions
libvppinfra_la_SOURCES =			\
  $(CLIB_CORE)					\
  vppinfra/elf_clib.c				\
  vppinfra/linux/mem.c				\
  vppinfra/linux/sysfs.c			\
  vppinfra/maplog.c 				\
  vppinfra/socket.c				\
  vppinfra/timer.c				\
  vppinfra/unix-formats.c			\
  vppinfra/unix-misc.c

bin_PROGRAMS = elftool

elftool_SOURCES = tools/elftool/elftool.c
elftool_CPPFLAGS = $(AM_CPPFLAGS)
elftool_LDADD = libvppinfra.la -lpthread -lrt -lm

# vi:syntax=automake