diff options
author | Ricardo Salveti <ricardo.salveti@linaro.org> | 2016-07-18 15:30:53 -0300 |
---|---|---|
committer | Ricardo Salveti <ricardo.salveti@linaro.org> | 2016-07-18 15:31:22 -0300 |
commit | 5d4e5dcd8a186778b3d78e27c81550d07a288fd2 (patch) | |
tree | b84800fce31e7233445a7997c19df409c2a364ea /app/test/test.h | |
parent | a41e6ff15809d40e0f9bbc9576bf8f7f80fbec1d (diff) |
Imported Upstream version 16.07-rc3
Change-Id: I321148bfa234858ba1986d109470b7aa280cd429
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'app/test/test.h')
-rw-r--r-- | app/test/test.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/app/test/test.h b/app/test/test.h index 81828bee..467b9c07 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -250,11 +250,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 |