From: Shreyansh Jain Date: Wed, 31 Jan 2018 09:13:17 +0000 (+0530) Subject: test: enable rawdev skeleton test X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=544092a0f954a283dd2e074ef10f88be215e00d3;p=dpdk.git test: enable rawdev skeleton test Skeleton rawdevice test cases are part of driver layer. This patch allows test cases to be executed using 'rawdev_autotest' command in test framework. Signed-off-by: Shreyansh Jain --- diff --git a/MAINTAINERS b/MAINTAINERS index 4654d22af8..9beb30237a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -320,6 +320,7 @@ M: Shreyansh Jain M: Hemant Agrawal F: lib/librte_rawdev/ F: drivers/raw/skeleton_rawdev/ +F: test/test/test_rawdev.c Bus Drivers diff --git a/test/test/Makefile b/test/test/Makefile index cb3884a69e..a88cc38bfe 100644 --- a/test/test/Makefile +++ b/test/test/Makefile @@ -187,6 +187,10 @@ SRCS-y += test_event_ring.c SRCS-y += test_event_eth_rx_adapter.c endif +ifeq ($(CONFIG_RTE_LIBRTE_RAWDEV),y) +SRCS-y += test_rawdev.c +endif + SRCS-$(CONFIG_RTE_LIBRTE_KVARGS) += test_kvargs.c CFLAGS += -DALLOW_EXPERIMENTAL_API diff --git a/test/test/test_rawdev.c b/test/test/test_rawdev.c new file mode 100644 index 0000000000..043a38a13f --- /dev/null +++ b/test/test/test_rawdev.c @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2017 NXP + */ +#include +#include +#include +#include +#include +#include +#include + +#include "test.h" + +static int +test_rawdev_selftest_impl(const char *pmd, const char *opts) +{ + rte_vdev_init(pmd, opts); + return rte_rawdev_selftest(rte_rawdev_get_dev_id(pmd)); +} + +static int +test_rawdev_selftest_skeleton(void) +{ + return test_rawdev_selftest_impl("rawdev_skeleton", ""); +} + +REGISTER_TEST_COMMAND(rawdev_autotest, test_rawdev_selftest_skeleton);