tests: only compile and run io_uring tests if liburing-dev is installed

Compiling of io_uring tests fail if liburing-dev is not installed.
Also, the tests were not running as part of the test suite.

Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
Georgia Garcia 2023-07-05 11:05:02 -03:00
parent f6b179010e
commit 502b83a2a6

View file

@ -104,7 +104,6 @@ SRC=access.c \
fd_inheritance.c \ fd_inheritance.c \
fd_inheritor.c \ fd_inheritor.c \
fork.c \ fork.c \
io_uring.c \
link.c \ link.c \
link_subset.c \ link_subset.c \
mmap.c \ mmap.c \
@ -174,6 +173,17 @@ Install libdbus-1-dev or equivalent package to build and run these tests${nl}\
************************************************************************${nl}) ************************************************************************${nl})
endif endif
#only do io_uring if proper lib is installed
ifneq (,$(shell pkg-config --exists liburing && echo TRUE))
SRC+=io_uring.c
else
$(warning ${nl}\
************************************************************************${nl}\
No liburing pkg-config skipping io_uring tests ...${nl}\
Install liburing-dev or equivalent package to build and run this test${nl}\
************************************************************************${nl})
endif
TRANSITION_CFLAGS= TRANSITION_CFLAGS=
AA_POLICY_CACHE_CFLAGS= AA_POLICY_CACHE_CFLAGS=
ifdef USE_SYSTEM ifdef USE_SYSTEM
@ -275,6 +285,11 @@ ifneq (,$(shell pkg-config --exists dbus-1 && echo TRUE))
TESTS+=dbus_eavesdrop dbus_message dbus_service dbus_unrequested_reply TESTS+=dbus_eavesdrop dbus_message dbus_service dbus_unrequested_reply
endif endif
#only do io_uring if proper lib is installed
ifneq (,$(shell pkg-config --exists liburing && echo TRUE))
TESTS+=io_uring
endif
TESTS+=$(CONDITIONAL_TESTS) TESTS+=$(CONDITIONAL_TESTS)
# Tests that can crash the kernel should be placed here # Tests that can crash the kernel should be placed here