From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id BC8B643063;
	Mon, 14 Aug 2023 17:16:29 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 2E3AB432A9;
	Mon, 14 Aug 2023 17:16:24 +0200 (CEST)
Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20])
 by mails.dpdk.org (Postfix) with ESMTP id 694A140A7F;
 Mon, 14 Aug 2023 17:16:21 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1692026181; x=1723562181;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=xdo0l5GXS19yPeG8kdUUcbUABk11qat6WN2U/QjeZMI=;
 b=JXZBh2ESOMJGpz7hChLEPgo5zNU0tMwLK4WYonvQ9kKaB7CDRsDjdQGu
 eQA4Bm37h3jqHeqNKcfaKHVpS/c0toZoEfnAMkp94VP9/mkhN2XAGH6vP
 OYwrl7GwR11CeKQsLOmIccdddJYm4grYsisoKl5JuNYGE4Ji+kqv1prRs
 0HV2uob46FTawn+WFY6Lb/vXmKt69Y1YOy9FBRva6cKIQySh2ajDzD6xm
 URAabukccYwaryrOM1q0JkvFg6M1X59yWnVhBebZtOgzulZOB7sp4HIqq
 oUitownYP8dRCfgMhEnfDoefyJakRDqTL1o4DOb7deAJdNazhuC5REsrS Q==;
X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="362211246"
X-IronPort-AV: E=Sophos;i="6.01,172,1684825200"; d="scan'208";a="362211246"
Received: from fmsmga004.fm.intel.com ([10.253.24.48])
 by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 14 Aug 2023 08:16:20 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="803499913"
X-IronPort-AV: E=Sophos;i="6.01,172,1684825200"; d="scan'208";a="803499913"
Received: from silpixa00401385.ir.intel.com ([10.237.214.14])
 by fmsmga004.fm.intel.com with ESMTP; 14 Aug 2023 08:16:19 -0700
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: ci@dpdk.org,
	Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH v2 1/8] app/test: add new macros for various test types
Date: Mon, 14 Aug 2023 16:16:02 +0100
Message-Id: <20230814151609.3077077-2-bruce.richardson@intel.com>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <20230814151609.3077077-1-bruce.richardson@intel.com>
References: <20230721115125.55137-1-bruce.richardson@intel.com>
 <20230814151609.3077077-1-bruce.richardson@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Rather than just registering all tests using a single generic macro,
add macros which identify the test as being of a particular type.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 app/test/test.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/app/test/test.h b/app/test/test.h
index 85f57efbc6..a91ded76af 100644
--- a/app/test/test.h
+++ b/app/test/test.h
@@ -190,7 +190,7 @@ struct test_command {
 
 void add_test_command(struct test_command *t);
 
-/* Register a test function with its command string */
+/* Register a test function with its command string. Should not be used directly */
 #define REGISTER_TEST_COMMAND(cmd, func) \
 	static struct test_command test_struct_##cmd = { \
 		.command = RTE_STR(cmd), \
@@ -201,4 +201,11 @@ void add_test_command(struct test_command *t);
 		add_test_command(&test_struct_##cmd); \
 	}
 
+/* Register a test function as a particular type.
+ * These can be used to build up test suites automatically
+ */
+#define REGISTER_FAST_TEST(cmd, no_huge, ASan, func)  REGISTER_TEST_COMMAND(cmd, func)
+#define REGISTER_PERF_TEST REGISTER_TEST_COMMAND
+#define REGISTER_DRIVER_TEST REGISTER_TEST_COMMAND
+
 #endif
-- 
2.39.2