[PATCH v2] test/event_eth_tx_adapter: skip tests if no eventdev

Bruce Richardson <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
If there is no eventdev present, and the SW eventdev driver is not
available, skip the eth tx adapter tests, rather than failing on event
creation.

Note: We keep the failure case where we do have the event/sw driver
built, but fail to create an instance of it.

Signed-off-by: Bruce Richardson <[email protected]>
---
 app/test/test_event_eth_tx_adapter.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/test/test_event_eth_tx_adapter.c b/app/test/test_event_eth_tx_adapter.c
index bec298a8b8..0c161897ce 100644
--- a/app/test/test_event_eth_tx_adapter.c
+++ b/app/test/test_event_eth_tx_adapter.c
@@ -202,18 +202,23 @@ deinit_ports(void)
 static int
 testsuite_setup(void)
 {
-	const char *vdev_name = "event_sw0";
-
 	int err = init_ports();
 	TEST_ASSERT(err == 0, "Port initialization failed err %d\n", err);
 
 	if (rte_event_dev_count() == 0) {
+#ifdef RTE_EVENT_SW
+		const char *vdev_name = "event_sw0";
+
 		printf("Failed to find a valid event device,"
 			" testing with event_sw0 device\n");
 		err = rte_vdev_init(vdev_name, NULL);
 		TEST_ASSERT(err == 0, "vdev %s creation failed  %d\n",
 			vdev_name, err);
 		event_dev_delete = 1;
+#else
+		printf("Failed to find a valid event device, skipping test\n");
+		return TEST_SKIPPED;
+#endif
 	}
 	return err;
 }
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.