From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: [PATCH v4 09/10] test: enable rawdev skeleton test Date: Wed, 31 Jan 2018 14:43:17 +0530 Message-ID: <20180131091318.7894-10-shreyansh.jain@nxp.com> References: <20180130145710.24757-1-shreyansh.jain@nxp.com> <20180131091318.7894-1-shreyansh.jain@nxp.com> Mime-Version: 1.0 Content-Type: text/plain Cc: dev@dpdk.org, hemant.agrawal@nxp.com, fiona.trahe@intel.com, rosen.xu@intel.com, Shreyansh Jain To: thomas@monjalon.net Return-path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0086.outbound.protection.outlook.com [104.47.1.86]) by dpdk.org (Postfix) with ESMTP id 9266C1B747 for ; Wed, 31 Jan 2018 09:59:36 +0100 (CET) In-Reply-To: <20180131091318.7894-1-shreyansh.jain@nxp.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- MAINTAINERS | 1 + test/test/Makefile | 4 ++++ test/test/test_rawdev.c | 27 +++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 test/test/test_rawdev.c diff --git a/MAINTAINERS b/MAINTAINERS index 320bcf9a4..42ddfbd8c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -320,6 +320,7 @@ M: Shreyansh Jain M: Hemant Agrawal F: lib/librte_rawdev/* F: drivers/rawdev/skeleton/* +F: test/test/test_rawdev.c Bus Drivers diff --git a/test/test/Makefile b/test/test/Makefile index cb3884a69..a88cc38bf 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 000000000..043a38a13 --- /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); -- 2.14.1