From c62a63dd05bd815cd9ea399140cb6fc50a584132 Mon Sep 17 00:00:00 2001 From: Jakub Grajciar Date: Mon, 20 Nov 2017 13:11:50 +0100 Subject: libmemif: unit test update, continue configure if check module missing Change-Id: I11ef4e7dcf1759eb3545be5db2a7196d1217a6dd Signed-off-by: Jakub Grajciar --- extras/libmemif/Makefile.am | 5 +++-- extras/libmemif/configure.ac | 3 ++- extras/libmemif/test/main_test.c | 10 +++++----- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'extras/libmemif') diff --git a/extras/libmemif/Makefile.am b/extras/libmemif/Makefile.am index 292eb9c21a2..759f5c49d3b 100644 --- a/extras/libmemif/Makefile.am +++ b/extras/libmemif/Makefile.am @@ -80,10 +80,11 @@ icmpr_mt_CPPFLAGS = $(AM_CPPFLAGS) -Isrc -Iexamples/icmp_responder noinst_PROGRAMS = icmpr icmpr-epoll icmpr-mt -check_PROGRAMS = unit_test - include_HEADERS = src/libmemif.h src/memif.h lib_LTLIBRARIES = libmemif.la +if USE_CHECK +check_PROGRAMS = unit_test TESTS = $(check_PROGRAMS) +endif diff --git a/extras/libmemif/configure.ac b/extras/libmemif/configure.ac index 30fd3ddacdc..323e1134104 100644 --- a/extras/libmemif/configure.ac +++ b/extras/libmemif/configure.ac @@ -4,7 +4,8 @@ AM_INIT_AUTOMAKE AM_SILENT_RULES([yes]) AC_PREFIX_DEFAULT([/usr]) -PKG_CHECK_MODULES([CHECK], [check]) +PKG_CHECK_MODULES([CHECK], [check], [HAVE_CHECK=1], [HAVE_CHECK=0]) +AM_CONDITIONAL([USE_CHECK],[test "$HAVE_CHECK" -eq 1]) AC_PROG_CC diff --git a/extras/libmemif/test/main_test.c b/extras/libmemif/test/main_test.c index deb8acb69ff..b7705c4be1a 100644 --- a/extras/libmemif/test/main_test.c +++ b/extras/libmemif/test/main_test.c @@ -437,7 +437,7 @@ START_TEST (test_buffer_alloc) qid = 0; if ((err = memif_buffer_alloc (conn, qid, bufs, max_buf, - &buf)) != MEMIF_ERR_SUCCESS) + &buf, 0)) != MEMIF_ERR_SUCCESS) ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err)); ck_assert_uint_eq (buf, max_buf); @@ -451,7 +451,7 @@ START_TEST (test_buffer_alloc) qid = 1; if ((err = memif_buffer_alloc (conn, qid, bufs, max_buf, - &buf)) != MEMIF_ERR_SUCCESS) + &buf, 0)) != MEMIF_ERR_SUCCESS) ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err)); ck_assert_uint_eq (buf, max_buf); @@ -466,7 +466,7 @@ START_TEST (test_buffer_alloc) qid = 2; if ((err = memif_buffer_alloc (conn, qid, bufs, max_buf, - &buf)) != MEMIF_ERR_SUCCESS) + &buf, 0)) != MEMIF_ERR_SUCCESS) ck_assert_msg (err == MEMIF_ERR_QID, "err code: %u, err msg: %s", err, memif_strerror (err)); @@ -528,7 +528,7 @@ START_TEST (test_tx_burst) qid = 0; if ((err = memif_buffer_alloc (conn, qid, bufs, max_buf, - &buf)) != MEMIF_ERR_SUCCESS) + &buf, 0)) != MEMIF_ERR_SUCCESS) ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err)); ck_assert_uint_eq (buf, max_buf); @@ -549,7 +549,7 @@ START_TEST (test_tx_burst) qid = 1; if ((err = memif_buffer_alloc (conn, qid, bufs, max_buf, - &buf)) != MEMIF_ERR_SUCCESS) + &buf, 0)) != MEMIF_ERR_SUCCESS) ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err)); ck_assert_uint_eq (buf, max_buf); -- cgit 1.2.3-korg