[v2,1/8] app/test: add new macros for various test types

Message ID 20230814151609.3077077-2-bruce.richardson@intel.com (mailing list archive)
State New
Headers
Series expand list of optional libraries |

Commit Message

Bruce Richardson Aug. 14, 2023, 3:16 p.m. UTC
  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(-)
  

Patch

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