diff options
Diffstat (limited to 'lib/igt_core.h')
-rw-r--r-- | lib/igt_core.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/igt_core.h b/lib/igt_core.h index b15d9ffe..d79f6d29 100644 --- a/lib/igt_core.h +++ b/lib/igt_core.h @@ -113,7 +113,7 @@ void __igt_fixture_end(void) __attribute__((noreturn)); /* subtest infrastructure */ jmp_buf igt_subtest_jmpbuf; -typedef int (*igt_opt_handler_t)(int opt, int opt_index); +typedef int (*igt_opt_handler_t)(int opt, int opt_index, void *data); #ifndef __GTK_DOC_IGNORE__ /* gtkdoc wants to document this forward decl */ struct option; #endif @@ -121,7 +121,8 @@ int igt_subtest_init_parse_opts(int *argc, char **argv, const char *extra_short_opts, struct option *extra_long_opts, const char *help_str, - igt_opt_handler_t extra_opt_handler); + igt_opt_handler_t extra_opt_handler, + void *handler_data); /** @@ -137,7 +138,8 @@ int igt_subtest_init_parse_opts(int *argc, char **argv, * #igt_main block instead of stitching the test's main() function together * manually. */ -#define igt_subtest_init(argc, argv) igt_subtest_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL); +#define igt_subtest_init(argc, argv) \ + igt_subtest_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL, NULL); bool __igt_run_subtest(const char *subtest_name); #define __igt_tokencat2(x, y) x ## y @@ -202,7 +204,8 @@ bool igt_only_list_subtests(void); #define igt_main \ static void igt_tokencat(__real_main, __LINE__)(void); \ int main(int argc, char **argv) { \ - igt_subtest_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL); \ + igt_subtest_init_parse_opts(&argc, argv, NULL, NULL, NULL, \ + NULL, NULL); \ igt_tokencat(__real_main, __LINE__)(); \ igt_exit(); \ } \ @@ -214,7 +217,8 @@ void igt_simple_init_parse_opts(int *argc, char **argv, const char *extra_short_opts, struct option *extra_long_opts, const char *help_str, - igt_opt_handler_t extra_opt_handler); + igt_opt_handler_t extra_opt_handler, + void *handler_data); /** * igt_simple_init: @@ -227,7 +231,8 @@ void igt_simple_init_parse_opts(int *argc, char **argv, * #igt_simple_main block instead of stitching the test's main() function together * manually. */ -#define igt_simple_init(argc, argv) igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL); +#define igt_simple_init(argc, argv) \ + igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL, NULL); /** * igt_simple_main: @@ -239,7 +244,8 @@ void igt_simple_init_parse_opts(int *argc, char **argv, #define igt_simple_main \ static void igt_tokencat(__real_main, __LINE__)(void); \ int main(int argc, char **argv) { \ - igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, NULL); \ + igt_simple_init_parse_opts(&argc, argv, NULL, NULL, NULL, \ + NULL, NULL); \ igt_tokencat(__real_main, __LINE__)(); \ igt_exit(); \ } \ |