changelog: fix dkms issues on 4.11 (LP: #1691830)
[deb_dpdk.git] / app / test / test.h
index 81828be..82831f4 100644 (file)
 
 #ifndef _TEST_H_
 #define _TEST_H_
+
 #include <stddef.h>
 #include <sys/queue.h>
-#include "rte_log.h"
+
+#include <rte_common.h>
+#include <rte_log.h>
 
 #define TEST_SUCCESS  (0)
 #define TEST_FAILED  (-1)
@@ -235,7 +238,6 @@ int test_pci_run;
 
 int test_mp_secondary(void);
 
-int test_ivshmem(void);
 int test_set_rxtx_conf(cmdline_fixed_string_t mode);
 int test_set_rxtx_anchor(cmdline_fixed_string_t type);
 int test_set_rxtx_sc(cmdline_fixed_string_t type);
@@ -250,11 +252,16 @@ struct test_command {
 
 void add_test_command(struct test_command *t);
 
-#define REGISTER_TEST_COMMAND(t) \
-static void __attribute__((used)) testfn_##t(void);\
-void __attribute__((constructor, used)) testfn_##t(void)\
-{\
-       add_test_command(&t);\
-}
+/* Register a test function with its command string */
+#define REGISTER_TEST_COMMAND(cmd, func) \
+       static struct test_command test_struct_##cmd = { \
+               .command = RTE_STR(cmd), \
+               .callback = func, \
+       }; \
+       static void __attribute__((constructor, used)) \
+       test_register_##cmd(void) \
+       { \
+               add_test_command(&test_struct_##cmd); \
+       }
 
 #endif