X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=app%2Ftest%2Ftest.h;h=82831f4e6cf4ae650aca49c7e191e39208f83b18;hb=4dedbcda930fbdbd1367dc144365224997b9b89a;hp=81828bee7720a8dfd5f5c001eed674ff1d491910;hpb=809f08006d56e7ba4ce190b0a63d44acf62d8044;p=deb_dpdk.git diff --git a/app/test/test.h b/app/test/test.h index 81828bee..82831f4e 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -33,9 +33,12 @@ #ifndef _TEST_H_ #define _TEST_H_ + #include #include -#include "rte_log.h" + +#include +#include #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